protected void initFacesSelect( UIComponent component, String facesLookup, Map<String, String> attributes, UIMetawidget metawidget ) { // (pageDirection is a 'safer' default for anything but short lists) if ( component instanceof HtmlSelectManyCheckbox ) { ( (HtmlSelectManyCheckbox) component ).setLayout( "pageDirection" ); } else if ( component instanceof HtmlSelectOneRadio ) { ( (HtmlSelectOneRadio) component ).setLayout( "pageDirection" ); } addSelectItems( component, facesLookup, attributes, metawidget ); }
protected void initFacesSelect( UIComponent component, String facesLookup, Map<String, String> attributes, UIMetawidget metawidget ) { // (pageDirection is a 'safer' default for anything but short lists) if ( component instanceof HtmlSelectManyCheckbox ) { ( (HtmlSelectManyCheckbox) component ).setLayout( "pageDirection" ); } else if ( component instanceof HtmlSelectOneRadio ) { ( (HtmlSelectOneRadio) component ).setLayout( "pageDirection" ); } addSelectItems( component, facesLookup, attributes, metawidget ); }
( (HtmlSelectManyCheckbox) component ).setLayout( "pageDirection" ); } else if ( component instanceof HtmlSelectOneRadio ) { ( (HtmlSelectOneRadio) component ).setLayout( "pageDirection" );
( (HtmlSelectManyCheckbox) component ).setLayout( "pageDirection" ); } else if ( component instanceof HtmlSelectOneRadio ) { ( (HtmlSelectOneRadio) component ).setLayout( "pageDirection" );
private static UIInput createInputForBooleanProperty() { // <h:selectOneRadio id="#{identifier}" value="#{beanValue}" layout="pageDirection" styleClass="radiolabels"> // <f:selectItems value="#{itemValues}"></f:selectItems> // </h:selectOneRadio> HtmlSelectOneRadio selectOneRadio = FacesComponentUtility.createComponent(HtmlSelectOneRadio.class, null); selectOneRadio.setLayout("lineDirection"); // TODO: We may want to use CSS to get less space between the radio buttons // (see http://jira.jboss.com/jira/browse/JBMANCON-21). UISelectItem selectItem = FacesComponentUtility.createComponent(UISelectItem.class, null); selectItem.setItemLabel("Yes"); selectItem.setItemValue("true"); selectOneRadio.getChildren().add(selectItem); selectItem = FacesComponentUtility.createComponent(UISelectItem.class, null); selectItem.setItemLabel("No"); selectItem.setItemValue("false"); selectOneRadio.getChildren().add(selectItem); return selectOneRadio; }
private static UIInput createInputForEnumProperty(PropertyDefinitionSimple propertyDefinitionSimple) { UISelectOne selectOne; if (propertyDefinitionSimple.getEnumeratedValues().size() >= LISTBOX_THRESHOLD_ENUM_SIZE) { // Use a drop down menu for larger enums... HtmlSelectOneMenu menu = FacesComponentUtility.createComponent(HtmlSelectOneMenu.class, null); // TODO: Use CSS to set the width of the menu. selectOne = menu; } else { // ...and a radio for smaller ones. HtmlSelectOneRadio radio = FacesComponentUtility.createComponent(HtmlSelectOneRadio.class, null); radio.setLayout("pageDirection"); // TODO: We may want to use CSS to get less space between the radio buttons // (see http://jira.jboss.com/jira/browse/JBMANCON-21). selectOne = radio; } List<PropertyDefinitionEnumeration> options = propertyDefinitionSimple.getEnumeratedValues(); for (PropertyDefinitionEnumeration option : options) { UISelectItem selectItem = FacesComponentUtility.createComponent(UISelectItem.class, null); selectItem.setItemLabel(option.getName()); selectItem.setItemValue(option.getValue()); selectOne.getChildren().add(selectItem); } return selectOne; }