You need to sign in to do that
Don't have an account?
GoForceGo
Showing Radio Button instead of CheckBox in Visual Force
I have a table and only one row can possibly be selected.
Right now I have a wrapper class and a field called selected which is selected through a checkbox in VF UI.
I want to show a radio button instead.
Anyway to do it?
Message Edited by GoForceGo on 12-19-2008 12:39 AM
Right now I have a wrapper class and a field called selected which is selected through a checkbox in VF UI.
I want to show a radio button instead.
Anyway to do it?
Message Edited by GoForceGo on 12-19-2008 12:39 AM
Jeremy Kraybill
Austin, TX
Brian, as you said trying to fit selectRadio within a table seems painful. I went with select check box and Javascript to allow only one to be selected.
However, I still have the problem when there is an entry that is already selected (i.e the database already has a selected entry against it) - the Javascript doesn't work properly - it works if none of the entries are selected on the page initially.
Here is the link where I post my code.
I guess this link might be useful for you.
http://wiki.apexdevnet.com/index.php/Wrapper_Class
All the best.
The basic idea is to use the input of type radio and set the inputhidden variable to be the row that has been selected.
My example is more complicated - the first column of the table has a select box that allows a distributor to be selected.
Out of the selected distributors, one of them can be set as primary.
I tried to sample code line
<input type = "radio" name = "primary" onclick="setPreferredDistributor(this)" value="{!pd.pDistributor.id}" {!IF(primaryDistributor=pd.pDistributor.id,'checked=\"checked\"',null)} {!IF(NOT(pd.selected),'disabled=\"disabled\"',null)} />
but its giving compilation error, can you put some more info about it.