use of org.apache.wicket.markup.html.form.TextField in project midpoint by Evolveum.
the class DirectlyEditablePropertyColumn method createInputPanel.
protected InputPanel createInputPanel(String componentId, final IModel<T> model) {
TextPanel<?> textPanel = new TextPanel<String>(componentId, new PropertyModel<>(model, getPropertyExpression()));
// UGLY HACK
TextField<?> textField = (TextField<?>) textPanel.getBaseFormComponent();
textField.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onBlur(target, model);
}
});
return textPanel;
}
use of org.apache.wicket.markup.html.form.TextField in project midpoint by Evolveum.
the class ResourceIterationEditor method initLayout.
protected void initLayout(PageResourceWizard parentPage) {
loadModel();
getModel();
TextField maxIteration = new TextField<>(ID_MAX_ITERATION, new PropertyModel<Integer>(model, IterationSpecificationTypeDto.F_ITERATION + "." + "maxIterations"));
parentPage.addEditingEnabledBehavior(maxIteration);
add(maxIteration);
prepareIterationSubsectionBody(IterationSpecificationType.F_TOKEN_EXPRESSION.getLocalPart(), ID_TOKEN_DESCRIPTION, ID_TOKEN_VARIABLE_LIST, ID_TOKEN_RETURN_MULTIPLICITY, ID_TOKEN_EXPR_TYPE, ID_TOKEN_EXPR, ID_TOKEN_EXPR_LANG, ID_TOKEN_EXPR_POLICY, IterationSpecificationTypeDto.TOKEN_EXPRESSION_PREFIX, ID_TOKEN_LANG_CONTAINER, ID_TOKEN_POLICY_CONTAINER, parentPage);
prepareIterationSubsectionBody(IterationSpecificationType.F_PRE_ITERATION_CONDITION.getLocalPart(), ID_PRE_DESCRIPTION, ID_PRE_VARIABLE_LIST, ID_PRE_RETURN_MULTIPLICITY, ID_PRE_EXPR_TYPE, ID_PRE_EXPR, ID_PRE_EXPR_LANG, ID_PRE_EXPR_POLICY, IterationSpecificationTypeDto.PRE_EXPRESSION_PREFIX, ID_PRE_LANG_CONTAINER, ID_PRE_POLICY_CONTAINER, parentPage);
prepareIterationSubsectionBody(IterationSpecificationType.F_POST_ITERATION_CONDITION.getLocalPart(), ID_POST_DESCRIPTION, ID_POST_VARIABLE_LIST, ID_POST_RETURN_MULTIPLICITY, ID_POST_EXPR_TYPE, ID_POST_EXPR, ID_POST_EXPR_LANG, ID_POST_EXPR_POLICY, IterationSpecificationTypeDto.POST_EXPRESSION_PREFIX, ID_POST_LANG_CONTAINER, ID_POST_POLICY_CONTAINER, parentPage);
Label maxItTooltip = new Label(ID_T_MAX_ITERATION);
maxItTooltip.add(new InfoTooltipBehavior());
add(maxItTooltip);
Label tokenVarTooltip = new Label(ID_T_TOKEN_VAR);
tokenVarTooltip.add(new InfoTooltipBehavior());
add(tokenVarTooltip);
Label tokenMulTooltip = new Label(ID_T_TOKEN_MUL);
tokenMulTooltip.add(new InfoTooltipBehavior());
add(tokenMulTooltip);
Label preVarTooltip = new Label(ID_T_PRE_VAR);
preVarTooltip.add(new InfoTooltipBehavior());
add(preVarTooltip);
Label preMulTooltip = new Label(ID_T_PRE_MUL);
preMulTooltip.add(new InfoTooltipBehavior());
add(preMulTooltip);
Label postVarTooltip = new Label(ID_T_POST_VAR);
postVarTooltip.add(new InfoTooltipBehavior());
add(postVarTooltip);
Label postMulTooltip = new Label(ID_T_POST_MUL);
postMulTooltip.add(new InfoTooltipBehavior());
add(postMulTooltip);
initModals();
}
use of org.apache.wicket.markup.html.form.TextField in project midpoint by Evolveum.
the class SearchPanel method initPopover.
private void initPopover() {
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
final WebMarkupContainer propList = new WebMarkupContainer(ID_PROP_LIST);
propList.setOutputMarkupId(true);
popover.add(propList);
ListView properties = new ListView<SearchItemDefinition>(ID_PROPERTIES, new PropertyModel<>(moreDialogModel, MoreDialogDto.F_PROPERTIES)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<SearchItemDefinition> item) {
CheckBox check = new CheckBox(ID_CHECK, new PropertyModel<>(item.getModel(), SearchItemDefinition.F_SELECTED));
check.add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
// nothing, just update model.
}
});
item.add(check);
AjaxLink<Void> propLink = new AjaxLink<Void>(ID_PROP_LINK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addOneItemPerformed(item.getModelObject(), target);
}
};
item.add(propLink);
Label name = new Label(ID_PROP_NAME, new PropertyModel<>(item.getModel(), SearchItemDefinition.F_NAME));
name.setRenderBodyOnly(true);
propLink.add(name);
Label help = new Label(ID_HELP);
IModel<String> helpModel = new PropertyModel<>(item.getModel(), SearchItemDefinition.F_HELP);
help.add(AttributeModifier.replace("title", createStringResource(helpModel.getObject() != null ? helpModel.getObject() : "")));
help.add(new InfoTooltipBehavior() {
@Override
public String getDataPlacement() {
return "left";
}
});
help.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(helpModel.getObject())));
item.add(help);
item.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
SearchItemDefinition property = item.getModelObject();
Search<C> search = SearchPanel.this.getModelObject();
if (!search.getAvailableDefinitions().contains(property)) {
return false;
}
for (SearchItem searchItem : search.getItems()) {
if (searchItem.getDefinition().equals(property)) {
return false;
}
if (searchItem instanceof PropertySearchItem) {
ItemPath propertyPath = property.getPath();
if (propertyPath != null && QNameUtil.match(propertyPath.lastName(), ((PropertySearchItem) searchItem).getPath().lastName())) {
return false;
}
}
}
MoreDialogDto dto = moreDialogModel.getObject();
String nameFilter = dto.getNameFilter();
String propertyName = property.getName().toLowerCase();
if (StringUtils.isNotEmpty(nameFilter) && !propertyName.contains(nameFilter.toLowerCase())) {
return false;
}
return true;
}
});
}
};
propList.add(properties);
TextField<?> addText = new TextField<>(ID_ADD_TEXT, new PropertyModel<>(moreDialogModel, MoreDialogDto.F_NAME_FILTER));
addText.add(WebComponentUtil.preventSubmitOnEnterKeyDownBehavior());
popover.add(addText);
addText.add(new AjaxFormComponentUpdatingBehavior("keyup") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(propList);
}
});
popover.add(addText);
AjaxButton add = new AjaxButton(ID_ADD, createStringResource("SearchPanel.add")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addItemPerformed(target);
}
};
popover.add(add);
AjaxButton close = new AjaxButton(ID_CLOSE, createStringResource("SearchPanel.close")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
closeMorePopoverPerformed(target);
}
};
popover.add(close);
}
use of org.apache.wicket.markup.html.form.TextField in project midpoint by Evolveum.
the class TextPopupPanel method initLayout.
private void initLayout() {
final TextField input = initTextField();
input.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
input.setOutputMarkupId(true);
add(input);
}
use of org.apache.wicket.markup.html.form.TextField in project midpoint by Evolveum.
the class BrowserPopupPanel method initLayout.
private void initLayout() {
IModel value = new PropertyModel(getModel(), SearchValue.F_LABEL);
TextField input = new TextField(ID_BROWSER_INPUT, value);
add(input);
AjaxLink<Void> browse = new AjaxLink<Void>(ID_BROWSE) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
browsePerformed(target);
}
};
add(browse);
}
Aggregations