Package org.richfaces.component

Examples of org.richfaces.component.AbstractSelectComponent


        css = (css != null) ? concatClasses("rf-sel-lst-cord", css) : "rf-sel-lst-cord";
        return css;
    }

    public String getSelectLabel(FacesContext facesContext, UIComponent component) {
        AbstractSelectComponent select = (AbstractSelectComponent) component;
        String label = getSelectInputLabel(facesContext, select);
        if (label == null || "".equals(label.trim())) {
            label = select.getDefaultLabel();
        }
        return label;
    }
View Full Code Here


    public static final String ID = "org.richfaces.validator.SelectLabelValueValidator";

    private static final long serialVersionUID = 2343817853927262660L;

    public void validate(FacesContext facesContext, UIComponent component, Object valueAsObject) throws ValidatorException {
        final AbstractSelectComponent select = (AbstractSelectComponent) component;

        final String clientId = component.getClientId(facesContext);
        final Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();

        final String label = (String) requestParameterMap.get(clientId + "Input");
View Full Code Here

        css = (css != null) ? concatClasses("rf-sel-lst-cord", css) : "rf-sel-lst-cord";
        return css;
    }

    public String getSelectLabel(FacesContext facesContext, UIComponent component) {
        AbstractSelectComponent select = (AbstractSelectComponent) component;
        String label = getSelectInputLabel(facesContext, select);
        if (label == null || "".equals(label.trim())) {
            label = select.getDefaultLabel();
        }
        return label;
    }
View Full Code Here

        return clientSelectItem;
    }

    public static void encodeItems(FacesContext facesContext, UIComponent component, List<ClientSelectItem> clientSelectItems,
        String itemHtmlElement, String defaultItemCss) throws IOException {
        AbstractSelectComponent select = (AbstractSelectComponent) component;
        if (clientSelectItems != null && !clientSelectItems.isEmpty()) {
            ResponseWriter writer = facesContext.getResponseWriter();
            String clientId = component.getClientId(facesContext);
            int i = 0;
            for (ClientSelectItem clientSelectItem : clientSelectItems) {
                String itemClientId = clientId + "Item" + (i++);
                clientSelectItem.setClientId(itemClientId);

                writer.startElement(itemHtmlElement, select);
                writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, itemClientId, null);

                writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
                    HtmlUtil.concatClasses(defaultItemCss, select.getItemClass()), null);

                String label = clientSelectItem.getLabel();
                if (label != null && label.trim().length() > 0) {
                    writer.writeText(label, null);
                } else {
View Full Code Here

            }
        }
    }

    public static String getSelectInputLabel(FacesContext facesContext, UIComponent component) {
        AbstractSelectComponent select = (AbstractSelectComponent) component;
        Object value = select.getSubmittedValue();
        String label = null;
        if (value == null) {
            value = select.getValue();
            if (value != null) {
                Iterator<SelectItem> items = SelectUtils.getSelectItems(facesContext, component);

                while (items.hasNext()) {
                    SelectItem item = items.next();
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractSelectComponent

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.