You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carsten Behring (JIRA)" <ji...@apache.org> on 2012/09/14 18:58:08 UTC

[jira] [Created] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Carsten Behring created WICKET-4764:
---------------------------------------

             Summary: Ajax links on second page of  datatable not working if client side filtering is active
                 Key: WICKET-4764
                 URL: https://issues.apache.org/jira/browse/WICKET-4764
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.0.0
            Reporter: Carsten Behring


I am using jquery datatable with wicket 6.0.0.
One of my columns contains an ajax link, which opens a ModalDialog.

>From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
(The list is client side paginated by jquery datatable)

There is the same problem, if the list gets filtered (client side).

It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)

It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.

With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489036#comment-13489036 ] 

Carsten Behring commented on WICKET-4764:
-----------------------------------------

I would like to reopen this problem.
let me try to explain, what situation I have.

I have an html table my page, which has one column with ajax links.

This table is sorted /paginated and filtered on client side via the jquery datatable component.

This leads to the fact that only a subset of table rows are shown/present on page load. The other rows are removed via client side java script from the dom by the datatable jquery component.

So now the wicket ajax supports adds on click events only to the VISIBLE/present rows (but not to all rows).
If I now change the visible rows client side, new rows become visible, without having event handlers added to them.

So clicking those new rows does not do anything.

I get error messages in the Ajax debug window like this:
ERROR: Cannot find element with id: statusLink1a6
ERROR: Cannot find element with id: statusLink1a7
....

Regards,

Carsten 


                
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455961#comment-13455961 ] 

Carsten Behring edited comment on WICKET-4764 at 9/15/12 4:24 AM:
------------------------------------------------------------------

I have some more detail.

It works, if the table is shown at least once on the screen completely on initial page load.

I modified the configuration of jquery datatable, so that pagination is in-active on the first load of the page.
Activating pagination or filtering after this, all links work.

But with the normal "pagination" behaviour, so that the pagination is active on first load of the page, I can only sucessfully click the ajax links of the first page. Clicking ajax links on second or further pages has no effect,
                
      was (Author: carstenbehring):
    I have some more detail.

It works, if the table is shown at least once on the screen comletely on initial page load.

I modified the configuration of jquery datatable, so that pagination is in-active on the first load of the page.
Activating pagination or filtering after this, all links work.

But with the normal "pagination" behaviour, so that the pagination is active on first load of the page, I can only sucessfully click all ajax links of the first page.
                  
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461503#comment-13461503 ] 

Carsten Behring commented on WICKET-4764:
-----------------------------------------

I opened the bug, because it is definitely a different behavoiur between wicket 1.5.8 and 6.0.0.

The wicketstuff datatable integration project: https://github.com/wicketstuff/core/wiki/DataTables 
does work with wicket 1.5.8 but not with 6.0.0
(the parts of the linking I described above)
 
So there might be somewhere a changed behavior in the Ajax part of 6.0.0 (not described in the migration guide)

I can not completely judge, where the problem is. But the "wicket stuff datatable" does basically nothing more then to call the following javascript (such as described in the datatable documentation):

$(document).ready(function(){
    $('#example').dataTable();
});


-->
		StringBuilder js = new StringBuilder();
		js.append("$(document).ready( function() {\n");
		js.append("	$('#" + getMarkupId() + "').dataTable( {\n");
                js.append("		\"bJQueryUI\": true,\n");
                js.append("		\"sPaginationType\": \"full_numbers\",\n");
		js.append("		\"sDom\":'<lR\"H\"Cfr>t<\"F\"ip>'\n");
		js.append("	} ).columnFilter();\n");
		js.append("} );");
		response.renderJavaScript(js, getId() + "_datatables");



I saw that the event listener registration is on the page, but it seems that the events do not get executed (or the backend part does not react on them), if some of the table rows with the link gets "hidden" by the client side  java script executed by datatable.



So I don't believe that there can be something wrong in the "wicket stuff datatable" project.


Regards,

Carsten



 
                
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489139#comment-13489139 ] 

Carsten Behring commented on WICKET-4764:
-----------------------------------------

I solved the problem.

The reason why it failed, was the following:

The wicket code which registered the events on the elements 
Wicket.Ajax.ajax({"u":"./?4-1.IBehaviorListener.0-allRequestsPanel-requestsDataView-rows-4-statusLink","e":"click","c":"statusLink9f"});;
Wicket.Ajax.ajax({"u":"./?4-1.IBehaviorListener.0-allRequestsPanel-requestsDataView-rows-8-statusLink","e":"click","c":"statusLinka0"});;
...

was called AFTER the datatable component had filtered already the table.

So some rows were already removed from the DOM and so the registering failed, and this created the above error messages.

So I changed my code and made sure, that the datatable component is only initialiased after the event registration took place.

This means that there is probably no bug in wicket, but I want to underline that the behavior has changed. With wicket 1.5 everything worked.


                
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Carsten Behring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455961#comment-13455961 ] 

Carsten Behring commented on WICKET-4764:
-----------------------------------------

I have some more detail.

It works, if the table is shown at least once on the screen comletely on initial page load.

I modified the configuration of jquery datatable, so that pagination is in-active on the first load of the page.
Activating pagination or filtering after this, all links work.

But with the normal "pagination" behaviour, so that the pagination is active on first load of the page, I can only sucessfully click all ajax links of the first page.
                
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (WICKET-4764) Ajax links on second page of datatable not working if client side filtering is active

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4764.
-------------------------------------

    Resolution: Incomplete

>From the given description it is not clear what exactly is broken.
I'm not acquaint with jQuery DataTable plugin and I'm not sure what exactly it does.

Wicket's AjaxLink just registers a JavaScript event listener on the respective <a> tag. The jQuery code is something like: jQuery('#myLink').on('click', function() { sendAjaxCall() })

Please give more details or even a quickstart and we will reopen the ticket.
                
> Ajax links on second page of  datatable not working if client side filtering is active
> --------------------------------------------------------------------------------------
>
>                 Key: WICKET-4764
>                 URL: https://issues.apache.org/jira/browse/WICKET-4764
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0
>            Reporter: Carsten Behring
>
> I am using jquery datatable with wicket 6.0.0.
> One of my columns contains an ajax link, which opens a ModalDialog.
> From wicket 6.0.0 onwards, the links do only work on the first page of the paginated list.
> (The list is client side paginated by jquery datatable)
> There is the same problem, if the list gets filtered (client side).
> It seems to me that there is a problem with the Ajax links, as soon as some of the rows are "invisible" (because filtered or on other page)
> It seems that the ajax events are either not fired at all, or do not manage to call the server side "onClick" method.
> With wicket 1.5.8 everything was working.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira