Re: REDIRECT_TO_BUFFER render strategy and Wicket 6.8.0
Hi, On Mon, May 27, 2013 at 8:35 AM, Dirk Forchel dirk.forc...@exedio.comwrote: You mean setStatelessHint(true) should be enough to simulate that it is stateless (and not setStatelessHint(false)), do you? Yes, sorry. Actually we didn't care about whether a page is stateless or not as long as they are bookmarkable. After a while we've noticed, that stateful pages (with the page version id appended) in connection with our special filter cause the problem with the endless loop (no HTML session can be created) if the user does not allow cookies in his browser or if a web crawler wants to index the site. This problem came up with Wicket 1.5.7 or 1.5.8. After we did a migration to Wicket 6 (version 6.7.0) the problem was gone and no page version id was attached to the URLs anymore (as long as no form was submitted) and we thought all will be fine. But with version 6.8.0 the problem came up again and we were confused about that. In summary, does this mean, we pages which should be indexed by web crawlers can not be stateful? I've found this discussion from an older thread http://apache-wicket.1842946.n4.nabble.com/Session-ids-and-search-engine-bots-tc1916506.html#a1916510 with exactly the same problem. And to be honest, I did not expect, that we have to care about that. This should be handled by the web framework itself. But from now on we have to keep an eye on whether our pages are stateless or not. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/REDIRECT-TO-BUFFER-render-strategy-and-Wicket-6-8-0-tp4658991p4659032.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: Panel switching
Hi, I guess you know that History API (pushState) works only in IE10, all older versions of IE do not support it. About your question: you can use AjaxRequestTarget#addChildren(getPage(), AbstractLink.class) to add all links in the current page to be repainted. Wicket uses getRequestCycle().getUrlRenderer().getBaseUrl() as a base to calculate the relative urls, so you can set it in your #onXyz() callback methods. Using absolute url may break when you are behind a reverse proxy. This is the reason why Wicket produces relative urls. If this is not a problem for you then you can override RequestCycle#newUrlRenderer() to return a renderer that always uses #renderFullUrl() when #renderUrl() is called. On Mon, May 27, 2013 at 4:34 AM, Colin Rogers colin.rog...@objectconsulting.com.au wrote: Wicketeers, I have an odd issue - that isn't really a bug or a coding problem - but something I thought people might have some ideas on. A little background first. I like to have URLs in my application, as per the examples below; player player/messages player/messages/archive player/messages/old something something/another/thing/or/whatever etc. Now - I'm trying to implement 'panel switching' (I honestly have no idea what this is called...) - where I only replace the parts of the page that actually need replacing, rather than recreating all elements of the page and re-rendering them. This is, unsurprisingly, very easy with Wicket. It's easy to determine what needs replacing, and to actually replace them, via ajax. All good! I also want the user to be able to 'refresh' the page and/or bookmark the page and have the page recreate itself from scratch. Again - this is pretty easy, using javascript and history.pushState etc. The problem I have is when some of my Links are relative to the URL. So where I had a link that was relative to X/Y, when I push the URL to be X/Y/Z, all the relative links are out of date. I guess the questions are; how can I make all Links absolute rather than relative? And, is there any way of doing this across the application? Are there other issues that could affect what I'm trying to do? I realise I can just make all my URLs one level deep - so that all relative links work; player playerMessages playerMessagesArchive But it's simply not as pretty! :) Cheers, Col. EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses.
Re: Panel switching
Hello Martin, Is it possible to know current URL (used by the user if reverse proxy is used)? On Mon, May 27, 2013 at 2:34 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, I guess you know that History API (pushState) works only in IE10, all older versions of IE do not support it. About your question: you can use AjaxRequestTarget#addChildren(getPage(), AbstractLink.class) to add all links in the current page to be repainted. Wicket uses getRequestCycle().getUrlRenderer().getBaseUrl() as a base to calculate the relative urls, so you can set it in your #onXyz() callback methods. Using absolute url may break when you are behind a reverse proxy. This is the reason why Wicket produces relative urls. If this is not a problem for you then you can override RequestCycle#newUrlRenderer() to return a renderer that always uses #renderFullUrl() when #renderUrl() is called. On Mon, May 27, 2013 at 4:34 AM, Colin Rogers colin.rog...@objectconsulting.com.au wrote: Wicketeers, I have an odd issue - that isn't really a bug or a coding problem - but something I thought people might have some ideas on. A little background first. I like to have URLs in my application, as per the examples below; player player/messages player/messages/archive player/messages/old something something/another/thing/or/whatever etc. Now - I'm trying to implement 'panel switching' (I honestly have no idea what this is called...) - where I only replace the parts of the page that actually need replacing, rather than recreating all elements of the page and re-rendering them. This is, unsurprisingly, very easy with Wicket. It's easy to determine what needs replacing, and to actually replace them, via ajax. All good! I also want the user to be able to 'refresh' the page and/or bookmark the page and have the page recreate itself from scratch. Again - this is pretty easy, using javascript and history.pushState etc. The problem I have is when some of my Links are relative to the URL. So where I had a link that was relative to X/Y, when I push the URL to be X/Y/Z, all the relative links are out of date. I guess the questions are; how can I make all Links absolute rather than relative? And, is there any way of doing this across the application? Are there other issues that could affect what I'm trying to do? I realise I can just make all my URLs one level deep - so that all relative links work; player playerMessages playerMessagesArchive But it's simply not as pretty! :) Cheers, Col. EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses. -- WBR Maxim aka solomax
Re: dynamic form (with list + add/remove)
Hi Andy, As far as I know there is no more generic way to do the same. There is a open ticket about this with an idea how to approach this but so far no one worked on it. On Fri, May 24, 2013 at 9:07 PM, Andy Van Den Heuvel andy.vandenheu...@gmail.com wrote: Hey, I was looking for a good example for creating a dynamic form with a list and add/remove functionality. I looked at the ListView, but this article from Martijn's blog tells to use a RepeatingView http://wicketinaction.com/2008/10/building-a-listeditor-form-component/ this article is from 2008. Is this still the prefered way to do this? Or are there other good examples?
Re: Panel switching
Hi Maxim, For Wicket the client is the proxy, so the request url is what the proxy sends to the servlet container. If the proxy sets the original url in a request header then the application code can read this header and use it. On Mon, May 27, 2013 at 10:37 AM, Maxim Solodovnik solomax...@gmail.comwrote: Hello Martin, Is it possible to know current URL (used by the user if reverse proxy is used)? On Mon, May 27, 2013 at 2:34 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, I guess you know that History API (pushState) works only in IE10, all older versions of IE do not support it. About your question: you can use AjaxRequestTarget#addChildren(getPage(), AbstractLink.class) to add all links in the current page to be repainted. Wicket uses getRequestCycle().getUrlRenderer().getBaseUrl() as a base to calculate the relative urls, so you can set it in your #onXyz() callback methods. Using absolute url may break when you are behind a reverse proxy. This is the reason why Wicket produces relative urls. If this is not a problem for you then you can override RequestCycle#newUrlRenderer() to return a renderer that always uses #renderFullUrl() when #renderUrl() is called. On Mon, May 27, 2013 at 4:34 AM, Colin Rogers colin.rog...@objectconsulting.com.au wrote: Wicketeers, I have an odd issue - that isn't really a bug or a coding problem - but something I thought people might have some ideas on. A little background first. I like to have URLs in my application, as per the examples below; player player/messages player/messages/archive player/messages/old something something/another/thing/or/whatever etc. Now - I'm trying to implement 'panel switching' (I honestly have no idea what this is called...) - where I only replace the parts of the page that actually need replacing, rather than recreating all elements of the page and re-rendering them. This is, unsurprisingly, very easy with Wicket. It's easy to determine what needs replacing, and to actually replace them, via ajax. All good! I also want the user to be able to 'refresh' the page and/or bookmark the page and have the page recreate itself from scratch. Again - this is pretty easy, using javascript and history.pushState etc. The problem I have is when some of my Links are relative to the URL. So where I had a link that was relative to X/Y, when I push the URL to be X/Y/Z, all the relative links are out of date. I guess the questions are; how can I make all Links absolute rather than relative? And, is there any way of doing this across the application? Are there other issues that could affect what I'm trying to do? I realise I can just make all my URLs one level deep - so that all relative links work; player playerMessages playerMessagesArchive But it's simply not as pretty! :) Cheers, Col. EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses. -- WBR Maxim aka solomax
Re: Problem loading dependency for wicket-6.8.0
Hi, I just fixed the issue. It should hit Maven Central soon. On Sat, May 25, 2013 at 12:13 PM, Per Newgro per.new...@gmx.ch wrote: Ok, i've delete all wicket 8.8.x jars from m2. But the problem still appears. It seems that wicketstuff-annotations is referencing wickt-6.8.0-SNAPSHOT. I will downgrade until this is fixed Thanks Per Am 25.05.2013 10:39, schrieb Raul: Make sure you have downloaded the dependency correctly, ie that is in your local repository that can decompress, ever happened to me that have been downloaded jar with corrupted data. If so removes the corrupt jar to download them again. -- View this message in context: http://apache-wicket.1842946.** n4.nabble.com/Problem-loading-**dependency-for-wicket-6-8-0-** tp4659026p4659027.htmlhttp://apache-wicket.1842946.n4.nabble.com/Problem-loading-dependency-for-wicket-6-8-0-tp4659026p4659027.html Sent from the Users forum mailing list archive at Nabble.com. --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Very weird problem with modal windows (objects changin in the middle of execution)
Hello! I have such a weird problem i dont think i will be able to explain it in one shot, i'll try anyway. The thing is have a page (a class that descends from WebPage) that uses a popup (using a class that descends from ModalWindow), and the popup itself shows a new popup (again, by using a ModalWindow descendant class). The (very weird) problem is that after the second popup is shown (the popup within the popup, that is) the objects the execution path seems to return to are different! The flow is something like the following: page (java object id A) opens popup - popup (java object id B) opens popup - popup asks for yes or no (either way its closed) by debbuging i see that after this, the java object id of the first popup is not B anymore! The thing that i find most weird is that this only happens if the second popup is opened, could the opening or closing of the popup cause something like this? I know it sounds weird, it does not make any sense and its very much more likely to be a mistake unseen by me than a bug in the JDK :P but i wanted to ask anyway, in case someone has seen or heard about something that resembles this (even if it does very vaguely) Thanks in advance! Rafael
Re: Very weird problem with modal windows (objects changin in the middle of execution)
Hi, I guess you already know that Wicket serializes the pages at the end of the request cycle. After deserialization the object id is no more the same as the one before serialization. You should not rely on same JVM instance. Check Wicket-Examples demo for ModalWindow. It uses PageReference to get access to the page instance that opened the ModalWindow. On Mon, May 27, 2013 at 11:16 AM, Rafael Barrera Oro boraf...@gmail.comwrote: Hello! I have such a weird problem i dont think i will be able to explain it in one shot, i'll try anyway. The thing is have a page (a class that descends from WebPage) that uses a popup (using a class that descends from ModalWindow), and the popup itself shows a new popup (again, by using a ModalWindow descendant class). The (very weird) problem is that after the second popup is shown (the popup within the popup, that is) the objects the execution path seems to return to are different! The flow is something like the following: page (java object id A) opens popup - popup (java object id B) opens popup - popup asks for yes or no (either way its closed) by debbuging i see that after this, the java object id of the first popup is not B anymore! The thing that i find most weird is that this only happens if the second popup is opened, could the opening or closing of the popup cause something like this? I know it sounds weird, it does not make any sense and its very much more likely to be a mistake unseen by me than a bug in the JDK :P but i wanted to ask anyway, in case someone has seen or heard about something that resembles this (even if it does very vaguely) Thanks in advance! Rafael
Re: REDIRECT_TO_BUFFER render strategy and Wicket 6.8.0
Actually I don't see any reason why to redirect for stateless pages, but browsing the source code I found that the default WePageRenderer returns true for org.apache.wicket.request.handler.render.PageRenderer.enableRedirectForStatelessPage(). Should I override this method as well to disable the redirect? But therfore I have to provide my own WebPageRenderer in WebApplication.class. By the way, we have a bunch of AbstractAjaxBehaviors and AjaxLinks in the component hierarchy which trigger the Page to be stateful. But I don't have experience with stateless components so I may miss something. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/REDIRECT-TO-BUFFER-render-strategy-and-Wicket-6-8-0-tp4658991p4659041.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: Deserialization InvalidClassException : no valid constructor
Well, you can't serialize the BufferedImage, but maybe you can serialize whatever data you've used to render BufferedImage's contents, i.e. instead of saving the image, save whatever is necessary to recreate the image? Or, you could store the BufferedImage's content to an actual image file (using ImageIO)? On Wed, May 22, 2013 at 5:39 AM, smallufo small...@gmail.com wrote: Thanks. But in my example , I cannot modify BufferedImage (to add a no-arg constructor) What should I do if I want to output a BufferedImage (and make back button work) ? 2013/5/14 Jonas barney...@gmail.com This could only work if BufferedImage itself had a no-arg constructor. It is it the first non-serializable class in the hierarchy that needs to have it, not the first serializable one, like in your example. Besides, you would still lose all data stored in the BufferedImage's fields (i.e. the image stored in it). On Mon, May 13, 2013 at 7:15 PM, smallufo small...@gmail.com wrote: Today I encountered one famous deserialization problem : InvalidClassException : no valid constructor I googled and found some solution , but all are in-vain. The solution says the first non-serializable super class should define a no-arg constructor. But I try to define a no-arg constructor to EACH class of the HIERARCHY , and EACH class implements Serializable... (which is not necessary , but I want to make it simple , to pinpoint the problem) My base class is an abstract class extends BufferedImage (java 2D) while BufferedImage is not Serializable So I make my abstract class implements Serializable and define a no-arg default constructor. The total hierarchy is : public abstract class AbstractChart extends BufferedImage implements Serializable { public AbstractChart() {// I try to remove this constructor , but in vain super(0 , 0, TYPE_INT_ARGB); } } and first child class : public class ChildChart extends AbstractChart implements Serializable { public ChildChart() { super(); // or not calling super() } } and the grandson class : public class GrandsonChart extends ChildChart implements Serializable { public GrandsonChart() { super(); // or not calling super() } } No matter I calls super() in ChildChart or GrandsonChart , Caused by: java.io.InvalidClassException: foobar.GrandsonChart; no valid constructor It happens when I click a button ,use ajax to paint this GrandsonChart , and click another page , and use browser back . The browser will be redirected to /context/wicket/page?xxx (The error page) The screen shows : Could not deserialize object using: class org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream and in the console log , I can see this InvalidClassException is thrown. Any way to solve this problem ? (I've already added default no-arg constructor , and make each class implements Serializable , but still not working ) environment : Wicket version : 6.7 Resin 4.0.25 Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402, 64, mixed mode, Apple Inc (It happens on Linux JDK too)
wicket 6 and a confirm dialog
Hi wicket community, i have a question about how to implement a confirm dialog via javascript on a button or link. Before wicket 6 we used a simple behavior (as mentioned here: https://cwiki.apache.org/WICKET/getting-user-confirmation.html) which could be used to enrich any button or link (ajaxified or not) at any time. With wicket 6 this solution is not working anymore.The suggested (javascript) solution on https://cwiki.apache.org/WICKET/getting-user-confirmation.html[https://cwiki.apache.org/WICKET/getting-user-confirmation.html] has two downsides (from my perspective): - It requires an ajax component (button or link). - It extends a component. As we use different basic components (which use buttons or links – not always their ajax companions), we would have to extends all these basic components to be able use a confirm dialog on them for certain use cases. Are there any other suggestions out there or is the suggested solution mentioned above the new “wicket way” to achieve a confirm dialog? Best regards marcel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket 6 and a confirm dialog
Hi Marcel, What exactly is the issue with non-Ajax links ? On Mon, May 27, 2013 at 12:34 PM, Marcel Hoerr marcel.ho...@gmx.de wrote: Hi wicket community, i have a question about how to implement a confirm dialog via javascript on a button or link. Before wicket 6 we used a simple behavior (as mentioned here: https://cwiki.apache.org/WICKET/getting-user-confirmation.html) which could be used to enrich any button or link (ajaxified or not) at any time. With wicket 6 this solution is not working anymore.The suggested (javascript) solution on https://cwiki.apache.org/WICKET/getting-user-confirmation.html[https://cwiki.apache.org/WICKET/getting-user-confirmation.html]has two downsides (from my perspective): - It requires an ajax component (button or link). - It extends a component. As we use different basic components (which use buttons or links – not always their ajax companions), we would have to extends all these basic components to be able use a confirm dialog on them for certain use cases. Are there any other suggestions out there or is the suggested solution mentioned above the new “wicket way” to achieve a confirm dialog? Best regards marcel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic form (with list + add/remove)
https://issues.apache.org/jira/browse/WICKET-1177 On Mon, May 27, 2013 at 12:44 PM, Andy Van Den Heuvel andy.vandenheu...@gmail.com wrote: What's the ticket number? On Mon, May 27, 2013 at 9:47 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi Andy, As far as I know there is no more generic way to do the same. There is a open ticket about this with an idea how to approach this but so far no one worked on it. On Fri, May 24, 2013 at 9:07 PM, Andy Van Den Heuvel andy.vandenheu...@gmail.com wrote: Hey, I was looking for a good example for creating a dynamic form with a list and add/remove functionality. I looked at the ListView, but this article from Martijn's blog tells to use a RepeatingView http://wicketinaction.com/2008/10/building-a-listeditor-form-component/ this article is from 2008. Is this still the prefered way to do this? Or are there other good examples?
Re: Deserialization InvalidClassException : no valid constructor
I solve this problem by making the BufferedImage transient. 2013/5/27 Jonas barney...@gmail.com Well, you can't serialize the BufferedImage, but maybe you can serialize whatever data you've used to render BufferedImage's contents, i.e. instead of saving the image, save whatever is necessary to recreate the image? Or, you could store the BufferedImage's content to an actual image file (using ImageIO)? On Wed, May 22, 2013 at 5:39 AM, smallufo small...@gmail.com wrote: Thanks. But in my example , I cannot modify BufferedImage (to add a no-arg constructor) What should I do if I want to output a BufferedImage (and make back button work) ? 2013/5/14 Jonas barney...@gmail.com This could only work if BufferedImage itself had a no-arg constructor. It is it the first non-serializable class in the hierarchy that needs to have it, not the first serializable one, like in your example. Besides, you would still lose all data stored in the BufferedImage's fields (i.e. the image stored in it). On Mon, May 13, 2013 at 7:15 PM, smallufo small...@gmail.com wrote: Today I encountered one famous deserialization problem : InvalidClassException : no valid constructor I googled and found some solution , but all are in-vain. The solution says the first non-serializable super class should define a no-arg constructor. But I try to define a no-arg constructor to EACH class of the HIERARCHY , and EACH class implements Serializable... (which is not necessary , but I want to make it simple , to pinpoint the problem) My base class is an abstract class extends BufferedImage (java 2D) while BufferedImage is not Serializable So I make my abstract class implements Serializable and define a no-arg default constructor. The total hierarchy is : public abstract class AbstractChart extends BufferedImage implements Serializable { public AbstractChart() {// I try to remove this constructor , but in vain super(0 , 0, TYPE_INT_ARGB); } } and first child class : public class ChildChart extends AbstractChart implements Serializable { public ChildChart() { super(); // or not calling super() } } and the grandson class : public class GrandsonChart extends ChildChart implements Serializable { public GrandsonChart() { super(); // or not calling super() } } No matter I calls super() in ChildChart or GrandsonChart , Caused by: java.io.InvalidClassException: foobar.GrandsonChart; no valid constructor It happens when I click a button ,use ajax to paint this GrandsonChart , and click another page , and use browser back . The browser will be redirected to /context/wicket/page?xxx (The error page) The screen shows : Could not deserialize object using: class org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream and in the console log , I can see this InvalidClassException is thrown. Any way to solve this problem ? (I've already added default no-arg constructor , and make each class implements Serializable , but still not working ) environment : Wicket version : 6.7 Resin 4.0.25 Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402, 64, mixed mode, Apple Inc (It happens on Linux JDK too)
Fwd: Re: wicket 6 and a confirm dialog
Hi Martin, the suggested solution needs AjaxRequestAttributes in order to display the confirm dialog. In an non Ajax setting there would be no ajaxrequest though. Best regards marcel Am 27.05.13 um 11:37 schrieb Martin Grigorov Hi Marcel, What exactly is the issue with non-Ajax links ? On Mon, May 27, 2013 at 12:34 PM, Marcel Hoerr marcel.ho...@gmx.de wrote: Hi wicket community, i have a question about how to implement a confirm dialog via javascript on a button or link. Before wicket 6 we used a simple behavior (as mentioned here: https://cwiki.apache.org/WICKET/getting-user-confirmation.html) which could be used to enrich any button or link (ajaxified or not) at any time. With wicket 6 this solution is not working anymore.The suggested (javascript) solution on https://cwiki.apache.org/WICKET/getting-user-confirmation.html[https://cwiki.apache.org/WICKET/getting-user-confirmation.html]has two downsides (from my perspective): - It requires an ajax component (button or link). - It extends a component. As we use different basic components (which use buttons or links – not always their ajax companions), we would have to extends all these basic components to be able use a confirm dialog on them for certain use cases. Are there any other suggestions out there or is the suggested solution mentioned above the new “wicket way” to achieve a confirm dialog? Best regards marcel - 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: Re: wicket 6 and a confirm dialog
Hi Marcel, But the solution with onclick attribute is still valid for non-Ajax link. You can use it for Ajax link too - returning false will stop the execution of the bound event listener used by Wicket to do its work. On Mon, May 27, 2013 at 2:02 PM, marcel.ho...@gmx.de wrote: Hi Martin, the suggested solution needs AjaxRequestAttributes in order to display the confirm dialog. In an non Ajax setting there would be no ajaxrequest though. Best regards marcel Am 27.05.13 um 11:37 schrieb Martin Grigorov Hi Marcel, What exactly is the issue with non-Ajax links ? On Mon, May 27, 2013 at 12:34 PM, Marcel Hoerr marcel.ho...@gmx.de wrote: Hi wicket community, i have a question about how to implement a confirm dialog via javascript on a button or link. Before wicket 6 we used a simple behavior (as mentioned here: https://cwiki.apache.org/WICKET/getting-user-confirmation.html) which could be used to enrich any button or link (ajaxified or not) at any time. With wicket 6 this solution is not working anymore.The suggested (javascript) solution on https://cwiki.apache.org/WICKET/getting-user-confirmation.html[https://cwiki.apache.org/WICKET/getting-user-confirmation.html]hastwo downsides (from my perspective): - It requires an ajax component (button or link). - It extends a component. As we use different basic components (which use buttons or links – not always their ajax companions), we would have to extends all these basic components to be able use a confirm dialog on them for certain use cases. Are there any other suggestions out there or is the suggested solution mentioned above the new “wicket way” to achieve a confirm dialog? Best regards marcel - 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
How to create https link to a page?
Hi all, In app I have several pages on http on those pages I need https link to the LoginPage. I have set HttpsMapper as a root mapper and added RequireHttps to the LoginPage class. I'm using Wicket 6.8.0 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-https-link-to-a-page-tp4659050.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: How to create https link to a page?
Hi Alexey, Wicket generates relative urls. When the user clicks the link to LoginPage HttpsMapper will check that LoginPage requires HTTPS and that the current protocol is HTTP and will make a redirect with HTTPS. So it will work automatically, with the price of an additional redirect. On Mon, May 27, 2013 at 7:23 PM, Alexey Mukas alexey.mu...@gmail.comwrote: Hi all, In app I have several pages on http on those pages I need https link to the LoginPage. I have set HttpsMapper as a root mapper and added RequireHttps to the LoginPage class. I'm using Wicket 6.8.0 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-https-link-to-a-page-tp4659050.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: How to create https link to a page?
Hi Martin, Thanks for the super fast reply! In my case I have no redirect, Login page opens with HTTP, but in the form (in action attribute) I see correct HTTPS url. Will try to reproduce in the Quickstart. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-https-link-to-a-page-tp4659050p4659052.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: Very weird problem with modal windows (objects changin in the middle of execution)
Hello Martin! Thanks for the quick reply! Indeed, i was aware that after a serialization/deserialization the JVM instance will not be the same, however, my problem is that attribute values are not maintained (or at least the right objects are not being used) i found out the following by debugging //the following object has certain java object id secondPopup = new SecondPopup(id); secondPopup.setWindowClosedCallback(new WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { SecondPopup secondPopup; //here the id changes, and from here on all the pages and popups are copies from the ones created before secondPopup = (SecondPopup)getPage().get(secondPopup); if(secondPopup.isOk()) FirstPopupPage.this.confirm(target); } }); because of this, all changes made from this event handler are invisible Does it ring a bell for anyone? if you find confusing (i know it is) please tell me and i'll try to explain myself better thanks in advance! Rafael 2013/5/27 Martin Grigorov mgrigo...@apache.org Hi, I guess you already know that Wicket serializes the pages at the end of the request cycle. After deserialization the object id is no more the same as the one before serialization. You should not rely on same JVM instance. Check Wicket-Examples demo for ModalWindow. It uses PageReference to get access to the page instance that opened the ModalWindow. On Mon, May 27, 2013 at 11:16 AM, Rafael Barrera Oro boraf...@gmail.com wrote: Hello! I have such a weird problem i dont think i will be able to explain it in one shot, i'll try anyway. The thing is have a page (a class that descends from WebPage) that uses a popup (using a class that descends from ModalWindow), and the popup itself shows a new popup (again, by using a ModalWindow descendant class). The (very weird) problem is that after the second popup is shown (the popup within the popup, that is) the objects the execution path seems to return to are different! The flow is something like the following: page (java object id A) opens popup - popup (java object id B) opens popup - popup asks for yes or no (either way its closed) by debbuging i see that after this, the java object id of the first popup is not B anymore! The thing that i find most weird is that this only happens if the second popup is opened, could the opening or closing of the popup cause something like this? I know it sounds weird, it does not make any sense and its very much more likely to be a mistake unseen by me than a bug in the JDK :P but i wanted to ask anyway, in case someone has seen or heard about something that resembles this (even if it does very vaguely) Thanks in advance! Rafael
Re: Very weird problem with modal windows (objects changin in the middle of execution)
Hi Rafael, Please create a quickstart and attach it to Jira or upload it somewhere so we can debug it. I'm sure you leak Page instances and this causes the problem. As I already suggested - you should use PageReference to get to the outer page(s). On Mon, May 27, 2013 at 10:50 PM, Rafael Barrera Oro boraf...@gmail.comwrote: Hello Martin! Thanks for the quick reply! Indeed, i was aware that after a serialization/deserialization the JVM instance will not be the same, however, my problem is that attribute values are not maintained (or at least the right objects are not being used) i found out the following by debugging //the following object has certain java object id secondPopup = new SecondPopup(id); secondPopup.setWindowClosedCallback(new WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { SecondPopup secondPopup; //here the id changes, and from here on all the pages and popups are copies from the ones created before secondPopup = (SecondPopup)getPage().get(secondPopup); if(secondPopup.isOk()) FirstPopupPage.this.confirm(target); } }); because of this, all changes made from this event handler are invisible Does it ring a bell for anyone? if you find confusing (i know it is) please tell me and i'll try to explain myself better thanks in advance! Rafael 2013/5/27 Martin Grigorov mgrigo...@apache.org Hi, I guess you already know that Wicket serializes the pages at the end of the request cycle. After deserialization the object id is no more the same as the one before serialization. You should not rely on same JVM instance. Check Wicket-Examples demo for ModalWindow. It uses PageReference to get access to the page instance that opened the ModalWindow. On Mon, May 27, 2013 at 11:16 AM, Rafael Barrera Oro boraf...@gmail.com wrote: Hello! I have such a weird problem i dont think i will be able to explain it in one shot, i'll try anyway. The thing is have a page (a class that descends from WebPage) that uses a popup (using a class that descends from ModalWindow), and the popup itself shows a new popup (again, by using a ModalWindow descendant class). The (very weird) problem is that after the second popup is shown (the popup within the popup, that is) the objects the execution path seems to return to are different! The flow is something like the following: page (java object id A) opens popup - popup (java object id B) opens popup - popup asks for yes or no (either way its closed) by debbuging i see that after this, the java object id of the first popup is not B anymore! The thing that i find most weird is that this only happens if the second popup is opened, could the opening or closing of the popup cause something like this? I know it sounds weird, it does not make any sense and its very much more likely to be a mistake unseen by me than a bug in the JDK :P but i wanted to ask anyway, in case someone has seen or heard about something that resembles this (even if it does very vaguely) Thanks in advance! Rafael
IAjaxCallListener issues in AbstractDefaultAjaxBehavior. updateAjaxAttributes
Hi, when I want to manage the 'before' and 'complete' handlers of an ajax component, everything works as expected if I override the component updateAjaxAttributes method of the component like in the below example: public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { super(parameters); final AjaxLinkString link = new AjaxLinkString(submit,Model.of(link)) { @Override public void onClick(AjaxRequestTarget target) { } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); IAjaxCallListener listener = new IAjaxCallListener() { @Override public CharSequence getBeforeHandler(Component component) { return alert('Before');; } ... @Override public CharSequence getCompleteHandler(Component component) { return alert('Complete');; } }; attributes.getAjaxCallListeners().add(listener); } }; add(link); } } on the other hand, if I create an AbstractDefaultAjaxBehavior, override updateAjaxAttributes, and attach it to the component, the two handlers are not invoked: public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { super(parameters); final AjaxLinkString link = new AjaxLinkString(submit,Model.of(link)) { @Override public void onClick(AjaxRequestTarget target) { } }; link.add(new SomeAjaxBehavior()); add(link); } } // SomeSomeAjaxBehavior public class SomeAjaxBehavior extends AbstractDefaultAjaxBehavior { @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { // TODO Auto-generated method stub super.updateAjaxAttributes(attributes); IAjaxCallListener listener = new IAjaxCallListener() { @Override public CharSequence getBeforeHandler(Component component) { return alert('Before');; } ... @Override public CharSequence getCompleteHandler(Component component) { return alert('Complete');; } }; attributes.getAjaxCallListeners().add(listener); } @Override protected void respond(AjaxRequestTarget target) { } } am I missing something or this is a bug? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055.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: IAjaxCallListener issues in AbstractDefaultAjaxBehavior. updateAjaxAttributes
I forgot to mention that the example is built with wicket 6.8.0 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055p4659056.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: IAjaxCallListener issues in AbstractDefaultAjaxBehavior. updateAjaxAttributes
Hi, you're adding an additional behavior that has nothing to do with the behavior created in AjaxLink#newAjaxEventBehavior(). SomeAjaxBehavior#updateAjaxAttributes() and #respond() are never invoked. Sven On 05/27/2013 10:22 PM, stefanofg wrote: on the other hand, if I create an AbstractDefaultAjaxBehavior, override updateAjaxAttributes, and attach it to the component, the two handlers are not invoked: public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { super(parameters); final AjaxLinkString link = new AjaxLinkString(submit,Model.of(link)) { @Override public void onClick(AjaxRequestTarget target) { } }; link.add(new SomeAjaxBehavior()); add(link); } } // SomeSomeAjaxBehavior public class SomeAjaxBehavior extends AbstractDefaultAjaxBehavior { @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { // TODO Auto-generated method stub super.updateAjaxAttributes(attributes); IAjaxCallListener listener = new IAjaxCallListener() { @Override public CharSequence getBeforeHandler(Component component) { return alert('Before');; } ... @Override public CharSequence getCompleteHandler(Component component) { return alert('Complete');; } }; attributes.getAjaxCallListeners().add(listener); } @Override protected void respond(AjaxRequestTarget target) { } } am I missing something or this is a bug? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055.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: IAjaxCallListener issues in AbstractDefaultAjaxBehavior. updateAjaxAttributes
On Mon, May 27, 2013 at 11:33 PM, Sven Meier s...@meiers.net wrote: Hi, you're adding an additional behavior that has nothing to do with the behavior created in AjaxLink#newAjaxEventBehavior(**). SomeAjaxBehavior#**updateAjaxAttributes() and #respond() are never invoked. Correct. You have to call org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getCallbackScript() manually for non-AjaxEventBehaviors Sven On 05/27/2013 10:22 PM, stefanofg wrote: on the other hand, if I create an AbstractDefaultAjaxBehavior, override updateAjaxAttributes, and attach it to the component, the two handlers are not invoked: public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { super(parameters); final AjaxLinkString link = new AjaxLinkString(submit,**Model.of(link)) { @Override public void onClick(AjaxRequestTarget target) { } }; link.add(new SomeAjaxBehavior()); add(link); } } // SomeSomeAjaxBehavior public class SomeAjaxBehavior extends AbstractDefaultAjaxBehavior { @Override protected void updateAjaxAttributes(**AjaxRequestAttributes attributes) { // TODO Auto-generated method stub super.updateAjaxAttributes(**attributes); IAjaxCallListener listener = new IAjaxCallListener() { @Override public CharSequence getBeforeHandler(Component component) { return alert('Before');; } ... @Override public CharSequence getCompleteHandler(Component component) { return alert('Complete');; } }; attributes.**getAjaxCallListeners().add(**listener); } @Override protected void respond(AjaxRequestTarget target) { } } am I missing something or this is a bug? Thanks -- View this message in context: http://apache-wicket.1842946.** n4.nabble.com/**IAjaxCallListener-issues-in-** AbstractDefaultAjaxBehavior-**updateAjaxAttributes-**tp4659055.htmlhttp://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055.html Sent from the Users forum mailing list archive at Nabble.com. --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: IAjaxCallListener issues in AbstractDefaultAjaxBehavior. updateAjaxAttributes
Thanks a lot Sven and Martin. Extending my behavior from AjaxEventBehavior solved the problem for now, even though when I use that behavior, I must be aware of the event managed by the component. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IAjaxCallListener-issues-in-AbstractDefaultAjaxBehavior-updateAjaxAttributes-tp4659055p4659061.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: Panel switching
Martin, Awesome - thanks, once again...! That gives me plenty to get on with... :) Cheers, Col. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: 27 May 2013 17:34 To: users@wicket.apache.org Subject: Re: Panel switching Hi, I guess you know that History API (pushState) works only in IE10, all older versions of IE do not support it. About your question: you can use AjaxRequestTarget#addChildren(getPage(), AbstractLink.class) to add all links in the current page to be repainted. Wicket uses getRequestCycle().getUrlRenderer().getBaseUrl() as a base to calculate the relative urls, so you can set it in your #onXyz() callback methods. Using absolute url may break when you are behind a reverse proxy. This is the reason why Wicket produces relative urls. If this is not a problem for you then you can override RequestCycle#newUrlRenderer() to return a renderer that always uses #renderFullUrl() when #renderUrl() is called. On Mon, May 27, 2013 at 4:34 AM, Colin Rogers colin.rog...@objectconsulting.com.au wrote: Wicketeers, I have an odd issue - that isn't really a bug or a coding problem - but something I thought people might have some ideas on. A little background first. I like to have URLs in my application, as per the examples below; player player/messages player/messages/archive player/messages/old something something/another/thing/or/whatever etc. Now - I'm trying to implement 'panel switching' (I honestly have no idea what this is called...) - where I only replace the parts of the page that actually need replacing, rather than recreating all elements of the page and re-rendering them. This is, unsurprisingly, very easy with Wicket. It's easy to determine what needs replacing, and to actually replace them, via ajax. All good! I also want the user to be able to 'refresh' the page and/or bookmark the page and have the page recreate itself from scratch. Again - this is pretty easy, using javascript and history.pushState etc. The problem I have is when some of my Links are relative to the URL. So where I had a link that was relative to X/Y, when I push the URL to be X/Y/Z, all the relative links are out of date. I guess the questions are; how can I make all Links absolute rather than relative? And, is there any way of doing this across the application? Are there other issues that could affect what I'm trying to do? I realise I can just make all my URLs one level deep - so that all relative links work; player playerMessages playerMessagesArchive But it's simply not as pretty! :) Cheers, Col. EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses. EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses.