dictionary - Accessing values in Map through EL in JSF2 -


versions :

aapche myfaces 2.1.14

richfaces 4.3.5

issue :

i have class implementing map interface below :

public class formstore implements map {       private map values;        public object get(object key) {          return values.get(key);     }      public object put(object key, object value) {          return values.put(key, value);     }  } 

i using map store submitted form values in application , accessing in facelet shown in below facelet code :

 <h:inputtext id="phone" value="#{formstore['phone']}" size="12" maxlength="20" required="true"> 

where formstore java class above.

now have added map in above java class below serves special purpose.

public class formstore implements map {   private map values;  private map additionalvalues;   public object get(object key) {      return values.get(key); }  public object put(object key, object value) {      return values.put(key, value); } //getter , setter method additionalvalues added  

}

the issue not able access new map el . have tried following options :

1)<h:inputtext id="phone" value="#{formstore.additionalvalues['phone']}" size="12" maxlength="20" required="true"> 2)<h:inputtext id="phone" value="#{formstore.[additionalvalues]['phone']}" size="12" maxlength="20" required="true"> 3)<h:inputtext id="phone" value="#{formstore[additionalvalues]['phone']}" size="12" maxlength="20" required="true"> 

for every option , calls formstore.get method key = additionalvalues

is not possible access additionalvalues map formstore.java class ?

please help.

this should work

<h:inputtext id="phone" value="#{formstore.getadditionalvalues()['phone']}" size="12" maxlength="20" required="true"> 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -