Package org.richfaces.component

Examples of org.richfaces.component.AbstractPanelMenu


        @ResourceDependency(library = "org.richfaces", name = "icons.ecss"),
        @ResourceDependency(library = "org.richfaces", name = "panelMenu.ecss") })
public class PanelMenuRenderer extends DivPanelRenderer {
    @Override
    protected void doDecode(FacesContext context, UIComponent component) {
        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();

        // Don't overwrite the value unless you have to!
        String newValue = requestMap.get(getValueRequestParamName(context, component));
        if (newValue != null) {
            panelMenu.setSubmittedActiveItem(newValue);
        }
    }
View Full Code Here


    @Override
    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        super.doEncodeBegin(writer, context, component);

        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        writer.startElement(HtmlConstants.INPUT_ELEM, component);
        writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getValueRequestParamName(context, component), null);
        writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, getValueRequestParamName(context, component), null);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN, null);
        writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, panelMenu.getActiveItem(), null);
        writer.endElement(HtmlConstants.INPUT_ELEM);

        writeJavaScript(writer, context, component);
    }
View Full Code Here

            getScriptObjectOptions(context, component));
    }

    @Override
    protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        Map<String, Object> options = new HashMap<String, Object>();
        // TODO nick - only options with non-default values should be rendered
        options.put("ajax", getAjaxOptions(context, panelMenu));
        options.put("disabled", panelMenu.isDisabled());
        options.put("expandSingle", panelMenu.isExpandSingle());
        options.put("bubbleSelection", panelMenu.isBubbleSelection());
        return options;
    }
View Full Code Here

        String compClientId = component.getClientId(context);
        if (requestMap.get(compClientId) != null) {
            if (menuItem.isDisabled() || menuItem.isParentDisabled()) {
                return;
            }
            AbstractPanelMenu parentPanelMenu = getParentPanelMenu(menuItem);

            if (parentPanelMenu.isImmediate()) {
                menuItem.setImmediate(true);
            }
            new ActionEvent(menuItem).queue();

            context.getPartialViewContext().getRenderIds().add(component.getClientId(context));
View Full Code Here

    private static AbstractPanelMenu getParentPanelMenu(AbstractPanelMenuItem menuItem) {
        return (AbstractPanelMenu) ComponentIterators.getParent(menuItem, PARENT_PANEL_MENU_PREDICATE);
    }

    static boolean isParentPanelMenuDisabled(AbstractPanelMenuItem menuItem) {
        AbstractPanelMenu parentPanelMenu = (AbstractPanelMenu) ComponentIterators.getParent(menuItem,
            PARENT_PANEL_MENU_PREDICATE);
        if (parentPanelMenu != null) {
            return parentPanelMenu.isDisabled();
        }
        return false;
    }
View Full Code Here

        @ResourceDependency(library = "org.richfaces", name = "icons.ecss"),
        @ResourceDependency(library = "org.richfaces", name = "panelMenu.ecss") })
public class PanelMenuRenderer extends DivPanelRenderer {
    @Override
    protected void doDecode(FacesContext context, UIComponent component) {
        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();

        // Don't overwrite the value unless you have to!
        String newValue = requestMap.get(getValueRequestParamName(context, component));
        if (newValue != null) {
            panelMenu.setSubmittedActiveItem(newValue);
        }
    }
View Full Code Here

    @Override
    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        super.doEncodeBegin(writer, context, component);

        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        writer.startElement(HtmlConstants.INPUT_ELEM, component);
        writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getValueRequestParamName(context, component), null);
        writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, getValueRequestParamName(context, component), null);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN, null);
        writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, panelMenu.getActiveItem(), null);
        writer.endElement(HtmlConstants.INPUT_ELEM);

        writeJavaScript(writer, context, component);
    }
View Full Code Here

            getScriptObjectOptions(context, component));
    }

    @Override
    protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
        AbstractPanelMenu panelMenu = (AbstractPanelMenu) component;

        Map<String, Object> options = new HashMap<String, Object>();
        // TODO nick - only options with non-default values should be rendered
        options.put("ajax", getAjaxOptions(context, panelMenu));
        options.put("disabled", panelMenu.isDisabled());
        options.put("expandSingle", panelMenu.isExpandSingle());
        options.put("bubbleSelection", panelMenu.isBubbleSelection());
        return options;
    }
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractPanelMenu

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.