Changeset 28569

Show
Ignore:
Timestamp:
01/08/08 12:39:17 (1 year ago)
Author:
atchertchian
Message:

NXP-1776: Provide selectItems for directory entries - fwd from r27438

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/component/UISelectItems.java

    r27112 r28569  
    2222import java.util.Map.Entry; 
    2323 
     24import javax.el.ELException; 
     25import javax.el.ValueExpression; 
     26import javax.faces.FacesException; 
    2427import javax.faces.context.FacesContext; 
    25 import javax.faces.el.ValueBinding; 
    2628import javax.faces.model.ListDataModel; 
    2729import javax.faces.model.SelectItem; 
     
    3840public class UISelectItems extends javax.faces.component.UISelectItems { 
    3941 
    40     public static final String COMPONENT_TYPE_EX = "net.sf.jsfcomp.easysi.UISelectItems"; 
    41  
    42     public static final String COMPONENT_FAMILY_EX = "net.sf.jsfcomp.easysi.UISelectItems"; 
     42    public static final String COMPONENT_TYPE = UISelectItems.class.getName(); 
    4343 
    4444    protected String var; 
     
    4848    protected Object itemValue; 
    4949 
    50     @Override 
    51     public String getFamily() { 
    52         return COMPONENT_FAMILY_EX; 
    53     } 
    54  
    5550    public String getVar() { 
    5651        if (var != null) { 
    5752            return var; 
    5853        } 
    59  
    60         ValueBinding vb = getValueBinding("var"); 
    61         return vb != null ? (String) vb.getValue(getFacesContext()) : null; 
     54        ValueExpression ve = getValueExpression("var"); 
     55        if (ve != null) { 
     56            try { 
     57                return (String) ve.getValue(getFacesContext().getELContext()); 
     58            } catch (ELException e) { 
     59                throw new FacesException(e); 
     60            } 
     61        } else { 
     62            return null; 
     63        } 
    6264    } 
    6365 
     
    7072            return itemLabel; 
    7173        } 
    72  
    73         ValueBinding vb = getValueBinding("itemLabel"); 
    74         return vb != null ? vb.getValue(getFacesContext()) : null; 
     74        ValueExpression ve = getValueExpression("itemLabel"); 
     75        if (ve != null) { 
     76            try { 
     77                return ve.getValue(getFacesContext().getELContext()); 
     78            } catch (ELException e) { 
     79                throw new FacesException(e); 
     80            } 
     81        } else { 
     82            return null; 
     83        } 
    7584    } 
    7685 
     
    8392            return itemValue; 
    8493        } 
    85  
    86         ValueBinding vb = getValueBinding("itemValue"); 
    87         return vb != null ? vb.getValue(getFacesContext()) : null; 
     94        ValueExpression ve = getValueExpression("itemValue"); 
     95        if (ve != null) { 
     96            try { 
     97                return ve.getValue(getFacesContext().getELContext()); 
     98            } catch (ELException e) { 
     99                throw new FacesException(e); 
     100            } 
     101        } else { 
     102            return null; 
     103        } 
    88104    } 
    89105 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/UIDirectorySelectItems.java

    r28492 r28569  
    4242 
    4343/** 
    44  * Component that deals with a list of select items 
     44 * Component that deals with a list of select items from a directory. 
    4545 * 
    4646 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a> 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/resources/OSGI-INF/deployment-fragment.xml

    r27112 r28569  
    621621    <component> 
    622622      <component-type> 
     623        org.nuxeo.ecm.platform.ui.web.component.UISelectItem 
     624      </component-type> 
     625      <component-class> 
     626        org.nuxeo.ecm.platform.ui.web.component.UISelectItem 
     627      </component-class> 
     628    </component> 
     629 
     630    <component> 
     631      <component-type> 
    623632        org.nuxeo.ecm.platform.ui.web.component.editor.UIHtmlEditor 
    624633      </component-type> 
     
    663672      <component-class> 
    664673        org.nuxeo.ecm.platform.ui.web.directory.UIDirectorySelectItems 
     674      </component-class> 
     675    </component> 
     676 
     677    <component> 
     678      <component-type> 
     679        org.nuxeo.ecm.platform.ui.web.directory.UIDirectorySelectItem 
     680      </component-type> 
     681      <component-class> 
     682        org.nuxeo.ecm.platform.ui.web.directory.UIDirectorySelectItem 
    665683      </component-class> 
    666684    </component> 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/resources/WEB/nxdirectory.taglib.xml

    r27726 r28569  
    88      <component-type> 
    99        org.nuxeo.ecm.platform.ui.web.directory.UIDirectorySelectItems 
     10      </component-type> 
     11    </component> 
     12  </tag> 
     13  <tag> 
     14    <tag-name>selectItem</tag-name> 
     15    <component> 
     16      <component-type> 
     17        org.nuxeo.ecm.platform.ui.web.directory.UIDirectorySelectItem 
    1018      </component-type> 
    1119    </component> 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/resources/WEB/nxweb-util.taglib.xml

    r28558 r28569  
    145145  </tag> 
    146146  <tag> 
     147    <tag-name>selectItem</tag-name> 
     148    <component> 
     149      <!-- see http://jsf-comp.sourceforge.net/components/easysi/index.html, need to include license --> 
     150      <component-type> 
     151        org.nuxeo.ecm.platform.ui.web.component.UISelectItem 
     152      </component-type> 
     153    </component> 
     154  </tag> 
     155  <tag> 
    147156    <tag-name>inputFile</tag-name> 
    148157    <component>