2 Replies Last post: Aug 21, 2008 3:59 PM by aodeqiang  
aodeqiang   4 posts since
Aug 8, 2008
Currently Being Moderated

Aug 15, 2008 6:13 PM

problem with client side event handler in <q:dataTable>

As stated in documents, "You can specify client-side events for the particular row or cell using the following attributes of the <q:row> and <q:cell> tags: onclick, ondblclick, onmousedown, onmouseover, onmousemove, onmouseout, onmouseup, onkeydown, onkeyup, onkeypress. When specify row or cell-specific client-side events, you can use request-scope variables of the DataTable component (see the description of var, rowIndexVar, columnIndexVar and columnIdVar attributes in the section Request-Scope Variables).

 

You can also specify client-side event handlers for rows using the following attributes of the <q:dataTable> tag: rowOnclick, rowOndblclick, rowOnmousedown, rowOnmouseover, rowOnmousemove, rowOnmouseout, rowOnmouseup. When specifying these attributes, you can use request-scope variables defining parameters of the current row. These are the same parameters as those that can be used when defining column child components (see the section Request-Scope Variables)."

 

in order to show the details of a selected record, i've tried to use a ajax event handler to catch a "rowOndbclick" event like this:

<q:dataTable>   

              <q:multipleRowSelection rowDatas="#{tableController.selections}" style="background: #a4aec5; color: white;"/>

               <f:facet name="below">

                    <q:dataTablePaginator id="paginator" style="margin-left: 170px; margin-top: 10px;"/>                       

                </f:facet>

....

                <a:support event="rowOndblclick"  ajaxSingle="true" action="#{currentViewerController.showDetails}"  reRender="contentPanel"/>

</q:dataTable>

but i got only an error message:

16:47:16,216 WARN  Parameters Parameters: Invalid chunk ignored.

only with this information, i cannot understand what is my error.

is my code a correct use case?  or can you introduce perhaps a correct usage of the client-side event handler?

 

moreover , i've also tried to find out in my code which rows were selected.  but only when i click "next page" can i get the correct selections.

i.e:

only when i click "next page" or "previous page" was #{tableController.selections} called.

is it possible to get a "real time" selection?

Dmitry Pikhulya TeamDev Ltd. 162 posts since
Jan 5, 2007
Currently Being Moderated
1. Aug 18, 2008 11:33 PM in response to: aodeqiang
Re: problem with client side event handler in <q:dataTable>

Hello,

 

Thank you for reporting the problem. We are going to fix this in QuipuKit 1.6. Please contact us at quipukit-support AT teamdev DOT com if you'd like to get a prerelease version with this fix. As a result the following code should trigger the reload of the "contentPanel" component when any row is double-clicked:


 <q:dataTable>
...
<q:row>
  <a4j:support event="ondblclick" reRender="contentPanel" ...></a4j:support>
</q:row>
...
</q:dataTable>

 

Note that rowOn... attributes are deprecated and we are going to remove them, so it's recommended to use q:row tag instead.

 

As to your question regarding receiving selection parameters, selection is transmitted with all form submissions to the server, just like any other editable data. So you should be able to get the up-to-date selection on any server action. The reason that you might not have the fresh selection data in your case might be due to the "restricted" a4j:support action, which might not submit all components. I suppose that removing the ajaxSingle parameter should solve this problem.

 

Feel free to ask if you have further questions.

 

Regards,

Dmitry

More Like This

  • Retrieving data ...