You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by manmeet <ma...@gmail.com> on 2006/10/10 00:10:07 UTC

Select One Row with Image

Hi all,

I am using the sandbox component for select one row.
Works perfectly fine.

But now what I want to do is use an image to select a row from a datatable
instead of radio buttons created by the selectOneRow component.
The radio button needs to be replaced by an image which when selected flips
to a different image which indicating selected row.

PLease let me know how can this be done? I am a newbie to Myfaces so any
help shall be appreciated.

Thanks to all.

-Manmeet
-- 
View this message in context: http://www.nabble.com/Select-One-Row-with-Image-tf2413162.html#a6726642
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Select One Row with Image

Posted by Ernst Fastl <er...@gmail.com>.
Hi Manmeet!

You could either write a new component similar to the SelectOneRow.
It would probably have two additional attributes like "image" and
"selectedImage" which renders an input type image.

or you could just use a normal  image inide a commandLink.
The commandLink would then probably also contain
updateActionListener which sets a Boolean Property in the
iterated Objects (= the one you access with the name
specified in the var attribute of the datatable). The graphic image
could than have a attribute like:
url="#{var.selected ? 'img/selected.jpg' : 'img/not_selected.jpg'}"

hope this helps

regards

Ernst

On 10/9/06, manmeet <ma...@gmail.com> wrote:
>
> Hi all,
>
> I am using the sandbox component for select one row.
> Works perfectly fine.
>
> But now what I want to do is use an image to select a row from a datatable
> instead of radio buttons created by the selectOneRow component.
> The radio button needs to be replaced by an image which when selected flips
> to a different image which indicating selected row.
>
> PLease let me know how can this be done? I am a newbie to Myfaces so any
> help shall be appreciated.
>
> Thanks to all.
>
> -Manmeet
> --
> View this message in context: http://www.nabble.com/Select-One-Row-with-Image-tf2413162.html#a6726642
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>