You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "R. Müller" <r....@unicomp-berlin.de> on 2006/01/27 10:35:16 UTC

Re: Problems with nested SelectOneRadio, SelectManyCheckBox, ... and panelGrid ... (SOLVED)

Hi group,

i solved my issue respectively i figured out why :

1. has nothing to do with panelGrid or selection-components :-)
2. there was a validator, which marks some input as invalid, this seems
to avoid remaining action (pushing back the values of the 
selection-components to the backing-bean) [of course, it is not the 
'final' submit ...]

regards

Ronald


R. Müller wrote:
> Hi Group,
> 
> in one of pages, i'm using several nested Select...-tags and panelGrids.
> So far it worked well, but it seems that some selector-components don't 
> return their value to the backing-bean, if the form is submitted.
> In the following example the value of selector 'selector1' isn't returned.
> As a workaround i've implemented an appropriate ValueChangeListener, 
> this worked for me.
> 
> Any hints, ideas ?
> 
> regards
> 
> Ronald
> 
> 
> 
> <t:selectOneRadio id="selector1" 
> valueChangeListener="#{foo.selector1Changed}" 
> value="#{foo.selector1Value}" layout="spread" 
> onclick="this.form.submit()" >
> 
> <f:selectItem itemValue="foo0" itemLabel="#{bundle['foo.fooLabel0']}"/>
> 
> [... more select items ...]
> 
> </t:selectOneRadio>
> 
> <h:panelGrid>
> 
> [... some stuff ...]
> 
> <t:selectManyCheckbox onchange="this.form.submit()"
> id="selector2" layout="spread" value="#{foo.selector2Value}">
> <f:selectItems value="#{foo.selector2SelectItems}" />
> </t:selectManyCheckbox>
> <h:panelGrid>
> <f:facet name="header">
>     <t:radio for="selector1" index="0"/>
> </f:facet>
> <h:panelGrid>
>     <t:checkbox for="selector2" index="0" />
>     [... repeats to the last ...]
> </h:panelGrid>
> </h:panelGrid>
> 
> [... some stuff ... ]
> 
> </h:panelGrid>
> 
> 


Re: Problems with nested SelectOneRadio, SelectManyCheckBox, ... and panelGrid ... (SOLVED)

Posted by Martin Marinschek <ma...@gmail.com>.
Ok, we could have answered that.

sorry for not doing so ;)

Indeed, that's a major stumbling point for many new users to JSF -

you'll need to add an h:messages tag in your page for
validation-messages to show up

if you don't and there is a validation error, the model won't be
updated and you won't have a clue as to why this did happen ;)

regards,

Martin

On 1/27/06, "R. Müller" <r....@unicomp-berlin.de> wrote:
> Hi group,
>
> i solved my issue respectively i figured out why :
>
> 1. has nothing to do with panelGrid or selection-components :-)
> 2. there was a validator, which marks some input as invalid, this seems
> to avoid remaining action (pushing back the values of the
> selection-components to the backing-bean) [of course, it is not the
> 'final' submit ...]
>
> regards
>
> Ronald
>
>
> R. Müller wrote:
> > Hi Group,
> >
> > in one of pages, i'm using several nested Select...-tags and panelGrids.
> > So far it worked well, but it seems that some selector-components don't
> > return their value to the backing-bean, if the form is submitted.
> > In the following example the value of selector 'selector1' isn't returned.
> > As a workaround i've implemented an appropriate ValueChangeListener,
> > this worked for me.
> >
> > Any hints, ideas ?
> >
> > regards
> >
> > Ronald
> >
> >
> >
> > <t:selectOneRadio id="selector1"
> > valueChangeListener="#{foo.selector1Changed}"
> > value="#{foo.selector1Value}" layout="spread"
> > onclick="this.form.submit()" >
> >
> > <f:selectItem itemValue="foo0" itemLabel="#{bundle['foo.fooLabel0']}"/>
> >
> > [... more select items ...]
> >
> > </t:selectOneRadio>
> >
> > <h:panelGrid>
> >
> > [... some stuff ...]
> >
> > <t:selectManyCheckbox onchange="this.form.submit()"
> > id="selector2" layout="spread" value="#{foo.selector2Value}">
> > <f:selectItems value="#{foo.selector2SelectItems}" />
> > </t:selectManyCheckbox>
> > <h:panelGrid>
> > <f:facet name="header">
> >     <t:radio for="selector1" index="0"/>
> > </f:facet>
> > <h:panelGrid>
> >     <t:checkbox for="selector2" index="0" />
> >     [... repeats to the last ...]
> > </h:panelGrid>
> > </h:panelGrid>
> >
> > [... some stuff ... ]
> >
> > </h:panelGrid>
> >
> >
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces