keep on getting non-bookmarkable URL with QueryStringUrlCodingStrategy...

2009-09-20 Thread Erik Brakkee
Hi, I have mounted a specific page using QueryStringUrlCodingStrategy to a specific URL. Nevertheless, when I use setResponsePage(MyPage.class, pageParams), I keep on getting a URL that has a session-specific parameter with name 'x'. Is there anything I am doing wrong. I just have one parameter

Re: keep on getting non-bookmarkable URL with QueryStringUrlCodingStrategy...

2009-09-20 Thread Erik Brakkee
There is definitely something strange going on. It appears that whenever I use a parameter that has a '/' in it I get strange behavior. I do see the '/' being encoded properly but still these '/' characters are in the way. Typical behavior is to see an empty page with the default URL coding

setting contentType on ResourceReference...

2009-08-14 Thread Erik Brakkee
Hi, I was wondering how to set the contentType when creating a ResourceReference or PackageResource. Is this possible? Cheers Erik

Re: Wicket and JEE6

2010-04-05 Thread Erik Brakkee
On Wed, Mar 31, 2010 at 5:05 AM, Iskandar Salim locrianm...@gmail.comwrote: Olivier Bourgeois-2 wrote: ... everything is simple unmanaged POJOs except for your classes extending WebPage which are managed Not to be picky but a minor correction :) everything is simple unmanaged

Re: Wicket and JEE6

2010-04-05 Thread Erik Brakkee
I wonder what the use would be for the request, session, and conversation scopes in wicket since these are already managed expiicitly in wicket. At least, I wouldn't see a great need for such scopemanagement by the container. It would be nice however if CDI could be used to inject EJBs,

Re: Wicket and JEE6

2010-04-05 Thread Erik Brakkee
On Mon, Apr 5, 2010 at 9:54 PM, James Carman jcar...@carmanconsulting.comwrote: Did you not look at what I put together? I've already got all the injection stuff (and conversations) working and I've got example applications illustrating it. I tried to look at it but couldn't access the

Re: Wicket and JEE6

2010-04-05 Thread Erik Brakkee
On Mon, Apr 5, 2010 at 10:37 PM, James Carman jcar...@carmanconsulting.comwrote: It's apparently down again. That's what I get for hosting my server at my in-law's house. Cheaper isn't necessarily better. If you want, I can email you the code. You can mail the code to me. If it's not too

Re: Wicket and JEE6

2010-04-10 Thread Erik Brakkee
On Mon, Apr 5, 2010 at 11:58 PM, James Carman jcar...@carmanconsulting.comwrote: What I'll do is set it up in wicketstuff. That way others can contribute/maintain it too. I've got permission already, so I can put it up there sometime this evening. Do you have a location already for the

Re: Wicket and JEE6

2010-04-11 Thread Erik Brakkee
Just have a look at https://wamblee.org/svn/public/wicket-cdi The main thing I did was to make the injection and caching stuff completely independent of wicket and I made some arrangements to still allow unit tests where you can inject different things from the defaults. In particular, I think

Re: Wicket and JEE6

