Wicket and a rich ajax website: easiest way to do it? -


I want to use the wicket to create an application, but I have some designers who want to write / keep javascript , And they basically expect 1 JS-Segment per page and a global JS-file. I think the most natural way to add javascript to the wicket is to add per component (per page), which will create problems for those designers (different JavaScript, and writing it in a Java-file). Is there a better way to fix this? (Of course, I expect to work after partial refresh.)

And the second (related) thing they want (and I really want) JSON- through a steady link Format, what is this possible in the wicket?

The wicket built in AJAX support is always narrative and thus reached with the changing URL. If your designers are not planning to use Wicket's JS Library, then this JSON page is very easy to mount:

  increases the public category JsonReturningPage webpage {public JsonReturningPage (page Parameter parameter) {String json = "{Foo: 4711}"; IRequestTarget T = new stringing target ("App / Jason", "UTF-8", JSNO); GetRequestCycle () setRequestTarget (t). }}  

Alternatively, you can return your AbstractRequestTargetUrlCodingStrategy to IRequestTarget to return the IRequestTarget decode (RequestParameters params) directly Can also apply) and mount it in your application.

Regarding JS files, I will try to use one file per component to educate them. This is definitely taking advantage of less copy-paste code and simple friendship. In addition, I definitely discourage JS in Java code. Generally, only JS data needs to be configured or configured as either variable definition or method call. Since this figure is usually in Java and written by JS designer, it is time that the designers and programmers should be included in the team.


Comments