-
1. Re: dataTable onRowClick and commandLink inside work togethe
dmitry.demyankov Oct 31, 2007 5:46 PM (in response to j-pro)It seems that actionListener on event="onRowClick" is fired event if you select 'cancel' in the confirmation dialog.. I'd suggest you to set some flag when delete method is called and then check in actionListener if this flag was set. Can't think of a better solution so far..
-
2. Re: dataTable onRowClick and commandLink inside work togethe
j-pro Oct 31, 2007 5:58 PM (in response to j-pro)"dmitry.demyankov" wrote:
event if you select 'cancel' in the confirmation dialog..
Yes, that's why I wrote here. Actually it's logical, but very uncomfortable."dmitry.demyankov" wrote:
I'd suggest you to set some flag when delete method is called and then check in actionListener if this flag was set. Can't think of a better solution so far..
Yes, but what if user presses Cancel? The delete method will not be called, so the flag will not be set...
The one solution that comes into my mind is to use a4j:actionparam with a4j:commandLink. But is there any other ways? -
3. Re: dataTable onRowClick and commandLink inside work togethe
j-pro Nov 12, 2007 11:38 AM (in response to j-pro)To not just close the question, I'll post here the solution, which was gave to me by Maksim Kaszynski: to prevent execution of onrowclick event handler after clicking on a commandLink in a table row, you should add in commandLink: "onclick="Event.stop(event||window.event);""
In my case it would be:<a4j:commandLink id = "delLink" value = "X" styleClass="txtlink" onclick="Event.stop(event||window.event); if (!confirm('Are you sure?') ) {return false;}" action = "#{amBean.actDeleteFakeEmployee}" reRender = "employeesDataTable"> <a4j:actionparam value="#{item.employeeId}" name="employeeId" assignTo="#{amBean.parameterID}"/> </a4j:commandLink>
And I should admit that it works perfect. Thanks, Maksim! -
4. Re: dataTable onRowClick and commandLink inside work togethe
richuser Nov 13, 2007 1:32 AM (in response to j-pro)Hi J-Pro,
Is there a way to prevent execution of onrowclick event completely?
I have a scrollabledatatable and when I click on a row, and then click on a sortable header, I get this error:
java.io.NotSerializableException: org.richfaces.model.selection.SelectionRange