2010-04-12 Thread Erik Brakkee
On Mon, Apr 12, 2010 at 12:12 AM, James Carman jcar...@carmanconsulting.com wrote: I would imagine that most implementations would cache their injectors (it's part of the BeanT) I was triggered by the remark in the WeldCOmponentInstantiationListener which says 'TODO Cache the NonContextual'

what happened to setModel()?...

2010-07-22 Thread Erik Brakkee
HI all, I have a detachable model that I want to set as the model of a page so that it is properly detached. There used to be setModel(). But how should I do this now? I cannot use the superclass constructor because the detachable model can only be computed after construction of the page

Re: what happened to setModel()?...

2010-07-23 Thread Erik Brakkee
On Fri, Jul 23, 2010 at 12:38 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: setdefaultmodel() -igor Already tried it, ignoring the scary javadocs, and it works!

Correct way to disable browser caching...

2010-07-23 Thread Erik Brakkee
Hi, I would like to disable browser caching of certain pages. What is the simplest way to to do this? Right now I am removing the page from the pagemap after form submit, but the browser still goes back and only resubmission is prevented. Using the HTML expire tag is an option but it is

Re: Correct way to disable browser caching...

2010-07-23 Thread Erik Brakkee
Solved it already. Just have to override setHeaders() in my page: aResponse.setHeader(Pragma, no-cache); aResponse.setHeader(Cache-Control, no-cache, max-age=0, must-revalidate, no-store); On Fri, Jul 23, 2010 at 1:39 PM, Erik Brakkee erik.brak...@gmail.comwrote

how to make sure text is preselected in a form?

2010-07-23 Thread Erik Brakkee
Hi, I want to know how to make sure that text is preselected on a form. I know there was a way but I cannot find it anymore. Cheers Erik

colocating wicket with servlets...

2010-07-26 Thread Erik Brakkee
I would like to colocate a wicket application with a servlet. What I want is for the servlet to have access to the wicket session. Looking at the code I see that Session.get() uses thread-specific storage, so I want the wicket filter to intercept all requests. Next, I want to make sure that

Re: colocating wicket with servlets...

2010-07-26 Thread Erik Brakkee
On Mon, Jul 26, 2010 at 9:15 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: see WicketSessionFilter -igor Indeed, looking at the source code of WicketFilter, it does not seem to set the session for the current thread when one of the ignored paths is used.

Expiring pages in form submit and onAfterRender...

2010-07-26 Thread Erik Brakkee
Hi, I am experimenting a bit with page expiry. One solution that works is to remove the page from the pagemap in the submit of a form. However, removing the page from the pagemap in the onAfterRender() of a page does not seem to work. In fact, I see the same page id and version being rendered

Re: Expiring pages in form submit and onAfterRender...

2010-07-26 Thread Erik Brakkee
Made some progress. Now I am removing the page from the page map in the onDetach() and now expiry is really successful. Even so successful that the form submit fails because the page has expired. This is of course logical because the page object is still needed to process the form submit and now I

Re: Expiring pages in form submit and onAfterRender...

2010-07-27 Thread Erik Brakkee
I have indeed seen how to set the default expiry page in the Application class and that might come in handy. Will have a look too at the StatelessForm. Anyway, I have a working solution now with the pagemap trick. However, perhaps I need to do even more, because the flow isList of items -

Re: Expiring pages in form submit and onAfterRender...

2010-07-27 Thread Erik Brakkee
Thinking about it some more. Perhaps the best solution is to simply use a detachable model for the entity in the view page and then send the user to an error page when the entry is no longer there. I could of course also use a detachable model for the entity on the edit page because in this page

Re: Wicket and JEE6

2010-07-29 Thread Erik Brakkee
I have done a lot of experimentation at the moment and I am using CDI dependency injection now for a simple wicket project. It is based on the code at utils.wamblee.org (wicket/inject). The issue I am running into is the following. I am creating a detachable entity object which is simply a

Re: Wicket and JEE6

2010-07-29 Thread Erik Brakkee
On Thu, Jul 29, 2010 at 9:54 PM, Erik Brakkee erik.brak...@gmail.comwrote: Is there also a callback in wicket to listen for component serialization and deserialization? Googling for this it also seems possible to use an aspectj pointcut to do injection at deserialization.

Re: Wicket and JEE6

2010-07-29 Thread Erik Brakkee
On Thu, Jul 29, 2010 at 10:18 PM, James Carman ja...@carmanconsulting.comwrote: The problem with using the AspectJ-injected references occurs when you pass your reference to another class (such as a model, for instance). That class may not be instrumented via AspectJ to handle the

Re: Wicket and JEE6

2010-07-30 Thread Erik Brakkee
I have found an elegant solution to the serialization problem. Basically, in the ComponentInstantiationListener that perform injection, I am also attaching a new InjectionBehavior. The injection behavior has a private transient boolean field indicating whether injections are up to date. Upon

Re: Wicket and JEE6

2010-07-31 Thread Erik Brakkee
It appears that I ran into an existing Glassfish V3 issue. The same issue occurs with passivation of regular EJBs that have an entitymanager injected. See https://glassfish.dev.java.net/issues/show_bug.cgi?id=11356

Disabling serialization in wicket tester....

2010-07-31 Thread Erik Brakkee
Hi, I would like very much to disable serialization in wicket tester. I am using pages with mockito mocks that are not serializable (and why should they in a unit test). I am using workarounds now. Is there an easy way in wicket tester to disable the serializations that occur? Cheers Erik

Re: Disabling serialization in wicket tester....

2010-07-31 Thread Erik Brakkee
That my tests will not be equivalent is no big problem. In this case I am really unit testing the pages while mocking the backend. That allows me to also test anomalous behavior of the backend. In addition, I am also doing unit integration testing with rendering wicket pages with an actual JPA

Re: Disabling serialization in wicket tester....

2010-08-01 Thread Erik Brakkee
On Sun, Aug 1, 2010 at 5:11 AM, Kent Tong k...@cpttm.org.mo wrote I would like very much to disable serialization in wicket tester. I am using pages with mockito mocks that are not serializable (and why should they in a unit test). I am using workarounds now. You can take a look at

Custom AJAX component...

2010-08-14 Thread Erik Brakkee
Hi, I would like to write an component that will retrieve page-specific information using AJAX from the javascript running in the browser and interpret it itself instead of having wicket rendering the content. This approach is slightly different from the usual behavior as in those cases a

Re: Custom AJAX component...

2010-08-15 Thread Erik Brakkee
-plugins/jqgrid/src/main/java/com/wiquery/plugins/jqgrid/component/Grid.java 2- http://code.google.com/p/wiquery-plugins/source/browse/trunk/wiquery-plugins/jqgrid/src/main/java/com/wiquery/plugins/jqgrid/component/DocumentResourceListener.java On Sat, Aug 14, 2010 at 10:59 PM, Erik Brakkee

Re: Custom AJAX component...

2010-08-16 Thread Erik Brakkee
I have seen that wiquery for instance takes another approach in for instance their AutoCompleteBehavior. In that class they override respond() and get the response from the requestcycle and start writing to it, like this: @Override protected void respond(AjaxRequestTarget target) {

Re: Custom AJAX component...

2010-08-16 Thread Erik Brakkee
I have been looking around a bit more and it seems like Wicket in Action provides a solution on p.260 (the book keeps on growing on me). It looks like the idea is to extend AbstractAjaxBehavior and use RequestCycle.get().setRequestTarget(new StringRequestTarget(myString)); or more generically

Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
On Tue, Aug 17, 2010 at 7:02 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: In case of wiQuery, many behaviors wicket AJAX is used (not jquery AJAX) so it seem natural to use AbstractDefaultAjaxBehavior. In other cases probably you are right and it is over killing. Is that what you

Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
Thanks to wicket's clean code I am a bit further now. It looks like it is possible to add custom javascript to be executed just before and after rendering the components. This can be done using AjaxRequestTarget.append/prependJavascript(). So in other words, using this method it is possible to

Re: Custom AJAX component...

2010-08-17 Thread Erik Brakkee
I have found this page https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html which talks about wicketAjaxGet() and wicketAjaxPost(), but again no mention of how to access the body that is sent using wicketAjaxPost(). Only request parameters are discussed. Is accessing the body

Re: Custom AJAX component...

2010-08-18 Thread Erik Brakkee
at 10:07 PM, Erik Brakkee erik.brak...@gmail.com wrote: Thanks to wicket's clean code I am a bit further now. It looks like it is possible to add custom javascript to be executed just before and after rendering the components. This can be done using AjaxRequestTarget.append/prependJavascript

Re: Custom AJAX component...

2010-08-18 Thread Erik Brakkee
I have been looking at the example from jqgrid and as far as I can understand the resource listener is used to stream back the XML content as CDATA from the server to the browser. However, I cannot see how it would be possible to stream back XML from the browser to the server. One way I can