This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
getAttributes() retrieves the key/value pairs of the nested f:attribute tags. What you need is just the setReadonly(boolean) method of the specific UIInput components. For example:
I tried it in all possible places (Before/After Phase Listeners), it is invoking setReadOnly also (As I see through debugger), But it never renders in readOnly mode. If I check the tree before rendering it still shows as readOnly="false" for all components..
Where do you think is the right place to implement this logic?
Thanks, Mike
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
1) Put this logic in the getters of component binding. Or, if you don't want to use component bindings, 2) Use a phaselistener which loops through the UIViewRoot and sets the UIInput componentent to readonly. Do it at the RENDER_RESPONSE phase.
Mike Dingham
Greenhorn
Joined: Oct 06, 2006
Posts: 8
posted
0
This is the code I have which does not do anything
int noOfChildComps = component.getChildCount(); List childComps = component.getChildren();
for (int i=0; (i<noOfChildComps) ; i++) { makeReadOnly((UIComponentBase) childComps.get(i)); }
}
I tried with beforePhase also, but it does not work...
Any Ideas...
Thanks, Mike
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
And after hitting F5 in the browser?
When doing a fresh start, the UIViewRoot is empty and therefore the components are created in the RENDER_RESPONSE for the first time. But I still don't understand why even the afterPhase() action doesn't work during the first call. Just after the 2nd time rendering and so on, this will work.