I have a doubt. I have a textbox and checkbox in my jsp page. I want to write a action listener to my check box. If I uncheck my checkbox of type selectBooleanCheckbox, then I want to disble the textbox so that the usercan't input into the textbox and if the user checks on the checkbox, then I want to able the textbox with some initial values. Is it possible to do like this for selectBooleanCheckbox type? please let me know.
Regards
Post by:Bauke Scholtz
,
Ranch Hand
No need for an actionlistener. Just submit the form onclick and use the checkbox value in the disabled attribute.
You can also add a valuebinding to it, e.g. value="#{myBean.status}" which maps to a boolean property. But don't use it in the disabled attribute, it won't work due to the timing in the JSF lifecycle when the property value is get/set. [ August 28, 2008: Message edited by: Bauke Scholtz ]
Post by:Gopu Akraju
,
Ranch Hand
Hi Thanks for your response.
When I try to change the checkbox status and then submit the form, basically calling another page through a java method, I am not able to navigate to the next page.
Where as I am able to navigate without changing the checkbox status? Why is it so? How to rectify?
Page1 gets the user input and page2 just displays the user. I am able to display the user input into second page if I don't alter the checkbox status. But if I change the checkbox status, if I press submit button on the first page, it is not navigating to the second page. Can anyone tell me why? This is just a simple example I have started playing around with jsf. But I think when the page gets refreshed when I change the checkbox, something happens which prevents from navigating. As a beginner, I am not able to overcome this problem. Please let me know.
page1.jsp
page2.jsp
UserBean.java
And more over I am trying to clear the text box to null if checkbox is Where should I mention?
Post by:autobot
I love a woman who dresses in stainless steel ... and carries tiny ads:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database