[ 
https://issues.apache.org/jira/browse/WICKET-5087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599777#comment-13599777
 ] 

Ernesto Reinaldo Barreiro commented on WICKET-5087:
---------------------------------------------------

@Martin,

Apologies for my late reaction!

I think this is a nice feature to have. In essence it is like mounting a 
"global router" on a page. 

About uniqueness of URL. Maybe we can add a

/**
         * Determines if it can handle a "short URL" AJAX request.
         * 
         * @param target
         * @return returns true by default.
         */
        public boolean canHandleShortUrlRequest(AjaxRequestTarget target)
        {
                return true;
        }

Which can be used to discriminate components having same short URL. See 
attached patch + example

Also

1- I would try to experiment with this creating a complex UI widget to see how 
useful this really is: I can try to volunteer and do that.    
2- Another feature that might be nice to have is mounting "stateless non 
synchronized resources" on the fly, maybe associated to the page, so that 
components could attach some stateless "services" to a page 
    and use page as context for serving them.  

Cheers,

Ernesto

                
> Make it easier to request (ajax)behaviors by name from JavaScript
> -----------------------------------------------------------------
>
>                 Key: WICKET-5087
>                 URL: https://issues.apache.org/jira/browse/WICKET-5087
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 6.6.0
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: WICKET-5087.patch, wicket-ajax-shorturl.tgz
>
>
> Many JavaScript libraries require server endpoint for making requests for 
> loading/saving data.
> To integrate such JS library with Wicket the application developer should 
> make the IRequestListener's url available as an endpoint. That is it need to 
> store somewhere the url produced by #urlFor() or 
> AjaxBehavior#getCallbackUrl().
> This new feature will make this much simpler for the application developer.
> A new method will be added to Wicket.Ajax namespace to facilitate this:
>    Wicket.Ajax.short({
>       'su': 'countries',
>       'dep': [function() {return [{'name': 'extra', 'value': 'param'}]}],
>       'coh': [function() {console.log('Completed!')}]
>     });
> This new method will again receive an object with all possible attributes 
> plus a new one - 'su', stands for 'short/stable/simple' url.

--
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

Reply via email to