OK, it works but it doesn't invokes the selectListener in my BackingBean.
Do I have to do something more to invoke the listener method when a row is selected in this way?
You are right, it does not call the server side SelectListener.
but you can call the customActionListener which will call the selectListener after that.
you can add the bb.bjsf.sync method like this
Focus in a listgrid
13 May, 2008 - 15:19 — yudiHi gdperellon,
To focus a certain row in a list grid, you can set "focusedRow" property to certain list grid row id then fire "focus" event.
<e:handler event="click" type="text/javascript">
var oListGrid = bb.document.getElementById("listGrid");
oListGrid.setAttribute("selectedIndexes", "0");
oListGrid.setProperty("focusedRow", 0);
bb.command.fireEvent(oListGrid, "focus", false, false);
</e:handler>
</b:button>
hope this help,
Yudi
OK, it works but it doesn't
19 May, 2008 - 10:29 — DavidOK, it works but it doesn't invokes the selectListener in my BackingBean.
Do I have to do something more to invoke the listener method when a row is selected in this way?
Thanks and regards.
focusing listgrid
19 May, 2008 - 17:57 — andysHi David,
You are right, it does not call the server side SelectListener.
but you can call the customActionListener which will call the selectListener after that.
you can add the bb.bjsf.sync method like this
<e:handler event="pageRefreshed" type="application/javascript">
var oListGrid = bb.document.getElementById("listGrid");
oListGrid.setAttribute("selectedIndexes", "0");
oListGrid.setProperty("focusedRow", 0);
bb.command.fireEvent(oListGrid, "focus", false, false);
bb.bjsf.sync(this, "custom", "param1", "0");
</e:handler>
</f:verbatim>
and create the customAction method into your backing Bean
System.out.println(event.getAtts().get("param1"));
listGrid.setRowIndex(0);
this.rowIndex = listGrid.getRowIndex();
}
Dont forget to add this code below in your listgrid instantiation
Hope this helps,
Andys
Yes, it helps me a
19 May, 2008 - 20:54 — DavidYes, it helps me a lot.
Thank you very much, andys.
Kind Regards
David