I am a Greenhorn to
JSF and have been battling my way through learning how to use it and produce a Production product at the same time. I have been using JavaServerFaces IN Action by Kito D. Mann. Apparently I cannot right off find anything with more explanation than is found on page 148 (4.2 Common Component properties). Also, Google and Bing searchs bring up some information, but does not seem to addres my particular concern.
I am working with a series of comments of which I can have up to ten levels. The first level (0 based) is always displayed, but the other nine levels (1-9) I want to not be rendered as visible until that level is reached. The following is a snippet of code reflecting what I am attempting. The example has backing bean: level. The 'comment1' and 'name1' fields both have getters and setters in the 'level' backing bean.
<h:panelGrid columns="2" border="0" cellpadding="2" cellspacing="0" rendered="#{level.level >= 1}" >
<h:inputText id="comment1" value="#{level.coment1}" title="COMMENT ONE" readonly="#{level.level > 1}" />
<h:inputText id="name1" value="#{level.name1}" title="NAME ONE" readonly="#{level.level > 1}" />
</h:panelGrid>
This works great for not displaying this particular panelGrid when the level is 0. And the readonly works great for levels above 1 in this example. But when the level is 1 and the screen is submitted whatever has been entered on the screen in the 'comment1' and 'name1' fields is returned as 'null' instead of what has been entered for the comment and name.
What am I missing? What have I not learned yet? Can someone point me to an explanation on how to use this?
Thank you.
rdb