2 Replies Latest reply on Apr 2, 2008 5:40 PM by Ben Moore

    Using Map for a @DataModel

    Ben Moore Newbie

      Hi,


      Chapter 29.10.1 says @DataModel can be used on a Map and that each row of the DataModel is a Map.Entry. The wiki sample does this, then uses the Map in an h:dataTable.


      However, I'm not able to get this to work, and it looks like others aren't, either.


      What's going on? Here's my code:


      @Scope(ScopeType.APPLICATION)
      @Name("propertyManager")
      @Startup
      public class PropertyManagerAction implements Serializable {
        ...
        @DataModel
        private Map<String, String> properties;
        ...
      



      <h:dataTable value="#{propertyManager.properties}" var="propertyMap">     
        <h:column>
          <f:facet name="header">key</f:facet>
          <h:outputText value="#{propertyMap.key}"/>
        </h:column>
        <h:column>
          <f:facet name="header">value</f:facet>
          <h:inputText value="#{propertyMap.value}"/>
        </h:column>
      </h:dataTable>



      Please, please help...