File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Radio

 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have t:selectOneRadio tag in a h:datatable. When radio button diplayed, it comes with the value. But I don't want to diplay the value of the radio button , but radio only. Could any one have any idea is it possible for t:selectOneRadio ?

Thanks,
Joe.
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried like this?



See the value attribute, I think setting this to empty will not select any radio.
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I need to check it. Also I am using tomahawk selectOneRadio.

Thanks,
Joe.
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Gohar:
Have you tried like this?



See the value attribute, I think setting this to empty will not select any radio.



Unfortunately you solution didn't work for me. Is there any other way to satisfy my condition that is, don't display the value with radio button ?

Anyone has a thought ?

Thanks,
Joe
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by value? are you saying that when radio buttons display one of them is selected by default? or something else?
 
Yellapa Adepu
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean not to display any of the radio buttons selected by default. Assing an invalid value to backing property.

<t:selectOneRadio id="addType" disabled="false" value="#{bean.addType}"
<f:selectItem itemLabel="Person" itemValue="person"/>
<f:selectItem itemLabel="Office" itemValue="office"/>
</t:selectOneRadio>

If you set backing bean property anything other than person or office. It won't be selected by default..

I hope it helps you.

Regards,
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Gohar:
what do you mean by value? are you saying that when radio buttons display one of them is selected by default? or something else?


No I didn't mean selected by default value. I meant, when radio button displayed, it comes with its assigned value like some ids or names .Can I display just the radio only like we do in struts or html ? Am I clear ?

Thanks,
Joe.
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Yellappa Adepu:
If you mean not to display any of the radio buttons selected by default. Assing an invalid value to backing property.

<t:selectOneRadio id="addType" disabled="false" value="#{bean.addType}"
<f:selectItem itemLabel="Person" itemValue="person"/>
<f:selectItem itemLabel="Office" itemValue="office"/>
</t:selectOneRadio>

If you set backing bean property anything other than person or office. It won't be selected by default..

I hope it helps you.

Regards,


What you meant by 'invalid' value ? Can you please explain a bit more ?

Thanks,
Joe.
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not understood exactly. Are you saying you don't want to show the labels with Radio Buttons? If it is the case then i guess don't provide the itemLabel or provide empty String ("") in itemLabel Attribute.
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if am not clear.

The following is the code I have written for radio button (it is in datatable) :



I haven't given any itemLabel. But still it displayes like :

O quoteNo1
O quoteNo2

'O' represents radio and 'quoteNo1 and 2 ' represents the value comes in value and itemValue attribute. What I want is just display like :
O (without quoteNo) .

Am I still not clear ? Please bare with me.

Thanks,
Joe.
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok have you tried using itemLabel="" inside <f:selectItem> ?
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Gohar:
Ok have you tried using itemLabel="" inside <f:selectItem> ?


Thank you very much Ali. That worked !!
I thoight if we put itemLabel it will display the label.So I hadn't tried.
A big big thank you to you.

Very thoughtful of you,
Joe.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic