-
1. Re: Does param.someValue in rendered option effects in passing value to bean?
sachin.parnami Oct 10, 2009 1:43 PM (in response to sachin.parnami)Any clue about this?
-
2. Re: Does param.someValue in rendered option effects in passing value to bean?
xsalefter.xsalefter.yahoo.com Oct 10, 2009 8:14 PM (in response to sachin.parnami)Sorry, but I bit confused with your question. Can you place all your problem here?
-
3. Re: Does param.someValue in rendered option effects in passing value to bean?
sachin.parnami Oct 11, 2009 6:03 AM (in response to sachin.parnami)Thanks for the reply,
Here is the scenario in detailFirstFile.xhtml
<h:form name="something"> <s:link view="/userAddition.xhtml" value="Add Admin"> <f:param name="addingAdmin" value="true" /> </s:link><br/> <s:link view="/userAddition.xhtml" value="Add User"> </s:link><br/> <s:link view="/userAddition.xhtml" value="Guest"> </s:link><br/> </h:form>
Now my userAddition.xhtml
<h:form name="addingUser"> <h:outputLabel for="username">Username</h:outputLabel> <h:inputText id="username" value="#{user.userName}"/> <h:outputLabel for="password">Password</h:outputLabel> <h:inputSecret id="password" value="#{user.password}"/> <h:outputLabel for="contactDetail" rendered="#{param.addingAdmin}">Contact Detail</h:outputLabel> <h:inputText id="contactDetail" value="#{user.contactDetail}" rendered="#{param.addingAdmin}"/> </h:form>
Now if user clicks on Add Admin link userAddition.xhtml page appears and rendering option for contact detail also works just fine.
when i enter all the details and in my action class i get value of getContactDetail() null
and if i removerendered="#{param.addingAdmin}"
and try again i get my entered value perfectly fine for contact detail.
Hope it explains well my problem.
-
4. Re: Does param.someValue in rendered option effects in passing value to bean?
xsalefter.xsalefter.yahoo.com Oct 11, 2009 7:43 PM (in response to sachin.parnami)Uhm.. Sorry, can you post all your code (entities/model, controllers, and views)?
-
5. Re: Does param.someValue in rendered option effects in passing value to bean?
cash1981 Oct 11, 2009 10:31 PM (in response to sachin.parnami)So basically what you are saying is that the param.addingAdmin is not propagated to your bean if you have rendered="#{param.addingAdmin}, but removing rendered="#{param.addingAdmin} will work? That is quite strange. -
6. Re: Does param.someValue in rendered option effects in passing value to bean?
cash1981 Oct 11, 2009 10:34 PM (in response to sachin.parnami)Try this:
<h:form name="addingUser"> <h:outputLabel for="username">Username</h:outputLabel> <h:inputText id="username" value="#{user.userName}"/> <h:outputLabel for="password">Password</h:outputLabel> <h:inputSecret id="password" value="#{user.password}"/> <s:fragment rendered="#{not empty param.addingAdmin}"> <h:outputLabel for="contactDetail">Contact Detail</h:outputLabel> <h:inputText id="contactDetail" value="#{user.contactDetail}" /> </s:fragment> <h:commandButton value="save" action="#{user.save}"/> </h:form>
-
7. Re: Does param.someValue in rendered option effects in passing value to bean?
sachin.parnami Oct 12, 2009 3:00 PM (in response to sachin.parnami)Thanks for replying guys
@Shervin
it didn't help out. i still get null values.
i have tried with
<s:fragment rendered="#{not empty param.addingAdmin}"> And with <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value" rendered="#{not empty param.addingAdmin}">
as well but no luck :(
-
8. Re: Does param.someValue in rendered option effects in passing value to bean?
cash1981 Oct 12, 2009 8:17 PM (in response to sachin.parnami)Hmm strange. Please post all relevant code. This shouldn't be too difficult to fix.
-
9. Re: Does param.someValue in rendered option effects in passing value to bean?
sachin.parnami Oct 14, 2009 6:15 AM (in response to sachin.parnami)Are you looking for any specific code?
BTW here is the file which i feel is relevant to my problem
FirstFile.xhtml and userAddition.xhtml
is same as posted above and of course taking changes suggested by you neither worked so consider them to be added as well.
here is the Interface
UserInterface.java public interface UserInterface{ public void setUserName(String userName); public String getUserName(); public void setPassword(String password); public String getPassword(); public void setContactDetail(long contactDetail); public long getContactDetail(); //Method public void save(); } and my action class UserAction.java @Stateless @Name("user") public class UserAction implements UserInterface { String userName; String password; long contactDetail; public void save(){ log.info("UserName"+ this.getUserName()); log.info("Password"+ this.getPassword()); log.info("ContactDetail"+ this.getContactDetail()); } public void setUserName(String userName){ this.userName= userName; } public String getUserName(){ return userName; } public void setPassword(String password){ this.password= password; } public String getPassword(){ return password; } public void setContactDetail(long contactDetail){ this.contactDetail= contactDetail; } public long getContactDetail(){ return contactDetail; }
-
10. Re: Does param.someValue in rendered option effects in passing value to bean?
sachin.parnami Oct 18, 2009 8:16 AM (in response to sachin.parnami)Any idea about this?