-
1. Re: Problem with eventhandling with more than one control
sergeysmirnov Jun 9, 2008 1:13 PM (in response to styx2000)Did you see the second example at:
http://livedemo.exadel.com/richfaces-demo/richfaces/componentControl.jsf?c=componentControl
Your code presumes each rows has own instance of the context menu. It is not optimal. -
2. Re: Problem with eventhandling with more than one control
styx2000 Jun 9, 2008 6:48 PM (in response to styx2000)sorry i made a mistake when copying and pasting, the component control is actually outside the datatable in my code:
<rich:dataTable var="elem" width="100%" rows="20" onRowClick="javasript:doSomething;"> ... <rich:componentControl event="onRowClick" for="menu" operation="show" > <f:param value="#{elem.id.agreementid}" name="agreementid"/> <f:param value="#{row}" name="rownumber"/> <f:param value="#{elem.cscid}" name="cscid"/> </rich:componentControl> ... </rich:dataTable> <rich:contextMenu submitMode="none" id="menu" > ... </rich:contextMenu>
by the way: the problem i'm trying to solve is this:
i want to mark the currently selected table-row, so the user knows which row he clicked when the context menu opens. when i click a row and don't move the cursor over the context menu, then click on another row the context menu opens on this other row. in this case the oncollapse event of the first menu is not triggered, that's my problem.
maybe somebody already solved this problem and can share his solution?
thanks -
3. Re: Problem with eventhandling with more than one control
styx2000 Jun 9, 2008 6:49 PM (in response to styx2000)sorry, i'm tired, typo again:
the component control is inside the datatable, the context-menu is outside the datatable (as in the last code snippet i posted) -
4. Re: Problem with eventhandling with more than one control
ilya_shaikovsky Jun 10, 2008 7:48 AM (in response to styx2000)Could you use onRowMouseDown for another JS call?
In general component control could be named instead of attached through the name attribute. In this case JS call like () will call the control operation. But this way seems hardly applicable inside iteration component. -
5. Re: Problem with eventhandling with more than one control
styx2000 Jun 11, 2008 9:04 AM (in response to styx2000)The use of "onRowMouseDown" was a solution for my problem.
Thanks a lot you for your help Ilya!