Hi,
2008/10/17 Rafael Reuber <[EMAIL PROTECTED]>:
>
> Hi There,
>
> How to remove all elements checked from my table ( <tr:table ..
> rowSelection="multiple">)?
just add a "remove" button to your page, like:
<tr:table id="table" rowSelection="multiple"
value="#{bean.arrayListWithMyObjects}" ...>
...
</tr:table>
<tr:commandButton text="remove selected things" action="#{bean.select}" />
And write an action method, pretty much like this:
public String select()
{
FacesContext context = FacesContext.getCurrentInstance();
UIXTable table = (UIXTable) context.getViewRoot().findComponent("table");
RowKeySet rowKeySet = table.getSelectedRowKeys();
Iterator<Object> iterator = rowKeySet.iterator();
while(iterator.hasNext())
{
Entity e = null;
Object rowKey = iterator.next();
table.setRowKey(rowKey);
e = (Entity) table.getRowData();
table.setRowKey(rowKey);
// work on the selected entry...
// like use the Enity bean to put it to your
// backend, => service.deleteThisguy(e);
// or the "arrayListWithMyObjects" collection
}
rowKeySet.removeAll();
return null;
}
Isn't there any demo/example in the Trinidad demo ?
-Matthias
>
>
> Thanks
>
>
>
>
> __________________________________________________
> Fale com seus amigos de graça com o novo Yahoo! Messenger
> http://br.messenger.yahoo.com/
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf