Re: support for L10N in templates
Hi, A template is a resource with placeholders. You need to interpolate its content before serving it to the client. In the example: response.renderJavascriptReference(new ResourceReference(MyPage.class, my.js, getLocale(), getStyle())); locale and style are used to load the most specific resource, e.g. my_en_GB_green.js, where 'green' is a style. Neither locale nor style are used to manipulate the content of that resource. To do what you need : MapString, String vars = new HashMapString, String() { @Override public String get(String resourceKey) { return MyComponent.this.getString(resourceKey); // or any other variant of this method (overload) } } interpolatedTextTemplate = textTemplate.interpolate(vars); response.renderJavaScript(interpolatedTextTemplate) On Mon, Mar 19, 2012 at 4:15 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Yeah I threw that out there in case it also applied to templates. I don't know anything about them in Wicket... On 18/03/2012 8:19 PM, infiniter wrote: Oh no. What I need is to be able to support something like the following, but for TEMPLATES, 'cause I want to localize them: public void renderHead(IHeaderResponse response) { response.renderJavascriptReference(new ResourceReference( MyPage.class, my.js, getLocale(), getStyle())); } anyone? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/support-for-L10N-in-templates-tp4479741p4483475.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: converter
Hi, Take a look at the sources of https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/mootools-meiomask-parent/mootools-meiomask This project integrates input mask implementation (MeioMask) with Wicket. Use it as inspiration. On Mon, Mar 19, 2012 at 12:04 AM, neo skorpio...@centrum.cz wrote: Hello I am new in wicket , i have number in textfield in format -x(five digits) but if i input number like 22 , 222 it can by convert with padding zero like 00022,00222 how can do it?thank you very much -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/converter-tp4483142p4483142.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 error : cannot find component id
Hi, On Sun, Mar 18, 2012 at 2:41 PM, kshitiz k.agarw...@gmail.com wrote: Hi, Thank you for ur reply. I have added the form by writing *add(registerForm);* in the* constructor*. But I have just resolved by problem by replacing *wicket:id* in html page with *wickeT:id* Do you say that wicket:id didn't work, but wickeT:id works ?! The only way this to behave like this is that you have setup custom Wicket namespace, e.g. html xmlns:wickeT=... or set MarkupParser.WICKET=wickeT in .java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-error-cannot-find-component-id-tp4481835p4482073.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problem with gif Indicator after call of wicketAjaxGet
Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LocaleFirstMapper in 1.5 and statefull home page
Hi, I just touched CustomHomeMapper in Wicket 6.0 to support what you need. I think this way it is more usable in real life. See http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=cabc1bee6a5e3e43e58c9f4c7f8b5cda401c558a The new code of this class at: http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob;f=wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/CustomHomeMapper.java Have fun! On Sun, Mar 18, 2012 at 7:55 PM, Girts Ziemelis girts.zieme...@gmail.com wrote: I am doing the conversion from 1.4 to 1.5.5 and at the same time trying to start using LocaleFirstMapper and CustomHomeMapper from wicket examples. Everything works nicely except, I have a statefull home page and seems CustomHomeMapper does not handle this case. Page renders fine, but Ajax requests do not work. I think the reason is, because CustomHomeMapper does not add the version number to the link, so the link stays /en, instead of /en?0 like in case, if CustomHomeMapper is not used (home page link is /?0). Any easy solutions to fix this, before I start debugging wicket 1.5 request handling, trying to understand how things work? BTW, nice work on 1.5 wicket team. Thanks :) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with gif Indicator after call of wicketAjaxGet
Hi, On Mon, Mar 19, 2012 at 10:17 AM, Reiche, Andreas andreas.rei...@lgln.niedersachsen.de wrote: Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. What do you mean by first frame ? It shows the gif but it doesn't animate ? Wicket just uses CSS display property to show/hide the gif. It doesn't do anything related to the animation itself. There was a bug in Wicket which is fixed in 1.5.5 and 6.0 but it was that the gif didn't disappear in some conditions. So it doesn't sound like your problem. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + JPA lazy-loading
Hi, 2012/3/18 Bálint Kriván bal...@krivan.hu: I don't want to serialize them but wicket does (I have a list of objects which I pass to a ListView). IIRC, If I use LDM I can make wicket to serialize only an ID and when it is readed back I can reach the backend to get the correct object for that ID. If I would switch to this probably it would be more query than now, because even the parent objects should be retrieved from the DB one-by-one. It would be enough for me if I could make wicket not to try to serialize these objects (these are retrieved in the constructor so I don't see the need to save them on the first place) Wicket serializes the page and all inside it. If you keep refs to these objects from your page then Java Serialization will try to serialize them. You can keep a set of all ids and load them (via LDM) with just one SQL query at any time they are needed. On Sun, Mar 18, 2012 at 1:56 PM, James Carman ja...@carmanconsulting.comwrote: Use a LoadableDetachableModel. You shouldn't be serializing persistent objects (unless of course you're in the middle of editing them or something). On Sun, Mar 18, 2012 at 8:36 AM, Bálint Kriván bal...@krivan.hu wrote: Hey! It seems that when wicket is trying to serialize the persistent objects (probably to session) the lazy loading kicks in and it retrieves the whole graph. Not sure if wicket is using the default java serialization or a special one, but is there anybody else who is/were experiencing the same? By any chance would you have any suggestion how can I overcome this? It would be a great solution if an association is persisted when it's loaded, but if it isn't then do not lazy load it, just leave it null. Thanks! Regards, Bálint Kriván - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Üdv, Kriván Bálint -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: AjaxFormComponentUpdatingBehavior after validation problem
Hi Gytis, If you add AjaxFormSubmitBehaviour to your checkbox it should work exactly as Submit button. Best regards, Michal Wegrzyn -Original Message- From: Gytis [mailto:lietuvis...@mail.ru] Sent: Sunday, March 18, 2012 8:02 To: users@wicket.apache.org Subject: RE: AjaxFormComponentUpdatingBehavior after validation problem Hello, Michal, Well, I`ve tried to make an AjaxFormSubmitBehaviour, but this doesn`t help, in fact it is updating component, when you click Submit button, and I need it updated, when clicking checkBox. I`ve tried to add both Ajax behaviours, still doesn`t work. Wanted to add some details on my code, for form submitting I use AjaxButton... -- View this message in context: http://apache- wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-after- validation-problem-tp4477705p4481742.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: What real life scenario calls for page ID?
Hi, So far I didn't hear a good explanation why the page id causes you troubles. Most of you are saying it is ugly. In my previous company we asked some of our users about wicket:interface=0:1:Something:else:9 and most of them said I don't care, I haven't noticed it, etc... And we did this just because one of the technical managers was bothered by it. So it seems only developers really care what is in the the address bar (and bots but this will covered later). So it is one of those: 1. stateful and ugly 2. stateful, pretty and broken 3. stateless and pretty Case 1 is what Igor explained. Case 2 is what Chris, pointbreak and Paolo seems to use in production. See Igor's explanation why it is broken and why your users may loose their state. So don't keep the shopping card (or any other state) in the components! Case 3 is what the bots and not logged in users should see. Bots don't use sessions so don't let them go in the stateful area of your app. They should see the list of products, not the list in their shopping card, right ? @Chris: about your example with previous page and previous state of the shopping card: if you use dynamic models and page caching is disabled then the page will show the components from the previous version but their content will be the last available one. I.e. the shopping card will show what it has to show. On Mon, Mar 19, 2012 at 5:00 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: On Sun, Mar 18, 2012 at 5:27 PM, Chris Colman chr...@stepaheadsoftware.com wrote: I've been thinking about the new 1.5 page ID/versioning feature (which we disabled as soon as we discovered it) and wondering if there is actually a real world scenario for stateful pages that actually requires this functionality. I understand the purpose is so that the browser's 'Back' function can work properly (and maybe efficiently) but, in all the scenarios we have at least, proper would be to re-render and not pull the page from the cache. For example, an online store with the current shopping cart displayed in the right hand column: Browser is showing page for product A, no products in shopping cart shown in right column. User goes to page for product B, adds product B to shopping cart. Hit's back button. Now wouldn't the 'page versioning/id' feature now show the cached page for product A with a shopping cart that is still empty even though the user just added product B? Or would it realize that the shopping cart panel's model has changed and update it to reflect the newly added item? In this scenario showing an empty shopping cart is a very definite incorrect behavior that will freak out the user who believes that they have added a product B (which they have) but it is not shown in the shopping cart. 1.4 functionality (without page ID) worked fine. We never had a single complaint about back button not displaying the correct result. i think there is some confusion here. wicket 1.4 had page ids. it also had page versions. in 1.5 we simply merged page id and page version into the same variable - page id. this made things much simpler and also allowed some usecases that were not possible when the two were separate. you dont have to go very far to come up with an example where page id is useful. 1. suppose you have a page with panel A that has a link 2. user hits a link on the page that swaps panel A for panel B 3. user presses the back button 4. user clicks the link on panel A now if you turn off page id and therefore page versioning it goes like this 1. wicket creates page and assigns it id 1 2. page id 1 now has panel B instead of panel A 3. page with id 1 is rerendered 4. wicket loads page with id 1. user gets an error because it cannot find the link component the user clicked since the page has panel B instead of panel A now same with page versioning enabled and page caching disabled 1. wicket creates page and assigns it id 1 2. wicket clones page with id 1 into a new instance with id 2. id 1 has panel A and id 2 has panel B 3. wicket renders page with id 1 4. wicket loads page with id 1, the link is executed now same with page versioning enabled and page caching enabled 1. wicket creates page and assigns it id 1 2. wicket clones page with id 1 into a new instance with id 2. id 1 has panel A and id 2 has panel B 3. browser renders page from cache 4. wicket loads page with id 1 (page id is encoded in link's url), the link is executed in wicket 1.4 page id would not change but step 2 would increment the page's version. there would still be two instances of the page: id1 version 1, id1 version 2 now you may be referring to the fact that unlike in 1.4 in 1.5 we immediately redirect to a versioned url when a bookmarkable url is accessed in 1.4 when user hits /mount they would stay on that url in 1.5 when user hits /mount they are redirected to /mount?2 where 2 is the next available page id in 1.4 a lot of users complained
Re: What real life scenario calls for page ID?
On 2012-03-19 02:46, Paolo wrote: I support you! I implemented class NoVersionMount thanks to pointbreak in my MainApplication. And It will be my template for future app. But to do it, I needed to understood the problem, check on google, read a lot of pages, without found a solution, so post the question here, and after 3 post, got a right reply for me. Why an wicket user have to do all this Why not, wicket use the NoVersionMount as default Mount? Like in wicket 1.4. And implement an VersionMount as an alternative for developer? I actually like this change so far. I can finally tell, that my page is stetefull just by looking at the link and ask myself question - if I really care so much about the clean link for this page, may be it should be stateless in a first place? And why is ?0 such a big problem? It does not cause problems sending links. Is there any real proof of google indexing problems so far? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Problem with gif Indicator after call of wicketAjaxGet
Yep, The gif is shown, but not animated. For clarification (think i have to explain a little bit more): My gif is added as a normal Image. I have an AjaxDownloadBehaviour which is subclassed from AbstractAjaxBehaviour. Basicly it's the one shown here https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html This behaviour is added to the page. Then the AjaxLink is added to the page. In the onClick() i set the image visibility to true and add the component to the Target. Additionally i call the javaScript function whith the callBackUrl of an AbstractDefaultAjaxBehavior which is added To the Link. So the flow is as follows: AjaxLink is clicked: indicatorImage is set to visible. JavaScript function is called with callBack url of behaviour. JavsScript function put some parameters to URL and calls wicketAjaxGet. In respond method of AbstractDefaultAjaxBehavior: PDF is generated as byteArray. indicatorImage visibility is set to false. Download#initiate() is called with requestTarget and there window.location.href is set like in provided link. All this works very well despite the fact that after the first attempt the gif is not animated anymore. Btw, i used the Ajax download in another page of my app, where i don't have to call a javaScript function, as all parameters are known on server side, and there the problem does not exist. This leads me to the assumption that it has something to do with the wicketAjaxGet call. Greets Andreas -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mgrigo...@apache.org] Gesendet: Montag, 19. März 2012 09:39 An: users@wicket.apache.org Betreff: Re: Problem with gif Indicator after call of wicketAjaxGet Hi, On Mon, Mar 19, 2012 at 10:17 AM, Reiche, Andreas andreas.rei...@lgln.niedersachsen.de wrote: Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. What do you mean by first frame ? It shows the gif but it doesn't animate ? Wicket just uses CSS display property to show/hide the gif. It doesn't do anything related to the animation itself. There was a bug in Wicket which is fixed in 1.5.5 and 6.0 but it was that the gif didn't disappear in some conditions. So it doesn't sound like your problem. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CustomRequestCycle and post parameters
Hi Martin, I've removed the getRequestCycleListeners().add(new AbstractRequestCycleListener() - method in the application class and tried to print some post-parameters in my Homepage.class: System.out.println(RequestCycle.get().getRequest().getPostParameters().getParameterValue: + RequestCycle.get().getRequest().getPostParameters().getParameterValue(user)); But it's always null. I've checked it with Firebug and also with Wireshark: the parameters are there: Content-Type: application/x-www-form-urlencoded Content-Length: 84 token=7fb4ddbf9a9d4309e2a739a2ce51af7b3ca01602cc7bd28fe351f80d4986b3b0user=willy - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: Problem with gif Indicator after call of wicketAjaxGet
Hello, Andreas. I've got sometime such behaviour with gif no animated, but it seems to be IE bug - never I see that bug in Opera or FF, only IE (IE8 to be exact). On 19.03.2012 16:01, Reiche, Andreas wrote: Yep, The gif is shown, but not animated. For clarification (think i have to explain a little bit more): My gif is added as a normal Image. I have an AjaxDownloadBehaviour which is subclassed from AbstractAjaxBehaviour. Basicly it's the one shown here https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html This behaviour is added to the page. Then the AjaxLink is added to the page. In the onClick() i set the image visibility to true and add the component to the Target. Additionally i call the javaScript function whith the callBackUrl of an AbstractDefaultAjaxBehavior which is added To the Link. So the flow is as follows: AjaxLink is clicked: indicatorImage is set to visible. JavaScript function is called with callBack url of behaviour. JavsScript function put some parameters to URL and calls wicketAjaxGet. In respond method of AbstractDefaultAjaxBehavior: PDF is generated as byteArray. indicatorImage visibility is set to false. Download#initiate() is called with requestTarget and there window.location.href is set like in provided link. All this works very well despite the fact that after the first attempt the gif is not animated anymore. Btw, i used the Ajax download in another page of my app, where i don't have to call a javaScript function, as all parameters are known on server side, and there the problem does not exist. This leads me to the assumption that it has something to do with the wicketAjaxGet call. Greets Andreas -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mgrigo...@apache.org] Gesendet: Montag, 19. März 2012 09:39 An: users@wicket.apache.org Betreff: Re: Problem with gif Indicator after call of wicketAjaxGet Hi, On Mon, Mar 19, 2012 at 10:17 AM, Reiche, Andreas andreas.rei...@lgln.niedersachsen.de wrote: Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. What do you mean by first frame ? It shows the gif but it doesn't animate ? Wicket just uses CSS display property to show/hide the gif. It doesn't do anything related to the animation itself. There was a bug in Wicket which is fixed in 1.5.5 and 6.0 but it was that the gif didn't disappear in some conditions. So it doesn't sound like your problem. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CustomRequestCycle and post parameters
Hi Sven, This is strange. Can you attach a mini app (a quickstart) that demonstrates the problem ? On Mon, Mar 19, 2012 at 12:16 PM, Sven Hohage sven.hoh...@googlemail.com wrote: Hi Martin, I've removed the getRequestCycleListeners().add(new AbstractRequestCycleListener() - method in the application class and tried to print some post-parameters in my Homepage.class: System.out.println(RequestCycle.get().getRequest().getPostParameters().getParameterValue: + RequestCycle.get().getRequest().getPostParameters().getParameterValue(user)); But it's always null. I've checked it with Firebug and also with Wireshark: the parameters are there: Content-Type: application/x-www-form-urlencoded Content-Length: 84 token=7fb4ddbf9a9d4309e2a739a2ce51af7b3ca01602cc7bd28fe351f80d4986b3b0user=willy - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Problem with gif Indicator after call of wicketAjaxGet
Puh, already tested in different Browsers. Strange behaviour. FF 11 - Both animations are not working after click IE 8 - My indicatingImage works. The mentioned gif in the OpenLayersMap didn't work. Chrome 10.0.. (Portable Version) - both animations work. Seems like it's a browser issue. Andreas -Ursprüngliche Nachricht- Von: Dmitriy V. Ivanov [mailto:ivan...@prognoz.ru] Gesendet: Montag, 19. März 2012 11:22 An: users@wicket.apache.org Betreff: Re: AW: Problem with gif Indicator after call of wicketAjaxGet Hello, Andreas. I've got sometime such behaviour with gif no animated, but it seems to be IE bug - never I see that bug in Opera or FF, only IE (IE8 to be exact). On 19.03.2012 16:01, Reiche, Andreas wrote: Yep, The gif is shown, but not animated. For clarification (think i have to explain a little bit more): My gif is added as a normal Image. I have an AjaxDownloadBehaviour which is subclassed from AbstractAjaxBehaviour. Basicly it's the one shown here https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html This behaviour is added to the page. Then the AjaxLink is added to the page. In the onClick() i set the image visibility to true and add the component to the Target. Additionally i call the javaScript function whith the callBackUrl of an AbstractDefaultAjaxBehavior which is added To the Link. So the flow is as follows: AjaxLink is clicked: indicatorImage is set to visible. JavaScript function is called with callBack url of behaviour. JavsScript function put some parameters to URL and calls wicketAjaxGet. In respond method of AbstractDefaultAjaxBehavior: PDF is generated as byteArray. indicatorImage visibility is set to false. Download#initiate() is called with requestTarget and there window.location.href is set like in provided link. All this works very well despite the fact that after the first attempt the gif is not animated anymore. Btw, i used the Ajax download in another page of my app, where i don't have to call a javaScript function, as all parameters are known on server side, and there the problem does not exist. This leads me to the assumption that it has something to do with the wicketAjaxGet call. Greets Andreas -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mgrigo...@apache.org] Gesendet: Montag, 19. März 2012 09:39 An: users@wicket.apache.org Betreff: Re: Problem with gif Indicator after call of wicketAjaxGet Hi, On Mon, Mar 19, 2012 at 10:17 AM, Reiche, Andreas andreas.rei...@lgln.niedersachsen.de wrote: Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. What do you mean by first frame ? It shows the gif but it doesn't animate ? Wicket just uses CSS display property to show/hide the gif. It doesn't do anything related to the animation itself. There was a bug in Wicket which is fixed in 1.5.5 and 6.0 but it was that the gif didn't disappear in some conditions. So it doesn't sound like your problem. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ModalWindow and Serialization
Hi All, I have a lot of work with ModalWindows in my project and want to use objects which created on the base page and are changed in the modal windows. I found that ModalWindow was changed in wicket 1.5 and want to ask about solution. Please see short example: // Base Page public class MyPage extends WebPage { public MyPage() { final ModalWindow window = new ModalWindow(window); add(new AjaxLinkVoid(link) { @Override public void onClick(AjaxRequestTarget target) { final CustomObject object = new CustomObject(); window.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { return new MyModalWindow(object, window); } }); window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget target) { if (object.isValue()) { // This code is never executed {1} in wicket 1.5. But it worked in wicket 1.4 } } }); } }); } } // Modal Window public class MyModalWindow extends WebPage { public MyModalWindow(final CustomObject object, final ModalWindow window) { add(new AjaxLinkVoid(link) { @Override public void onClick(AjaxRequestTarget target) { object.setValue(true); window.close(target); } }); } } As I understand - the reason of this behavior is serialization of pages. I also know one solution - use PageReference(same with example here - http://www.wicket-library.com/wicket-examples/ajax/modal-window?0). But I want to ask - is there another solution? Use PageReference is not so flexible. For example I have a lot of modal windows which are opened from the panel. In this case I have to search my panel on the page. Moreover I can use one panel from different pages. Other problem - I don't want to use global variables on the Base Page - I want(ant in several cases I should) use local variables. Can anyone give advice - how to simplify usage of modal windows in such cases? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484547.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LocaleFirstMapper in 1.5 and statefull home page
Works great! Thank you very much ! :) On 2012-03-19 10:33, Martin Grigorov wrote: Hi, I just touched CustomHomeMapper in Wicket 6.0 to support what you need. I think this way it is more usable in real life. See http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=cabc1bee6a5e3e43e58c9f4c7f8b5cda401c558a The new code of this class at: http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob;f=wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/CustomHomeMapper.java Have fun! On Sun, Mar 18, 2012 at 7:55 PM, Girts Ziemelis girts.zieme...@gmail.com wrote: I am doing the conversion from 1.4 to 1.5.5 and at the same time trying to start using LocaleFirstMapper and CustomHomeMapper from wicket examples. Everything works nicely except, I have a statefull home page and seems CustomHomeMapper does not handle this case. Page renders fine, but Ajax requests do not work. I think the reason is, because CustomHomeMapper does not add the version number to the link, so the link stays /en, instead of /en?0 like in case, if CustomHomeMapper is not used (home page link is /?0). Any easy solutions to fix this, before I start debugging wicket 1.5 request handling, trying to understand how things work? BTW, nice work on 1.5 wicket team. Thanks :) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
Hi, On Mon, Mar 19, 2012 at 2:16 PM, vov vov...@mail.ru wrote: Hi All, I have a lot of work with ModalWindows in my project and want to use objects which created on the base page and are changed in the modal windows. I found that ModalWindow was changed in wicket 1.5 and want to ask about solution. Please see short example: // Base Page public class MyPage extends WebPage { public MyPage() { final ModalWindow window = new ModalWindow(window); add(new AjaxLinkVoid(link) { @Override public void onClick(AjaxRequestTarget target) { final CustomObject object = new CustomObject(); window.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { return new MyModalWindow(object, window); } }); window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget target) { if (object.isValue()) { // This code is never executed {1} in wicket 1.5. But it worked in wicket 1.4 } } }); } }); } } // Modal Window public class MyModalWindow extends WebPage { public MyModalWindow(final CustomObject object, final ModalWindow window) { add(new AjaxLinkVoid(link) { @Override public void onClick(AjaxRequestTarget target) { object.setValue(true); window.close(target); } }); } } As I understand - the reason of this behavior is serialization of pages. I also know one solution - use PageReference(same with example here - http://www.wicket-library.com/wicket-examples/ajax/modal-window?0). But I want to ask - is there another solution? Use PageReference is not so flexible. For example I have a lot of modal windows which are opened from the panel. In this case I have to search my panel on the page. Moreover I can use one panel from different pages. Other problem - I don't want to use global variables on the Base Page - I want(ant in several cases I should) use local variables. Can anyone give advice - how to simplify usage of modal windows in such cases? Not sure whether this goes against your rule to keep it local (because it is not really local when you pass a final object to an inner class) but I think the safest way is to keep such objects in the session. You can share objects (or even better models) between components in a page, but as you already read about it this is not the case when you share between pages. So - solution 1 - put the object in the session - solution 2 - use ModalWindow with a Panel, instead of a page -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484547.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: URL in css problem
Hi, See http://mail-archives.apache.org/mod_mbox/wicket-users/201104.mbox/%3cop.vujch70qn8m...@vfgrl10a-cxyrg.vf-gr.internal.vodafone.com%3E On Thu, Mar 15, 2012 at 9:20 PM, grazia grazia.russolass...@gmail.com wrote: I have a mouseovermenu.css file that includes references to images as below: .mouseovermenuitem .item_itembody .item_itemdetail .icon_page { background:transparent URL(../images/mouseovermenu/page.gif) no-repeat top left; } I have added the mouseovermenu.css as a shared resource in myApplication.init as follows: getSharedResources().add(cssmouseover, new ContextRelativeResource(/css/mouseovermenu.css)); Then, I have included that resource in a page header component as below: add(new Behavior() { @Override public void renderHead(Component component, IHeaderResponse response) { response.renderCSSReference(new SharedResourceReference(cssmouseover)); } }); But wicket 1.5 is expecting to find wicket/resource/images/mouseovermenu/page.gif and it ovisouly does not exist, so I get the error: Mar 15, 2012 11:43:39 AM org.apache.wicket.util.lang.WicketObjects resolveClass WARNING: Could not resolve class [images] java.lang.ClassNotFoundException: images at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1526) () When the page is rendered, then I see in its source that the .css file is link rel=stylesheet type=text/css href=wicket/resource/org.apache.wicket.Application/cssmouseover-ver-CDB3EE537C4A56387DDB56323FF91CB8 / Where is the href coming from ? What do all its parts mean ? I am rather confused about how to manage resources that are not in classpath. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/URL-in-css-problem-tp4476092p4476092.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
Thanks for your answer, of course session is not so simple as local variable - but it one of the solution Maybe in next releases of wicket someone will come up with a simpler solution -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484708.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
On Mon, Mar 19, 2012 at 3:03 PM, vov vov...@mail.ru wrote: Thanks for your answer, of course session is not so simple as local variable - but it one of the solution as simple as getSession().setAttribute(key, value) - getSession().getAttribute(key) Maybe in next releases of wicket someone will come up with a simpler solution the solution is already there - ModalWindow.setContent(aPanel) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484708.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
java.util.Date cannot be cast to java.sql.Date
I have an application in Wicket 1.4, where i am using JPA. I declared an entity (Customer) with property *dob* of type *java.sql.Date*. Now i want to migrate that application in Wicket 1.5, When I submit the registration form of the customer I get the exception: *java.util.Date cannot be cast to java.sql.Date* Kindly Help Thanks Alok Pathak -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-util-Date-cannot-be-cast-to-java-sql-Date-tp4484703p4484703.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
1) to as simple asgetSession().getAttribute(key) - getSession().getAttribute(key) It is not in the topic but: What it different between your proposal and getApplication().getSessionStore().setAttribute(requst, key, value); Maybe it's stupid question - how to remove object from session if you use getSession().getAttribute(key) ? 2) Of course - ModalWindow.setContent(aPanel) will solve the problem. But in case if I have several modal windows on the one page - it's no good for performance. But I'm not sure about setting of the content on the fly -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484792.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
On Mon, Mar 19, 2012 at 3:31 PM, vov vov...@mail.ru wrote: 1) to as simple asgetSession().getAttribute(key) - getSession().getAttribute(key) It is not in the topic but: What it different between your proposal and getApplication().getSessionStore().setAttribute(requst, key, value); mine calls ISessionStore#setAttribute() if the session is bound. If it is temporary then it keeps the attribute in a temporary map. Maybe it's stupid question - how to remove object from session if you use getSession().getAttribute(key) ? org.apache.wicket.Session#removeAttribute but it is protected ... You will need to override it to make it public. there is this comment in Wicket code : // TODO WICKET-NG made public for page manager, used to be protected, see if there is a way to // revert public final Serializable getAttribute(final String name) so set and get are public but remove is not ... We will improve this for Wicket 6! 2) Of course - ModalWindow.setContent(aPanel) will solve the problem. But in case if I have several modal windows on the one page - it's no good for performance. But I'm not sure about setting of the content on the fly This will work. We do this in our app. There is one modal window which content is dynamically loaded depending on the clicked link. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484792.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: AW: Problem with gif Indicator after call of wicketAjaxGet
Andreas, I have found this link about the same problem: http://stackoverflow.com/questions/780560/animated-gif-in-ie-stopping Maybe you will find this useful for you. On 19.03.2012 18:07, Reiche, Andreas wrote: Puh, already tested in different Browsers. Strange behaviour. FF 11 - Both animations are not working after click IE 8 - My indicatingImage works. The mentioned gif in the OpenLayersMap didn't work. Chrome 10.0.. (Portable Version) - both animations work. Seems like it's a browser issue. Andreas -Ursprüngliche Nachricht- Von: Dmitriy V. Ivanov [mailto:ivan...@prognoz.ru] Gesendet: Montag, 19. März 2012 11:22 An: users@wicket.apache.org Betreff: Re: AW: Problem with gif Indicator after call of wicketAjaxGet Hello, Andreas. I've got sometime such behaviour with gif no animated, but it seems to be IE bug - never I see that bug in Opera or FF, only IE (IE8 to be exact). On 19.03.2012 16:01, Reiche, Andreas wrote: Yep, The gif is shown, but not animated. For clarification (think i have to explain a little bit more): My gif is added as a normal Image. I have an AjaxDownloadBehaviour which is subclassed from AbstractAjaxBehaviour. Basicly it's the one shown here https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html This behaviour is added to the page. Then the AjaxLink is added to the page. In the onClick() i set the image visibility to true and add the component to the Target. Additionally i call the javaScript function whith the callBackUrl of an AbstractDefaultAjaxBehavior which is added To the Link. So the flow is as follows: AjaxLink is clicked: indicatorImage is set to visible. JavaScript function is called with callBack url of behaviour. JavsScript function put some parameters to URL and calls wicketAjaxGet. In respond method of AbstractDefaultAjaxBehavior: PDF is generated as byteArray. indicatorImage visibility is set to false. Download#initiate() is called with requestTarget and there window.location.href is set like in provided link. All this works very well despite the fact that after the first attempt the gif is not animated anymore. Btw, i used the Ajax download in another page of my app, where i don't have to call a javaScript function, as all parameters are known on server side, and there the problem does not exist. This leads me to the assumption that it has something to do with the wicketAjaxGet call. Greets Andreas -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mgrigo...@apache.org] Gesendet: Montag, 19. März 2012 09:39 An: users@wicket.apache.org Betreff: Re: Problem with gif Indicator after call of wicketAjaxGet Hi, On Mon, Mar 19, 2012 at 10:17 AM, Reiche, Andreas andreas.rei...@lgln.niedersachsen.de wrote: Hi, I have a problem with the rendering of animated gifs after a call to wicketAjaxGet. I have the following situation. In a webPage i have an AjaxLink which basicly returns an on-the-fly created pdf Document for download. As the generation needs some time i show an animated gif to the user to inform him that the server is still busy. The AjaxLink calls a javascript function with the callback URL of an AbstractDefaultAjaxBehavior. The javascript function puts some parameters to the callback URL and calls wicketAjaxGet. In the AbstractDefaultAjaxBehavior's respond method i take the URL Parameters and create the pdf.(Taken fro WIKI) This works fine for the first time. The gif Animation works and i get the PDF for download. But after that if i click the AjaxLink again the gif Animation is not animated anymore. It just shows the first frame of the animation. What do you mean by first frame ? It shows the gif but it doesn't animate ? Wicket just uses CSS display property to show/hide the gif. It doesn't do anything related to the animation itself. There was a bug in Wicket which is fixed in 1.5.5 and 6.0 but it was that the gif didn't disappear in some conditions. So it doesn't sound like your problem. The same for another animated gif in another component in the page (it's a OpenLayersMap added through WicketOpenLayers integration). It will only work after a complete reload of the page (which is not an option, because of the state of the openLayersMap). As i'm not a javaScript guru, can anybody advise were to look for that the gif is not animated anymore? Thanks Andreas Reiche - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow and Serialization
As I understand - the correct way is change usage PageCreator to setContent:) Thank you very much for all your answers!!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-Serialization-tp4484547p4484858.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Images, ajax requests and caching
Indeed, but I don't understand how that helps in my case. NonCachingImage takes the behavior of Image one step further by always adding an anticache parameter to images (i.e. for ajax and normal requests). Wicket currently has : Image - Cached for normal requests, never cached for ajax requests NonCachingImage - Never cached for ajax and normal requests What I want is a cachable image to avoid unnecessary client requests for thumbnails. Like I said, such a class is very easy to do, but maybe the current behavior of Wicket is not desirable. On 19/03/2012 1:25 AM, Igor Vaynberg wrote: we have a noncachingimage subclass... :) -igor On Sun, Mar 18, 2012 at 9:33 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I have image resources which fetch the proper thumbnail picture stored in a DB based on the image's file name. I used the file name instead of parameters to make sure client-side caching would work. By chance, I just discovered that the images are always reloaded on ajax requests. This is caused by Image#shouldAddAntiCacheParameter and Image#addAntiCacheParameter which always add an anticache parameter to image src URLs on ajax requests. In my case, the images are added to ajax requests as part of a table update containing lots of thumbnails so it's definitely counter-productive. I can see the need for anticaching for dynamically generated images which change per request, but should this be the default behavior? Of course, I can easily work around this issue by subclassing Image, but I wanted to bring this to attention. At the very least, I would suggest creating a subclass (CachingImage?) of Image in core which does not do anticaching for stateless resource references. Regards, Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Same Variable Shared Before/After Form Submit
I have a class variable which I need to read after the Form Submit. The problem is that a new class instance is created on each Form Submit, with all new variables. I can't make the var. static because I need it to re-create itself on opening the page from the GUI again. The only sharing should be before/after Form Submit. Is there a way to do this? thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Same-Variable-Shared-Before-After-Form-Submit-tp4484934p4484934.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Images, ajax requests and caching
Hi, The idea is if you add an image to an AjaxRequestTarget then Wicket assumes this image needs to be re-painted. This is the safer approach because otherwise the user will add it to the target and the image will not change. Then we have to explain the user that he has to do something more additionally. Maybe the only way to optimize even further is to add the anticache param only if static String url is used (in contrast to resource or resourcereference). But even in this case the style/locale/variation may be changed and the image should be updated again ... So the current approach is the most common - let the developer decide whether the image should be updated or not. Just override org.apache.wicket.markup.html.image.Image#shouldAddAntiCacheParameter On Mon, Mar 19, 2012 at 4:07 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Indeed, but I don't understand how that helps in my case. NonCachingImage takes the behavior of Image one step further by always adding an anticache parameter to images (i.e. for ajax and normal requests). Wicket currently has : Image - Cached for normal requests, never cached for ajax requests NonCachingImage - Never cached for ajax and normal requests What I want is a cachable image to avoid unnecessary client requests for thumbnails. Like I said, such a class is very easy to do, but maybe the current behavior of Wicket is not desirable. On 19/03/2012 1:25 AM, Igor Vaynberg wrote: we have a noncachingimage subclass... :) -igor On Sun, Mar 18, 2012 at 9:33 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I have image resources which fetch the proper thumbnail picture stored in a DB based on the image's file name. I used the file name instead of parameters to make sure client-side caching would work. By chance, I just discovered that the images are always reloaded on ajax requests. This is caused by Image#shouldAddAntiCacheParameter and Image#addAntiCacheParameter which always add an anticache parameter to image src URLs on ajax requests. In my case, the images are added to ajax requests as part of a table update containing lots of thumbnails so it's definitely counter-productive. I can see the need for anticaching for dynamically generated images which change per request, but should this be the default behavior? Of course, I can easily work around this issue by subclassing Image, but I wanted to bring this to attention. At the very least, I would suggest creating a subclass (CachingImage?) of Image in core which does not do anticaching for stateless resource references. Regards, Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.util.Date cannot be cast to java.sql.Date
Hi, Do you say that in 1.4 you didn't do any conversion between the two types and it just worked ? See Component#getConverter(Class) method. On Mon, Mar 19, 2012 at 3:02 PM, Alok Pathak alokpatha...@gmail.com wrote: I have an application in Wicket 1.4, where i am using JPA. I declared an entity (Customer) with property *dob* of type *java.sql.Date*. Now i want to migrate that application in Wicket 1.5, When I submit the registration form of the customer I get the exception: *java.util.Date cannot be cast to java.sql.Date* Kindly Help Thanks Alok Pathak -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-util-Date-cannot-be-cast-to-java-sql-Date-tp4484703p4484703.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same Variable Shared Before/After Form Submit
(To clarify why I'm doing this, I have a custom widget which I'm doing model-binding for. I need to replicate the field binding for the model manually, which happens for normal Wicket widgets automatically.) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Same-Variable-Shared-Before-After-Form-Submit-tp4484934p4484953.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.util.Date cannot be cast to java.sql.Date
Declare the dob field as: @Temporal(TemporalType.Date) private (java.util.)Date dob; Op 19-3-2012 14:02, schreef Alok Pathak: I have an application in Wicket 1.4, where i am using JPA. I declared an entity (Customer) with property *dob* of type *java.sql.Date*. Now i want to migrate that application in Wicket 1.5, When I submit the registration form of the customer I get the exception: *java.util.Date cannot be cast to java.sql.Date* Kindly Help Thanks Alok Pathak -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-util-Date-cannot-be-cast-to-java-sql-Date-tp4484703p4484703.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.util.Date cannot be cast to java.sql.Date
That is ok* Declare the dob field as: @Temporal(TemporalType.Date) private (java.util.)Date dob; * But why not this in wicket 1.4. I am pasting my code *Book.java ## import java.sql.Date; ... private Date publishDate; META-INF/persistence.xml persistence xmlns=http://java.sun.com/xml/ns/persistence; version=1.0 persistence-unit name=bookStorePersistence providerorg.eclipse.persistence.jpa.PersistenceProvider/provider classedu.shubit.eShop.bean.Book/class properties property name=eclipselink.platform.class.name value=org.eclipse.persistence.platform.database.SQLAnywherePlatform/ property name=eclipselink.jdbc.driver value=org.sqlite.JDBC/ property name=eclipselink.jdbc.url value=jdbc:sqlite:data/bookStoreDB/ property name=persistence.tools.weaving value=false/ property name=eclipselink.ddl-generation value=create-tables/ property name=eclipselink.ddl-generation.output-mode value=database/ /properties /persistence-unit /persistence BookUploadPage.java ### Book book=new Book(); ... frm=new Form(bookUploadForm,new CompoundPropertyModel(book)){ { add(txtDate=new TextField(publishDate)); } protected void onSubmit(){ BeansManager.insertBook(book)){ } } BeansManager.java # public static boolean insertBook(Book book) { JPA.em.getTransaction().begin(); JPA.em.persist(book); JPA.em.getTransaction().commit(); return true; } * -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/java-util-Date-cannot-be-cast-to-java-sql-Date-tp4484703p4485118.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same Variable Shared Before/After Form Submit
Hi, are you really sure you have to replicate field binding by hand? Have you considered to nest your widget model inside form model? Can you give further details about your problem? (To clarify why I'm doing this, I have a custom widget which I'm doing model-binding for. I need to replicate the field binding for the model manually, which happens for normal Wicket widgets automatically.) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Same-Variable-Shared-Before-After-Form-Submit-tp4484934p4484953.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same Variable Shared Before/After Form Submit
I have a custom HTML object which is an Adobe PDF-Form (FDF). This widget is displayed in the object tag. Adobe Forms have their own fields and buttons. I've succeeded in displaying this widget by subclassing the WebMarkupContainer and setting its properties, as I would for a Flash object, for instance, which is not provided by Wicket out of the box. The next problem for me is associating this custom widget with some kind of Model. I need to bind the fields in AdobeForms to a bean, such that when the form is submitted and refreshed, the FDF shows the saved form. This happens automatically for normal Wicket elements. Now I need to do this manually for this custom widget. How would I nest this custom model inside a form model? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Same-Variable-Shared-Before-After-Form-Submit-tp4484934p4485217.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can't get FormTester.submitLink to work (required testfield always missing)
Hi, Old post but, any solutions for this, using wicket tester? Thx -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-t-get-FormTester-submitLink-to-work-required-testfield-always-missing-tp1888944p4485338.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can't get FormTester.submitLink to work (required testfield always missing)
Hi, Create a quickstart app with Wicket 1.5 and attach it to Jira. On Mon, Mar 19, 2012 at 6:06 PM, Fabiosakiyam fabiosakiy...@gmail.com wrote: Hi, Old post but, any solutions for this, using wicket tester? Thx -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-t-get-FormTester-submitLink-to-work-required-testfield-always-missing-tp1888944p4485338.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Images, ajax requests and caching
Thanks for the explanation Martin. I don't fully understand your second paragraph though. The style/locale/variation can indeed change between ajax requests and I don't dispute that. However, that is also the case between non-ajax requests but these don't get the anticache parameter added to their Image src url. Shouldn't adding the anticache parameter be independent of the type of request? With the current behavior, I get the following sequence or urls: -First page display: src = resources/thumbs/pid140.png -Ajax request containing the image: src = resources/thumbs/pid140.png?antiCache=1332169642904 -Refresh of page or setResponsePage(getPage()): src = resources/thumbs/pid140.png --- can retrieve from cache, This means that if no other steps are taken (e.g. disabling caching at the ResourceRef level, changing src url based on style/locale/variation, using NonCachingImage), adding the anti-cache parameter is not enough. Maybe I'm missing something since I only use shared resources currently. I'll go ahead and create my own CachingImage subclass. On 19/03/2012 10:21 AM, Martin Grigorov wrote: Hi, The idea is if you add an image to an AjaxRequestTarget then Wicket assumes this image needs to be re-painted. This is the safer approach because otherwise the user will add it to the target and the image will not change. Then we have to explain the user that he has to do something more additionally. Maybe the only way to optimize even further is to add the anticache param only if static String url is used (in contrast to resource or resourcereference). But even in this case the style/locale/variation may be changed and the image should be updated again ... So the current approach is the most common - let the developer decide whether the image should be updated or not. Just override org.apache.wicket.markup.html.image.Image#shouldAddAntiCacheParameter On Mon, Mar 19, 2012 at 4:07 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Indeed, but I don't understand how that helps in my case. NonCachingImage takes the behavior of Image one step further by always adding an anticache parameter to images (i.e. for ajax and normal requests). Wicket currently has : Image - Cached for normal requests, never cached for ajax requests NonCachingImage - Never cached for ajax and normal requests What I want is a cachable image to avoid unnecessary client requests for thumbnails. Like I said, such a class is very easy to do, but maybe the current behavior of Wicket is not desirable. On 19/03/2012 1:25 AM, Igor Vaynberg wrote: we have a noncachingimage subclass... :) -igor On Sun, Mar 18, 2012 at 9:33 PM, Bertrand Guay-Paquet ber...@step.polymtl.cawrote: Hi, I have image resources which fetch the proper thumbnail picture stored in a DB based on the image's file name. I used the file name instead of parameters to make sure client-side caching would work. By chance, I just discovered that the images are always reloaded on ajax requests. This is caused by Image#shouldAddAntiCacheParameter and Image#addAntiCacheParameter which always add an anticache parameter to image src URLs on ajax requests. In my case, the images are added to ajax requests as part of a table update containing lots of thumbnails so it's definitely counter-productive. I can see the need for anticaching for dynamically generated images which change per request, but should this be the default behavior? Of course, I can easily work around this issue by subclassing Image, but I wanted to bring this to attention. At the very least, I would suggest creating a subclass (CachingImage?) of Image in core which does not do anticaching for stateless resource references. Regards, Bertrand - To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org For additional commands, e-mail:users-h...@wicket.apache.org - To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org For additional commands, e-mail:users-h...@wicket.apache.org - To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org For additional commands, e-mail:users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: support for L10N in templates
Hi Martin, for more context what I need is full localization support for js templates, similar to the support provided for components: 1- by allowing to have localized js template files per page. E.g.: my.js, my_es.js, my_fr.js 2- by automatically solving messages in the template (without passing a variables model with all the messages). E.g.: var x = '${message:someResourceKey}'; I already solved the 2nd one by overriding PackagedTextTemplate#asString() and overriding MapVariableInterpolator#getValue(). but now I need to localize the template file names themselves as mentioned in point 1. Thanx! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/support-for-L10N-in-templates-tp4479741p4485558.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same Variable Shared Before/After Form Submit
I see. Unfortunately I've never worked with Adobe PDF-Form but I think you need to build some kind of object or converter to bridge the gap between FDF format and java world. Sorry, but I haven't any better idea :( I have a custom HTML object which is an Adobe PDF-Form (FDF). This widget is displayed in the object tag. Adobe Forms have their own fields and buttons. I've succeeded in displaying this widget by subclassing the WebMarkupContainer and setting its properties, as I would for a Flash object, for instance, which is not provided by Wicket out of the box. The next problem for me is associating this custom widget with some kind of Model. I need to bind the fields in AdobeForms to a bean, such that when the form is submitted and refreshed, the FDF shows the saved form. This happens automatically for normal Wicket elements. Now I need to do this manually for this custom widget. How would I nest this custom model inside a form model? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Same-Variable-Shared-Before-After-Form-Submit-tp4484934p4485217.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can't get FormTester.submitLink to work (required testfield always missing)
Hi Martin, Thx for answering, Hmm, i dont know the jira's conxtext on wicket, but where i use it, i create a jira when there's actually a problem. I don't think it is a wicket problem (idk, just guessing), probably it's just me not using it correctly. I didn't create a new post cause this post reflects my problem. My problem: I made a wicketTester for a page, worked perfectly. I'm doing the same to other page, but i dont know if its because of the submitLink or anything else, its not working. My formTester is setting values , but when i do a submitLink and assertNoErrorMessage, it fails. My test is doing this: this.tester.startPage(CadastroPerfilPropagacao.class); this.tester.assertRenderedPage(CadastroPerfilPropagacao.class); FormTester formtester = this.tester.newFormTester(mainForm); ... formtester.setValue(pathFromForm, VALUE TEST); formtester.setValue(pathFromForm, DESCRIPTION TEST); this.tester.executeAjaxEvent(pathFromForm, onchange); formtester.setValue(pathFromFormAfterAjaxEvent, VALUE); ... formtester.submitLink(btnAdd, false); -- This button adds an object inside a list formtester.submitLink(btnSave, false); -- This one submits this.tester.assertNoErrorMessage(); And then i get the assertionFailed error, it says the fields are required. I don't know if this helps, if you think the quickstar is still needed, please tell me. Thx -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-t-get-FormTester-submitLink-to-work-required-testfield-always-missing-tp1888944p4485748.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why I cannot receive default value in Textfield?
Hi, thanks for the replay. I checked onsubmit() and the value has not been transferred if I don't delete the default value. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4486021.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to disable TinyMCE confirm dialog in Wicket?
The question is like this: http://stackoverflow.com/questions/5705671/how-to-disable-tinymce-confirm-dialog The confirmation is different for different browsers. For FF, it is This page is asking you to confirm that you want to leave - data you have entered may not be saved Leave Page - Stay on Page window.onbeforeunload = function() {}; Seems can work with Javascript, but how we do it in wicket? Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-disable-TinyMCE-confirm-dialog-in-Wicket-tp4486793p4486793.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: What real life scenario calls for page ID?
It's a problem when users bookmark it. Because ...?5 this session is an entirely other page as ...?5 in another session tomorrow. On Mon, Mar 19, 2012, at 11:53, Girts Ziemelis wrote: On 2012-03-19 02:46, Paolo wrote: I support you! I implemented class NoVersionMount thanks to pointbreak in my MainApplication. And It will be my template for future app. But to do it, I needed to understood the problem, check on google, read a lot of pages, without found a solution, so post the question here, and after 3 post, got a right reply for me. Why an wicket user have to do all this Why not, wicket use the NoVersionMount as default Mount? Like in wicket 1.4. And implement an VersionMount as an alternative for developer? I actually like this change so far. I can finally tell, that my page is stetefull just by looking at the link and ask myself question - if I really care so much about the clean link for this page, may be it should be stateless in a first place? And why is ?0 such a big problem? It does not cause problems sending links. Is there any real proof of google indexing problems so far? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: What real life scenario calls for page ID?
indeed. we should check that the page pointed to by the id maps back to the mount, and create a new instance based on the mount if it doesnt. jira please. -igor On Mon, Mar 19, 2012 at 3:52 PM, Pointbreak pointbreak+wicketst...@ml1.net wrote: It's a problem when users bookmark it. Because ...?5 this session is an entirely other page as ...?5 in another session tomorrow. On Mon, Mar 19, 2012, at 11:53, Girts Ziemelis wrote: On 2012-03-19 02:46, Paolo wrote: I support you! I implemented class NoVersionMount thanks to pointbreak in my MainApplication. And It will be my template for future app. But to do it, I needed to understood the problem, check on google, read a lot of pages, without found a solution, so post the question here, and after 3 post, got a right reply for me. Why an wicket user have to do all this Why not, wicket use the NoVersionMount as default Mount? Like in wicket 1.4. And implement an VersionMount as an alternative for developer? I actually like this change so far. I can finally tell, that my page is stetefull just by looking at the link and ask myself question - if I really care so much about the clean link for this page, may be it should be stateless in a first place? And why is ?0 such a big problem? It does not cause problems sending links. Is there any real proof of google indexing problems so far? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to build a hudson/jenkins like live log viewer?
Hi, as i mentioned i am new to wicket, can you pls tell me how to call this final code mentioned in this thread? i can't have this in constructor, I need to have this code executed after a file selection. Now how do I add these 2 div's during initialization. I have no idea. please respond ASAP. Thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-build-a-hudson-jenkins-like-live-log-viewer-tp4090224p4487006.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org