webtier@glassfish.java.net

Re: [webtier] JSF 2.0 combo dependencies.

From: Imre Osswald <ioss_at_mx.jevelopers.com>
Date: Mon, 1 Feb 2010 20:58:12 +0100

Hi,

the idea was to have always rendered="true" (or omitting rendered) on the panelGroup (and rendered="#{! empty ...}" on the selection only.
This allows ajax to find the id (of the panelGroup) and to insert the html-code for the select into it.
It is important for the id of the part of the page that you want to have rerendered to actually be existent in the html when submitting the partial request, as without it ajax would have no way (at least not an easy/clean way) to know where to put the changed content.

Your solution is ok, as long as it is ok for you to have the selectOneListbox still submitted, validated, etc (as display:none will not prevent it to be part of the form-data)

Imre

Am 01.02.2010 um 19:14 schrieb webtier_at_javadesktop.org:

> Thank for your help.
> If wrap combo inside panelGorup:
> <h:panelGroup layout="block" rendered="#{ ! empty testManager.selectedItem}" id="suitems">
> ....
> </h:panelGroup>
> Using this snip code, result is same first example because div is not rendered too.
>
> My solution has been use "disabled" attribute instead of "rendered" and css:
> <style>
> .nodisplay_disabled[disabled] { display: none; }
> </style>
> ......
> <h:selectOneListbox value="#{testManager.selectedSubItem}" disabled="#{ empty testManager.selectedItem}" styleClass="nodisplay_disabled" id="suitems">
> ......
> [Message sent by forum member 'angelcervera' (angelcervera_at_silyan.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=384099
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>