Examples of HtmlSelectOneMenu


Examples of javax.faces.component.html.HtmlSelectOneMenu

    public void setUp() throws Exception
    {
        super.setUp();

        selectOneMenu = new HtmlSelectOneMenu();
        selectManyMenu = new HtmlSelectManyMenu();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu


    @Override
    protected UIComponent createComponentToTest()
    {
        UIComponent component = new HtmlSelectOneMenu();
        UISelectItem item = new UISelectItem();
        item.setItemValue("value1");
        component.getChildren().add(item);
        return component;
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

*/
public class HtmlFormBuilderSelect extends HtmlFormBuilderItem {

    @Override
    public void renderView() {
        HtmlSelectOneMenu select = new HtmlSelectOneMenu();
        String[] valueArray = properties.getValues().split(";");
        for (int i = 0; i < valueArray.length; ++i) {
            UISelectItem item = new UISelectItem();
            item.setItemValue(valueArray[i]);
            item.setItemLabel(valueArray[i]);
            select.getChildren().add(item);
        }
        if (isDisabled()) {
            select.setDisabled(true);
        }
        if (value != null) {
            select.setValue(value);
        }
        if (getDataUuid() != null) {
            select.setId(getDataUuid());
        }

        HtmlCustomOutputLabel output = new HtmlCustomOutputLabel(properties);

        addLabeledComponent(output, select);
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

                    grid.getChildren().add(label);

                    //Value
                    UIComponentBase comp = null;
                    if (item.getValueTranslations().containsKey(property)) {
                        comp = new HtmlSelectOneMenu();
                        for (Object value : item.getValueTranslations().get(property).keySet()) {
                            String translation = (String) item.getValueTranslations().get(property).get(value);
                            UISelectItem selectItem = new UISelectItem();
                            selectItem.setItemLabel(translation);
                            selectItem.setItemValue(value);
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

            panel.setColumns(2);
            if (workflowStates != null) {
                HtmlOutputText outputWorkflowState = new HtmlOutputText();
                outputWorkflowState.setValue(Messages.getStringJSF("constraint.info.workflowState"));
                panel.getChildren().add(outputWorkflowState);
                HtmlSelectOneMenu select = new HtmlSelectOneMenu();
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.workflowstate.all"));
                select.getChildren().add(item);
                select.setId("workflowState" + getItemUuid());
                for (WorkflowState workflowState : workflowStates) {
                    item = new UISelectItem();
                    item.setItemValue(workflowState.getUuid());
                    item.setItemLabel(workflowState.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText outputConstraintType = new HtmlOutputText();
            outputConstraintType.setValue(Messages.getStringJSF("constraint.info.constraintType"));
            panel.getChildren().add(outputConstraintType);
            HtmlSelectOneMenu select = new HtmlSelectOneMenu();
            select.setId("constraintType" + getItemUuid());
            for (ConstraintType constraintType : ConstraintType.values()) {
                if (constraintType != ConstraintType.DEFAULT) {
                    UISelectItem item = new UISelectItem();
                    item.setItemValue(constraintType);
                    item.setItemLabel(Messages.getStringJSF("ConstraintType." + constraintType.name()));
                    select.getChildren().add(item);
                }
            }
            panel.getChildren().add(select);
            if (constraintClients != null) {
                HtmlOutputText outputConstraintClient = new HtmlOutputText();
                outputConstraintClient.setValue(Messages.getStringJSF("constraint.info.constraintClient"));
                panel.getChildren().add(outputConstraintClient);
                select = new HtmlSelectOneMenu();
                select.setId("constraintClient" + getItemUuid());
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.constraintclient.all"));
                select.getChildren().add(item);
                for (ConstraintClient constraintClient : constraintClients) {
                    item = new UISelectItem();
                    item.setItemValue(constraintClient.getUuid());
                    item.setItemLabel(constraintClient.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText empty = new HtmlOutputText();
            panel.getChildren().add(empty);
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String rawValue) {
        Corporation result = null;
        if (uiComponent instanceof HtmlSelectOneMenu) {
            HtmlSelectOneMenu menu = (HtmlSelectOneMenu) uiComponent;
            UISelectItems items = (UISelectItems) menu.getChildren().get(0);
            List obj = (List) items.getValue();
            for (Iterator it = obj.iterator(); it.hasNext();) {
                Corporation corpo = (Corporation) it.next();
                if (corpo.getId().equals(Long.valueOf(rawValue))) {
                    result = corpo;
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

    }

    private UIInput createSelectOneMenu(TextResolver textResolver)
    {
        SelectInputControl control = (SelectInputControl)InputControlManager.getControl(SelectInputControl.NAME);
        HtmlSelectOneMenu input = control.createMenuComponent(this);
        // css style
        String userStyle = StringUtils.toString(getAttributes().get("styleClass"));
        String cssStyle  = TagEncodingHelper.getTagStyleClass("eSelect", null, null, userStyle);
        input.setStyleClass(cssStyle);
        // other attributes
        copyAttributes(input);
        // Options
        Options options = getOptionList();
        if (isAllowNull())
        { // Empty entry
            options = new Options(options);
            addSelectItem(input, textResolver, new OptionEntry("", getNullText()));
        }
        for (OptionEntry e : options)
        { // Option entries
            addSelectItem(input, textResolver, e);
        }
        // input.setReadonly(isReadOnly());
        if (isDisabled())
            input.setDisabled(true);
        // input.setLabel(getLabelString());
        // input.setRequired(col.isRequired() && !col.isAutoGenerated());
        // input.setId(this.getId() + INPUT_SUFFIX);
        input.setValue(getValue());
        return input;
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

    }
   
    @Override
    protected void createInputComponents(UIComponent parent, InputInfo ii, FacesContext context, List<UIComponent> compList)
    {
        HtmlSelectOneMenu input;
    try {
      input = inputComponentClass.newInstance();
    } catch (InstantiationException e1) {
      throw new InternalException(e1);
    } catch (IllegalAccessException e2) {
      throw new InternalException(e2);
    }
        copyAttributes(parent, ii, input);

        Options options = ii.getOptions();
        if (ii.isRequired()==false)
        {   // Empty entry
            options = new Options(options);
            addSelectItem(input, ii, new OptionEntry("", getNullText(ii)));
        }
        if (options!=null && options.size()>0)
        {   // Add options
            for (OptionEntry e : options)
            { // Option entries
                addSelectItem(input, ii, e);
            }
        }
       
        input.setDisabled(ii.isDisabled());
        setInputValue(input, ii);
       
        compList.add(input);
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlSelectOneMenu

      HtmlSelectBooleanCheckbox inputSelectBooleanCheckbox = new HtmlSelectBooleanCheckbox();
      inputSelectBooleanCheckbox.setReadonly(isReadOnly() || col.isAutoGenerated());
      inputSelectBooleanCheckbox.setLabel(getLabelString());
      input = inputSelectBooleanCheckbox;
    } else if (controlType.equals("select")) {
      HtmlSelectOneMenu inputSelectOneMenu = new HtmlSelectOneMenu();
      inputSelectOneMenu.setReadonly(isReadOnly() || col.isAutoGenerated());
      addSelectItems(inputSelectOneMenu);
      inputSelectOneMenu.setLabel(getLabelString());
      input = inputSelectOneMenu;

    } else if (controlType.equals("checkbox")) {
      HtmlSelectBooleanCheckbox inputSelectBooleanCheckbox = new HtmlSelectBooleanCheckbox();
      inputSelectBooleanCheckbox.setReadonly(isReadOnly() || col.isAutoGenerated());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.