You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sj...@stradefi.com on 2006/10/01 22:32:14 UTC

selectOneRadio

Hi!

I am using a selectOneRadio list displayed on my jsp page but I would like
only to display this list with a default selected value. For example I would
like to display the following list:

  Motive1
  Motive2
  Motive3
X Motive4
  Motive5

And I want Motive4 to be selected and not be able to change this selection.
I was thinking to give the value Motive4 to Myclass.absenceMotive but then
nothing is selected in my page, what can I do to do that?

<h:selectOneRadio value="#{Myclass.absenceMotive}" layout="pageDirection"
disabled="true"
<f:selectItems value="#{Myclass.absenceMotives}" />
</h:selectOneRadio>

Thanks


Re: selectOneRadio

Posted by Bruno Aranda <br...@gmail.com>.
You can disable a SelectItem by using its method setDisabled(boolean),
so the user select it. Cheers,

Bruno

On 10/2/06, sjarlier@stradefi.com <sj...@stradefi.com> wrote:
> Thanks a lot. I found my error. I did not have the correct value in my
> Motive4.
>
> Just another question as well: is it possible to disable a selectOneMenu but
> let the user see what there is in the list? I do not want the user to change
> his selection but I want him to be able to see all items of the list...
>
> Thanks
> Sophie
>
> -----Message d'origine-----
> De: Gerald Müllan [mailto:bierbrauen@gmail.com]
> Envoyé: lundi 2 octobre 2006 09:10
> Ŕ: MyFaces Discussion; sjarlier@stradefi.com
> Objet: Re: selectOneRadio
>
> Hi,
>
> if this still doesn`t work, just post the managed bean code here.
>
> cheers,
>
> Gerald
>
> On 10/1/06, sjarlier@stradefi.com <sj...@stradefi.com> wrote:
> > Hi!
> >
> > I am using a selectOneRadio list displayed on my jsp page but I would like
> > only to display this list with a default selected value. For example I
> would
> > like to display the following list:
> >
> >   Motive1
> >   Motive2
> >   Motive3
> > X Motive4
> >   Motive5
> >
> > And I want Motive4 to be selected and not be able to change this
> selection.
> > I was thinking to give the value Motive4 to Myclass.absenceMotive but then
> > nothing is selected in my page, what can I do to do that?
> >
> > <h:selectOneRadio value="#{Myclass.absenceMotive}" layout="pageDirection"
> > disabled="true"
> > <f:selectItems value="#{Myclass.absenceMotives}" />
> > </h:selectOneRadio>
> >
> > Thanks
> >
> >
>
>
> --
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>

RE: selectOneRadio

Posted by sj...@stradefi.com.
Thanks a lot. I found my error. I did not have the correct value in my
Motive4. 

Just another question as well: is it possible to disable a selectOneMenu but
let the user see what there is in the list? I do not want the user to change
his selection but I want him to be able to see all items of the list...

Thanks
Sophie

-----Message d'origine-----
De : Gerald Müllan [mailto:bierbrauen@gmail.com] 
Envoyé : lundi 2 octobre 2006 09:10
À : MyFaces Discussion; sjarlier@stradefi.com
Objet : Re: selectOneRadio

Hi,

if this still doesn`t work, just post the managed bean code here.

cheers,

Gerald

On 10/1/06, sjarlier@stradefi.com <sj...@stradefi.com> wrote:
> Hi!
>
> I am using a selectOneRadio list displayed on my jsp page but I would like
> only to display this list with a default selected value. For example I
would
> like to display the following list:
>
>   Motive1
>   Motive2
>   Motive3
> X Motive4
>   Motive5
>
> And I want Motive4 to be selected and not be able to change this
selection.
> I was thinking to give the value Motive4 to Myclass.absenceMotive but then
> nothing is selected in my page, what can I do to do that?
>
> <h:selectOneRadio value="#{Myclass.absenceMotive}" layout="pageDirection"
> disabled="true"
> <f:selectItems value="#{Myclass.absenceMotives}" />
> </h:selectOneRadio>
>
> Thanks
>
>


-- 
http://www.irian.at

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

Professional Support for Apache MyFaces


Re: selectOneRadio

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

if this still doesn`t work, just post the managed bean code here.

cheers,

Gerald

On 10/1/06, sjarlier@stradefi.com <sj...@stradefi.com> wrote:
> Hi!
>
> I am using a selectOneRadio list displayed on my jsp page but I would like
> only to display this list with a default selected value. For example I would
> like to display the following list:
>
>   Motive1
>   Motive2
>   Motive3
> X Motive4
>   Motive5
>
> And I want Motive4 to be selected and not be able to change this selection.
> I was thinking to give the value Motive4 to Myclass.absenceMotive but then
> nothing is selected in my page, what can I do to do that?
>
> <h:selectOneRadio value="#{Myclass.absenceMotive}" layout="pageDirection"
> disabled="true"
> <f:selectItems value="#{Myclass.absenceMotives}" />
> </h:selectOneRadio>
>
> Thanks
>
>


-- 
http://www.irian.at

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

Professional Support for Apache MyFaces