Wicket, Ajax and JSON

2009-07-31 Thread Serban Balamaci
Hello. I'm trying to create a wicket component out of FlexiGrid http://www.flexigrid.info/ . The javascript for the component requires an address from which it will receive data in the form of a JSON response. I'm not sure what is the best way to go about it. Simple and most ugly approach

RE: Wicket, Ajax and JSON

2009-07-31 Thread Serban Balamaci
/display-name servlet-nameJsonGateway/servlet-name servlet-classyour.package.json.JsonGateway/servlet-class /servlet servlet-mapping servlet-namegetSomeData/servlet-name url-pattern/json/getSomeData/url-pattern /servlet-mapping John- On Fri, Jul 31, 2009 at 6:34 AM, Serban

Re: Wicket, Ajax and JSON

2009-07-31 Thread serban . balamaci
Thanks guys, loved the AbstractAjaxBehavior solution, and by the way jqgrid seems to be more active and the way to go(thanks for pointing it Richard). Keeping fingers crossed for wiQuery and if they even bring the flexi or jqgrid to wicket it's gonna prove you can have awesome visual components in

Model to use for static Label text

2010-02-22 Thread serban . balamaci
Hello. I've always used add(new Label(alabel, new Model(A message)); - does this not save the A message string in the page store? Is it not better to do add(new Label(alabel, new LoadableDetachableModelString() { @Override protected String load() { return A

Re: Model to use for static Label text

2010-02-23 Thread Serban Balamaci
variable, thus creating the problem you are trying to solve. Serban Balamaci wrote: Hello. I've always used add(new Label(alabel, new Model(A message)); - does this not save the A message string in the page store? Is it not better to do add(new Label(alabel, new

Call Ajax on Parent Page from Popup page.

2010-05-07 Thread Serban Balamaci
Hello. I have a case where I'm trying to refresh the parent page from a popup page. On the parent page I have: AbstractDefaultAjaxBehavior clientSideCallingBehavior = new AbstractDefaultAjaxBehavior() { protected void respond(AjaxRequestTarget

Re: Call Ajax on Parent Page from Popup page.

2010-05-10 Thread Serban Balamaci
Thank you Jeremy, It's working this way, although that label was a simple container for the script: script language=JavaScript wicket:id=refreshJS/script I do not understand why it was not working. Now I have a problem in the sense that it's working only let's say the first time. Because I get:

Re: Call Ajax on Parent Page from Popup page.

2010-05-10 Thread Serban Balamaci
I have solved it by overiding getPreconditionScript() in the behaviour to return return true;: protected CharSequence getPreconditionScript() { return return true; } I hope I do not run into any problems with this. Cheers. -

Stateless Wicket and Ajax

2011-03-11 Thread Serban Balamaci
Hello everybody. I'm interested in Wicket for a public site. I want to use stateless pages in order to have nice looking pages indexed by Google(no JSESSIONID in the url) There is an approach to remove JSESSIONID from the url for search bots but I do not like it since that would mean that any

Re: Stateless Wicket and Ajax

2011-03-12 Thread Serban Balamaci
Yes I was looking at jolira tools, but I get the exception unable to find component and looking at the source: final Component component = page.get(pageRelativeComponentPath); if (component == null) { throw new WicketRuntimeException(unable to find component with path

Re: Stateless Wicket and Ajax

2011-03-13 Thread Serban Balamaci
Hello everybody. It is indeed as Robert is saying. And after changing the code, it works Component component = page.get(pageRelativeComponentPath); // See {@link // BookmarkableListenerInterfaceRequestTarget#processEvents(RequestCycle)} // We make have to try to

Wicket 1.5 PageParameters vs IRequestParameters question.

2011-04-11 Thread Serban Balamaci
Hello everybody, I''m in the process of migrating an app from 1.4 to 1.5-RC3 I see that the PageParameters and IRequestParameters are pretty separate things now. Any reason why it's done this way and why they not extend a Common Interface that exposes methods like getParameterNames

Re: Wicket 1.5 PageParameters vs IRequestParameters question.

2011-04-12 Thread Serban Balamaci
Hello Pedro, In my mind IRequestParameters and PageParameters should have stemmed from a common interface, extend some even generic one like(IKeyValues, IParams) but I trust you guys see the bigger picture maybe IRequestParameters is a very generic thing that doesn't have to mean a page's

Bypass CDATA contribution on script tags

2011-12-09 Thread Serban Balamaci
Hi all, Our javascript developer complains that Wicket automatically adds the CDATA part whenever it encounters the *script* tag. He's trying to embed a template in the html file(not in the head section) and he gets a bunch of CDATA along with the html which will get multiplied(we're creating a

Re: Avoid creating an HttpSession before login

2011-12-09 Thread Serban Balamaci
This created session on RestartResponseAtInterceptPageException may also lead to a possible Session Fixation attack in one that a malicious user tries to access your site and is redirected to the login page but now with a session created. The malicious user could then pass to a possible victim the

Re: Bypass CDATA contribution on script tags

2011-12-10 Thread Serban Balamaci
Hi Martin, Problem was, the JS dev was specific about not wanting to contribute to the head portion the JS template. What I've done for a quick solution is that we moved the js templates in a separate .tmpl files which sit next to the .html Then I use a PackageTextTemplate to provide the template

ResourceResponse to return error status code but also JSON error message

2011-12-13 Thread Serban Balamaci
Hello, I'm using an AbstractResource to return JSON entities. Problem is that it seems you cannot also return an error code and also the JSON string with detailed message in case of error. response.setWriteCallback(new WriteCallback() { @Override public

Re: usage of JavascriptFilteredIntoFooterHeaderResponse

2011-12-18 Thread Serban Balamaci
Hi Robert, Did someone offer you an answer with the fact that the class JavaScriptFilteredIntoFooterHeaderResponse is final? I've got the exact same question. I mean surely I don't want ALL my JS to end up in the footer like JavaScriptFilteredIntoFooterHeaderResponse method seems to be doing:

Overridable css resource

2011-12-23 Thread Serban Balamaci
Hi all, I'm trying to serve some css files from a custom dir outside the web dir. It should get a little more complicated that I'd want to fallback to serve the file from a package location if it's not found in the custom-css folder, but let's keep it simple first. I've created a class public

Re: Overridable css resource

2011-12-26 Thread Serban Balamaci
Hi Martin, That's a good solution, currently I keep the response.renderCSSReference(new CustomCssResourceReference(front.css)) but implement a custom DecoratingHeaderResponse to chose if I return instead of the string the original packaged css resource in the war file. DecoratingHeaderResponse

Re: AW: adjust my web application for smartphone like iPhone

2011-12-27 Thread Serban Balamaci
Hi, The way I do this is to use the style attribute in the wicket session. Wicket's default ResourceStreamLocator looks for files with the pattern filename_style_locale.html and falls back to filename.html So I have a RequestCycleListener that decides based on headers what type of a request it

RE: Is it possible to set the session?

2012-01-11 Thread Serban Balamaci
Hello, Maybe pass the sessionid in the url like a query parameter to the page you open in an iframe and then read the url parameter and return from that page a response with a JSESSIONID header equal to the value of the session. Subsequent requests to the page in the iframe will have this

RE: Is it possible to set the session?

2012-01-11 Thread Serban Balamaci
Hi Cosmin, What have you tried? Sending 1. .../frame_page;jsessionid=123 or 2. .../frame_page?jsessionid=123. The first option may work while the second it's normal not to have any impact on the session but can be used to get the sessionid as a parameter. The 1. option if it works, is not really

RE: Is it possible to set the session?

2012-01-11 Thread Serban Balamaci
You need two requests because in the first one you don't have yet have any session attached to the request you make to the server. And the server response will just be to attach JSESSIONID cookie and tell the browser to repeat the first request with the JSESSION cookie attached(you can redirect to