Package org.apache.myfaces.wap.component

Examples of org.apache.myfaces.wap.component.SelectBoolean


        if (context == null || component == null) {
            throw new NullPointerException();
        }
        if (!component.isRendered()) return;

        SelectBoolean comp = (SelectBoolean)component;
       
        ResponseWriter writer = context.getResponseWriter();
       
        writer.startElement(Attributes.SELECT, component);
        RendererUtils.writeAttribute(Attributes.ID, comp.getClientId(context), writer);
        RendererUtils.writeAttribute(Attributes.STYLE_CLASS, comp.getStyleClass(), writer);
        RendererUtils.writeAttribute(Attributes.XML_LANG, comp.getXmllang(), writer);
       
        /* attribute name is not required. If is not set, name value equals component id */
        if (comp.getName() == null) {
            log.debug("getName is null");
            comp.setName(comp.getClientId(context));
        }
        RendererUtils.writeAttribute(Attributes.NAME, comp.getName(), writer);
       
        RendererUtils.writeAttribute(Attributes.TABINDEX, comp.getTabindex(), writer);
        RendererUtils.writeAttribute(Attributes.TITLE, comp.getTitle(), writer);
               
        if (comp.isSelected())
            RendererUtils.writeAttribute(Attributes.VALUE, OPTION_VALUE, writer);
        else { /* don't check off */ }
       
        // multiple
        RendererUtils.writeAttribute(Attributes.MULTIPLE, "true", writer);       
View Full Code Here


        log.debug("decode(" + component.getId() + ")");
        if (component == null || context == null) throw new NullPointerException();
        if (!(component instanceof SelectBoolean))
            log.error("Component " + component.getClass().getName() + " is no SelectMany component, cannot be converted!");
       
        SelectBoolean comp = (SelectBoolean)component;
       
        Map map = context.getExternalContext().getRequestParameterMap();
       
        // Set the submitted value of this UISelectOne component
        if (map.containsKey(comp.getName())){
            log.debug("Parameter:" + comp.getName() + " was found in the request. Value: " + (String)map.get(comp.getName()));
           
            String value = (String)map.get(comp.getName());                    
            if (OPTION_VALUE.equalsIgnoreCase(value)) comp.setSelected(true);
            else comp.setSelected(false);               
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.wap.component.SelectBoolean

Copyright © 2018 www.massapicom. 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.