Program: 117321
Project: 117321
Buggy source:
public LinkEditPanel(String id,IModel<ODocument> documentModel,IModel<OProperty> propertyModel){
  super(id,new DynamicPropertyValueModel<OIdentifiable>(documentModel,propertyModel));
  setOutputMarkupPlaceholderTag(true);
  setRenderBodyOnly(false);
  inputDocument=new ODocumentModel((ORID)getModelObject());
  add(new ODocumentPageLink("String_Node_Str",inputDocument).setDocumentNameAsBody(true));
  modal=new ModalWindow("String_Node_Str");
  modal.setAutoSize(true);
  add(modal);
  modal.setTitle(new ResourceModel("String_Node_Str"));
  modal.setContent(new SelectDialogPanel(modal.getContentId(),modal,new PropertyModel<OClass>(propertyModel,"String_Node_Str"),false){
    @Override protected boolean onSelect(    AjaxRequestTarget target,    List<ODocument> objects,    boolean selectMore){
      if (objects == null || objects.size() == 0)       return true;
      if (objects.size() > 1) {
        String message=getLocalizer().getString("String_Node_Str",this).replace("String_Node_Str","String_Node_Str");
        target.appendJavaScript("String_Node_Str" + message + "String_Node_Str");
        return false;
      }
 else {
        inputDocument.setObject(objects.get(0));
        target.add(LinkEditPanel.this);
        return true;
      }
    }
  }
);
  add(new AjaxLink("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      modal.show(target);
    }
  }
);
  add(new AjaxLink("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      inputDocument.setObject(null);
      target.add(LinkEditPanel.this);
    }
    @Override protected void onConfigure(){
      super.onConfigure();
      setVisible(inputDocument.getObject() != null);
    }
  }
);
}

Fixed version (ground truth):
public LinkEditPanel(String id,IModel<ODocument> documentModel,IModel<OProperty> propertyModel){
  super(id,new DynamicPropertyValueModel<OIdentifiable>(documentModel,propertyModel));
  setOutputMarkupPlaceholderTag(true);
  setRenderBodyOnly(false);
  inputDocument=new ODocumentModel(getModelObject());
  add(new ODocumentPageLink("String_Node_Str",inputDocument).setDocumentNameAsBody(true));
  modal=new ModalWindow("String_Node_Str");
  modal.setAutoSize(true);
  add(modal);
  modal.setTitle(new ResourceModel("String_Node_Str"));
  modal.setContent(new SelectDialogPanel(modal.getContentId(),modal,new PropertyModel<OClass>(propertyModel,"String_Node_Str"),false){
    @Override protected boolean onSelect(    AjaxRequestTarget target,    List<ODocument> objects,    boolean selectMore){
      if (objects == null || objects.size() == 0)       return true;
      if (objects.size() > 1) {
        String message=getLocalizer().getString("String_Node_Str",this).replace("String_Node_Str","String_Node_Str");
        target.appendJavaScript("String_Node_Str" + message + "String_Node_Str");
        return false;
      }
 else {
        inputDocument.setObject(objects.get(0));
        target.add(LinkEditPanel.this);
        return true;
      }
    }
  }
);
  add(new AjaxLink("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      modal.show(target);
    }
  }
);
  add(new AjaxLink("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      inputDocument.setObject(null);
      target.add(LinkEditPanel.this);
    }
    @Override protected void onConfigure(){
      super.onConfigure();
      setVisible(inputDocument.getObject() != null);
    }
  }
);
}