You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Borja Martín <bo...@dagi3d.net> on 2005/03/10 18:13:08 UTC
checkboxes and lists
hi all
suppose I have following situation:
I have a list of items that will be rendered in the view using the
datatable component so I can select them individiually. The thing is
that I also would like to insert a checkbox in a column for each row in
order to be able to get the selected items as another list.
I know I could use the selectManyCheckbox component. But in this case, I
wouldn't be able to get the items individually using the DataModel
object used to fill the table...
any ideas?
thanks in advance
Re: checkboxes and lists
Posted by Borja Martín <bo...@dagi3d.net>.
the reason because the styles were lost was just because adding a form
changes the id for all the inner elements. So this approach worked fine
Borja Martín wrote:
> I've found a working approach here:
> http://forum.java.sun.com/thread.jspa?threadID=486654&messageID=2278422
>
> the thing is that some columns arent displayed and the style classes
> are lost, maybe because it's necessary to put the datatable inside
> another form and that's causing such a extrange display
>
> and remember to change this line code:
> FacesContext.getCurrentInstance().getRequestMap().get("var");
> with:
> FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("var");
>
>
> Heath Borders wrote:
>
>> Unfortunately, this is not something that can be easily accomplished
>> with the standard JSF components. I'm not that familiar with all of
>> the MyFaces custom components, so maybe someone can point you in that
>> direction.
>>
>>
>> On Thu, 10 Mar 2005 18:13:08 +0100, Borja Martín <bo...@dagi3d.net>
>> wrote:
>>
>>
>>> hi all
>>> suppose I have following situation:
>>> I have a list of items that will be rendered in the view using the
>>> datatable component so I can select them individiually. The thing is
>>> that I also would like to insert a checkbox in a column for each row in
>>> order to be able to get the selected items as another list.
>>> I know I could use the selectManyCheckbox component. But in this
>>> case, I
>>> wouldn't be able to get the items individually using the DataModel
>>> object used to fill the table...
>>> any ideas?
>>>
>>> thanks in advance
>>>
>>>
>>
>>
>>
>>
>>
>
Re: checkboxes and lists
Posted by Borja Martín <bo...@dagi3d.net>.
I've found a working approach here:
http://forum.java.sun.com/thread.jspa?threadID=486654&messageID=2278422
the thing is that some columns arent displayed and the style classes are
lost, maybe because it's necessary to put the datatable inside another
form and that's causing such a extrange display
and remember to change this line code:
FacesContext.getCurrentInstance().getRequestMap().get("var");
with:
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("var");
Heath Borders wrote:
>Unfortunately, this is not something that can be easily accomplished
>with the standard JSF components. I'm not that familiar with all of
>the MyFaces custom components, so maybe someone can point you in that
>direction.
>
>
>On Thu, 10 Mar 2005 18:13:08 +0100, Borja Martín <bo...@dagi3d.net> wrote:
>
>
>>hi all
>>suppose I have following situation:
>>I have a list of items that will be rendered in the view using the
>>datatable component so I can select them individiually. The thing is
>>that I also would like to insert a checkbox in a column for each row in
>>order to be able to get the selected items as another list.
>>I know I could use the selectManyCheckbox component. But in this case, I
>>wouldn't be able to get the items individually using the DataModel
>>object used to fill the table...
>>any ideas?
>>
>>thanks in advance
>>
>>
>>
>
>
>
>
Re: checkboxes and lists
Posted by Heath Borders <he...@gmail.com>.
Unfortunately, this is not something that can be easily accomplished
with the standard JSF components. I'm not that familiar with all of
the MyFaces custom components, so maybe someone can point you in that
direction.
On Thu, 10 Mar 2005 18:13:08 +0100, Borja Martín <bo...@dagi3d.net> wrote:
> hi all
> suppose I have following situation:
> I have a list of items that will be rendered in the view using the
> datatable component so I can select them individiually. The thing is
> that I also would like to insert a checkbox in a column for each row in
> order to be able to get the selected items as another list.
> I know I could use the selectManyCheckbox component. But in this case, I
> wouldn't be able to get the items individually using the DataModel
> object used to fill the table...
> any ideas?
>
> thanks in advance
>
--
-Heath Borders-Wing
hborders@mail.win.org