Johnny2012
Johnny2012

Reputation: 1532

get selected row in ace:datatable Icefaces

I am using an in rowselection mode and trying just to get the selected row of the datatable.

I have tried it using the stateMap of IceFaces, but it does not work. The ajax event opens a dialog after selection, where I want to show data of the selected row.

<ace:dataTable id="datatable"
        value="#{myBean.myValues()}"
        var="myValue" paginator="true" paginatorPosition="bottom"
        selectionMode="single" rows="15" rowKey="#{myValue.id}"
        doubleClickSelect="true">
        <ace:ajax event="select" render="@this" execute="@this"
            onStart="ice.ace.instance('#{myDialog.clientId}').show();" />


...

Upvotes: 0

Views: 1447

Answers (1)

Mounif Haydar
Mounif Haydar

Reputation: 31

You can add rowSelectListener to the tag <ace:dataTable>

<ace:dataTable rowSelectListener="#{manageBean.rowSelectListener1}" >

And add a function in the code behind to get the row selected.

public void rowSelectListener1(SelectEvent event){

 DataType selectedItem = (DataType )event.getObject();

}

Upvotes: 1

Related Questions