You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bjørn T Johansen <bt...@havleik.no> on 2007/10/05 13:22:42 UTC

selectOneRadio/selectBooleanCheckbox problem?

I have a table that has x rows... Each row has n columns and some of these columns should be a checkbox the user
can enable/disable..
The problem is that only one of the checkboxes for a column can be enabled, i.e. when the user enable one
checkbox in one row, if another checkbox in the same column in another row is enabled it should be disabled (like a
radiobutton feature)

Is there a smart way of doing this or do I have to use an onclick event and do it manually?


Regards,

BTJ
-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

Re: selectOneRadio/selectBooleanCheckbox problem?

Posted by David Delbecq <de...@oma.be>.
Bjørn T Johansen a écrit :
> I have a table that has x rows... Each row has n columns and some of these columns should be a checkbox the user
> can enable/disable..
> The problem is that only one of the checkboxes for a column can be enabled, i.e. when the user enable one
> checkbox in one row, if another checkbox in the same column in another row is enabled it should be disabled (like a
> radiobutton feature)
>
> Is there a smart way of doing this or do I have to use an onclick event and do it manually?
>
>
> Regards,
>
> BTJ
>   
Easy way:

onclick, javascript. However, a user with javascript disabled will 
override this and allow multiple row selected, be carefull

smart way: create a custom component that has this behaviour and check 
only one row is selected
really smart way: considering the notion of "selecting a row of 
datatable" has been raised countless time on this mailing list, i doubt 
there isn't an open source library with alreay such a component :D