Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Sep 2, 2019
2 parents c11794d + 0d49aea commit bb410a7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
Expand Up @@ -58,13 +58,6 @@ protected Iterator<String> getChoices(String input) {

}

@Override
protected void onConfigure() {
super.onConfigure();
itemDefinitionAsStringModel.setObject(null);
}


};

input.add(new OnChangeAjaxBehavior() {
Expand Down
Expand Up @@ -7,6 +7,7 @@

import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.markup.html.WebMarkupContainer;
Expand Down Expand Up @@ -64,6 +65,16 @@ public ItemPathPanel(String id, ItemPathType itemPath) {

}

@Override
protected void onConfigure(){
super.onConfigure();
if (getModelObject() == null || getModelObject().getItemDef() == null){
ItemPathSegmentPanel itemPathSegmentPanel = getItemPathSegmentPanel();
if (itemPathSegmentPanel != null){
itemPathSegmentPanel.getBaseFormComponent().getDefaultModel().setObject(null);
}
}
}
private void initLayout() {
initItemPathPanel();

Expand All @@ -87,15 +98,7 @@ public boolean isVisible() {

});

ItemPathSegmentPanel itemDefPanel = new ItemPathSegmentPanel(ID_DEFINITION,
new IModel<ItemPathDto>() {

private static final long serialVersionUID = 1L;
public ItemPathDto getObject() {
return ItemPathPanel.this.getModelObject();
}

}) {
ItemPathSegmentPanel itemDefPanel = new ItemPathSegmentPanel(ID_DEFINITION, getModel()) {

private static final long serialVersionUID = 1L;

Expand All @@ -109,6 +112,7 @@ protected void onUpdateAutoCompletePanel(AjaxRequestTarget target) {
ItemPathPanel.this.onUpdate(ItemPathPanel.this.getModelObject());
}
};
itemDefPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
itemDefPanel.setOutputMarkupId(true);
itemPathPanel.add(itemDefPanel);

Expand All @@ -118,7 +122,6 @@ protected void onUpdateAutoCompletePanel(AjaxRequestTarget target) {
@Override
public void onClick(AjaxRequestTarget target) {
refreshItemPathPanel(new ItemPathDto(ItemPathPanel.this.getModelObject()), true, target);

}

};
Expand Down Expand Up @@ -287,4 +290,8 @@ protected void onUpdate(ItemPathDto itemPathDto) {

}

protected ItemPathSegmentPanel getItemPathSegmentPanel(){
return (ItemPathSegmentPanel) get(ID_ITEM_PATH).get(ID_DEFINITION);
}

}
Expand Up @@ -6,6 +6,7 @@

import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;
import org.apache.commons.lang.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -85,7 +86,7 @@ protected void onUpdateAutoComplete(AjaxRequestTarget target,
}

};
// itemDefPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
itemDefPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
itemDefPanel.setOutputMarkupId(true);
add(itemDefPanel);
}
Expand Down Expand Up @@ -146,7 +147,7 @@ public boolean validate() {
}

public Component getBaseFormComponent() {
return get(ID_DEFINITION);
return ((AutoCompleteItemDefinitionPanel)get(ID_DEFINITION)).getBaseFormComponent();
}


Expand Down
Expand Up @@ -29,6 +29,7 @@
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.gui.api.component.path.ItemPathDto;
import com.evolveum.midpoint.prism.path.ItemPath;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down

0 comments on commit bb410a7

Please sign in to comment.