private void addSelectItem( HtmlSelectOneMenu select, String value, String label ) { SelectItem selectItem = new SelectItem(); selectItem.putAttribute( "itemLabel", label ); selectItem.putAttribute( "itemValue", value ); select.getChildren().add( selectItem ); } }
private void addSelectItem( HtmlSelectOneMenu select, String value, String label ) { SelectItem selectItem = new SelectItem(); selectItem.putAttribute( "itemLabel", label ); selectItem.putAttribute( "itemValue", value ); select.getChildren().add( selectItem ); } }
private void addSelectItem(HtmlSelectOneMenu select, String value, String label) { SelectItem item = new SelectItem(); item.putAttribute("itemValue", value); item.putAttribute("itemLabel", label); select.getChildren().add(item); } }
private void addSelectItem(HtmlSelectOneMenu select, String value, String label) { SelectItem item = new SelectItem(); item.putAttribute("itemValue", value); item.putAttribute("itemLabel", label); select.getChildren().add(item); } }
@Override protected void addSelectItems(HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes) { // Add an empty option to select menus on search pages addSelectItem(select, null, null); SelectItems items = new SelectItems(); items.putAttribute("value", valueExpression); select.getChildren().add(items); }
private void addSelectItem(HtmlSelectOneMenu select, String value, String label) { SelectItem selectItem = new SelectItem(); selectItem.putAttribute("itemLabel", label); selectItem.putAttribute("itemValue", value); select.getChildren().add(selectItem); } }
@Override protected void addSelectItems(HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes) { // Add an empty option to select menus on search pages addSelectItem(select, null, null); SelectItems items = new SelectItems(); items.putAttribute("value", valueExpression); select.getChildren().add(items); }
protected void addSelectItems( HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes ) { // Empty option // // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has // a converter, because the empty String may not be a compatible value if ( WidgetBuilderUtils.needsEmptyLookupItem( attributes ) ) { addSelectItem( select, null, null ); } // Add the select items SelectItems selectItems = new SelectItems(); selectItems.putAttribute( "value", valueExpression ); select.getChildren().add( selectItems ); }
/** * Overrriden to enhance the default f:selectItem widget with more suitable item labels */ @Override protected void addSelectItems(HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes) { // Empty option // // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has // a converter, because the empty String may not be a compatible value if (WidgetBuilderUtils.needsEmptyLookupItem(attributes)) { addSelectItem(select, null, null); } // Add the select items SelectItems selectItems = new SelectItems(); selectItems.putAttribute("value", valueExpression); // For each item to be displayed, set the label to the reverse primary key value if (attributes.containsKey(REVERSE_PRIMARY_KEY)) { selectItems.putAttribute("var", SELECT_ITEM); selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM)); String displayExpression = "forgeview:display(_item)"; ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view"); selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression)); } select.getChildren().add(selectItems); }
/** * Overrriden to enhance the default f:selectItem widget with more suitable item labels */ @Override protected void addSelectItems( HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes ) { // Empty option // // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has // a converter, because the empty String may not be a compatible value if ( WidgetBuilderUtils.needsEmptyLookupItem( attributes ) ) { addSelectItem( select, null, null ); } // Add the select items SelectItems selectItems = new SelectItems(); selectItems.putAttribute("value", valueExpression); // For each item to be displayed, set the label to the reverse primary key value if (attributes.containsKey(REVERSE_PRIMARY_KEY)) { selectItems.putAttribute("var", SELECT_ITEM); selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM)); String displayExpression = "forgeview:display(_item)"; ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view"); selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression)); } select.getChildren().add( selectItems ); }