You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ota Hauptmann (JIRA)" <ji...@apache.org> on 2012/07/24 16:27:33 UTC

[jira] [Created] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

Ota Hauptmann created WICKET-4671:
-------------------------------------

             Summary: Cannot fallback to the link URL from ajax precondition
                 Key: WICKET-4671
                 URL: https://issues.apache.org/jira/browse/WICKET-4671
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 6.0.0-beta3
            Reporter: Ota Hauptmann


Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.

In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
- return nothing or not-false to keep going
- return false and stop the execution of the link

But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.

The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.

With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

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

Martin Grigorov commented on WICKET-4671:
-----------------------------------------

Please attach a quickstart to play with.
Thanks!
                
> Cannot fallback to the link URL from ajax precondition
> ------------------------------------------------------
>
>                 Key: WICKET-4671
>                 URL: https://issues.apache.org/jira/browse/WICKET-4671
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Ota Hauptmann
>
> Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.
> In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
> - return nothing or not-false to keep going
> - return false and stop the execution of the link
> But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.
> The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.
> With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

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

Martin Grigorov resolved WICKET-4671.
-------------------------------------

    Resolution: Not A Problem
    
> Cannot fallback to the link URL from ajax precondition
> ------------------------------------------------------
>
>                 Key: WICKET-4671
>                 URL: https://issues.apache.org/jira/browse/WICKET-4671
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Ota Hauptmann
>
> Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.
> In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
> - return nothing or not-false to keep going
> - return false and stop the execution of the link
> But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.
> The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.
> With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

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

Martin Grigorov commented on WICKET-4671:
-----------------------------------------

It was a bug actually.
I improved it yesterday. Now each Ajax call has its own instance of 'attrs'.
                
> Cannot fallback to the link URL from ajax precondition
> ------------------------------------------------------
>
>                 Key: WICKET-4671
>                 URL: https://issues.apache.org/jira/browse/WICKET-4671
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Ota Hauptmann
>
> Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.
> In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
> - return nothing or not-false to keep going
> - return false and stop the execution of the link
> But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.
> The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.
> With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

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

Martin Grigorov commented on WICKET-4671:
-----------------------------------------

I think I see a solution.
In your precondition if Ctrl is used then change attrs.ad to true and return false to stop the Ajax call.
                
> Cannot fallback to the link URL from ajax precondition
> ------------------------------------------------------
>
>                 Key: WICKET-4671
>                 URL: https://issues.apache.org/jira/browse/WICKET-4671
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Ota Hauptmann
>
> Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.
> In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
> - return nothing or not-false to keep going
> - return false and stop the execution of the link
> But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.
> The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.
> With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4671) Cannot fallback to the link URL from ajax precondition

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

Ota Hauptmann commented on WICKET-4671:
---------------------------------------

Dear Martin, I really appreciate your super-quick answer! And I have to apologize immediately - I cannot understand how I could missed that information in the documentation :-( You are definitely right, this solved my "issue".
Just a notice: I have to set the attr.ad in both cases - if the modifier is pressed and if it is not. The reason is, that if I set the attr.ad to true, the "scope" of this change is not limited to the click event, but to the page lifecycle scope. So from this moment, the link starts to perform the default behavior on every click (until the attrs.ad=false is set in another event). I assume, this is a feature or "works as designed", I mention it to be sure of it. Well, is it so?
                
> Cannot fallback to the link URL from ajax precondition
> ------------------------------------------------------
>
>                 Key: WICKET-4671
>                 URL: https://issues.apache.org/jira/browse/WICKET-4671
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Ota Hauptmann
>
> Let's have an AjaxFallbackLink - it means a link with ajax ability and also with ability to do things "classically" if JavaScript is not enabled. I want this link to be "Ctrl+clickable" (or other modifier-key-clickable) to be able to open it directly in a new tab or window of a browser.
> In Wicket 1.5, it was possible to implement a decorator, where I was able to "return true" in case a modifier key was pressed in that moment and the Javascript execution was stopped and the raw link action was performed. In Wicket 6, there is possibility to specify the precondition of the ajax call, but there seem to be only two cases:
> - return nothing or not-false to keep going
> - return false and stop the execution of the link
> But it is not possible to "return true" as with Wicket 1.5's decorator to stop the ajax/Javascript execution, but to continue performing raw Ctrl+click.
> The Javascript handling code of this situation is in wicket-ajax-jquery.js at lines 503-507: there is the only one "stop situation", if the result is false, return false. Nothing more possible, nothing configurable.
> With the information from https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax I wasn't able to solve this situation by another way, which means I am not able to solve it at all (in Wicket 1.5 I was). Or am I doing something completely wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira