Re: Is wicket-cdi native to Wicket 6.1 and upwards?
Hey, http://devlearnings.wordpress.com/2011/05/15/apache-openwebbeans-cdi-from-standalone-to-webapp/ http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html/environments.html - this is for jboss, but there's something for using it in tomcat as well, and it's possible to replace weld-related stuff with openwebbeans Most of solutions I found are using Weld, but you actually don't need it. You can use Openwebbeans (tomee) as well, as Igor states out: http://web.archiveorange.com/archive/v/t3xmoyfvrPfZN7bZZbeB I'm not using maven since it made me feel from time to time loosing control, but it should work. I added some libraries (to tomcat/lib), added some code to HomePage.java and all was fine. Making it work for wicket WebSessions as well was a little harder, but I had it solved (thanks to this mailing list), so you might check out the recent archives of this list (http://wicket-users.markmail.org/search/?q=injector.get%28%29). I posted most of my code yesterday (to solve the issue with injection in WebSession). I can send the configurations this afternoon - it's morning now - and check how it made it work with tomee. Kurt 2012/11/25 Yuci Gou ygou@gmail.com: Just read the article - Status of wicket-cdi Module at https://www.42lines.net/2012/09/11/status-of-wicket-cdi-module/. Wonder if wicket-cdi is part of Wicket 6.1 release and upwards. I tried a simple Wicket 6.3 application running in TomEE, but could not get the CDI injection to work. These are the steps I used: 1. Create a Wicket project with Maven (according to http://wicket.apache.org/start/quickstart.html) mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.3.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository= https://repository.apache.org/ -DinteractiveMode=false 2. Generate the eclipse configuration files mvn eclipse:eclipse -Dwtpversion=2.0 (Note: Following steps are based on the tutorial on Youtube: http://www.youtube.com/watch?v=Lr8pxEACVRI) 3. In folder src/main/webapp/WEB-INF, create file beans.xml (Also in folder src/main/webapp/META-INF, create file beans.xml, according to the explanation for this example: http://tomee.apache.org/examples-trunk/cdi-basic/README.html, and also src/main/resources/META-INF/beans.xml just in case) 4. Create a POJO public class Faculty { private ListString facultyMembers; private String facultyName; @PostConstruct public void initialize() { this.facultyMembers = new ArrayListString(); facultyMembers.add(Ian Schultz); facultyMembers.add(Diane Reyes); facultyName = Computer Science; } public ListString getFacultyMembers() { return facultyMembers; } public String getFacultyName() { return facultyName; } } 5. Inject the POJO in HomePage.java and display it. public class HomePage extends WebPage { private static final long serialVersionUID = 1L; @Inject private Faculty faculty; public HomePage(final PageParameters parameters) { super(parameters); if (faculty != null) { add(new Label(cdi, faculty.getFacultyName())); } else { add(new Label(cdi, Not working!)); } } } Note, class HomePage is the class for the Wicket homepage, as specified below: public class WicketApplication extends WebApplication { /** * @see org.apache.wicket.Application#getHomePage() */ @Override public Class? extends WebPage getHomePage() { return HomePage.class; } } These are the steps I tried, but when running, Not working! is displayed on the home page. I debugged it and confirmed that faculty is null, which means not injected. Many thanks for your kind help! Yuci - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Cloneing Wicket Objects
Hi, You cannot add a component twice. A component can have just one parent. I think jQuery clone() should work, but I'm not totally sure. You can use WicketObjects#clone() method to clone any kind of Object. It uses Java Serialization to do it. Just make sure you clone it before adding the component to its parent, because the relation will be cloned too. On Mon, Nov 26, 2012 at 12:53 AM, Paul Bors p...@bors.ws wrote: Can't you crate the navigation panel once and call add() on it twice by passing the same reference to it from within your page hierarchy? On the client side I don't see why you would push this cloning to the client. Just let the page contain the same panel (html/js) via a single reference. You should be fine as long as you handle the db trip in the constructor or your own init() method. ~ Thank you, Paul Bors -Original Message- From: Colin Rogers [mailto:colin.rog...@objectconsulting.com.au] Sent: Sunday, November 25, 2012 6:28 PM To: users@wicket.apache.org Subject: Cloneing Wicket Objects Wicketeers, I was wondering what the best was to duplicate or clone wicket components. I need guidance as to the best way to do this. I have, on my screen two 'navigation panels' that are identical - one at the top of the page, another at the bottom. They contain dropdown choice fields that, when 'onchange' event occurs, it triggers an ajax request that redirects the user to another page. As, in order to create the navigation panels - I have to visit the DB, and create them dynamically, so it doesn't make sense to perform this operation twice. Also they generate a large amount of HTML, in order render them, so it seems sensible to do as much as I can on the client side. The idea was - I generate the components once, and then clone them on the client side. This saves going to the DB twice and rendering them twice. I've attempted to use jquery's clone function as; clone(), clone(true) and clone(true, true) - but none work. The elements are copied, but the ajax actions never execute onchange. Is there another way to do this that works? A more wicket-centric way? 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. - 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 http://jweekend.com/
Re: Is wicket-cdi native to Wicket 6.1 and upwards?
Hi, If you are using Wicket with a Tomcat-based server like TomEE maybe you could find helpful my example project on integrating OpenEJB and Wicket: https://github.com/bitstorm/Wicket-tutorial-examples/tree/master/CdiInjectionExample. Hey, http://devlearnings.wordpress.com/2011/05/15/apache-openwebbeans-cdi-from-standalone-to-webapp/ http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html/environments.html - this is for jboss, but there's something for using it in tomcat as well, and it's possible to replace weld-related stuff with openwebbeans Most of solutions I found are using Weld, but you actually don't need it. You can use Openwebbeans (tomee) as well, as Igor states out: http://web.archiveorange.com/archive/v/t3xmoyfvrPfZN7bZZbeB I'm not using maven since it made me feel from time to time loosing control, but it should work. I added some libraries (to tomcat/lib), added some code to HomePage.java and all was fine. Making it work for wicket WebSessions as well was a little harder, but I had it solved (thanks to this mailing list), so you might check out the recent archives of this list (http://wicket-users.markmail.org/search/?q=injector.get%28%29). I posted most of my code yesterday (to solve the issue with injection in WebSession). I can send the configurations this afternoon - it's morning now - and check how it made it work with tomee. Kurt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Complete Wicket Websockets example
Hi all, I am trying to develop a web application which includes a chat inside it. The idea is to provide the messaging using XMPP and websockets. However, I didn't find a complete example in Java about WebSockets and Wicket. I found one which uses scala and I don't understand it so much. The other I found was Wicket in Action, but it's very short. I really need an application working with websockets in order to download it and understand its working operation. I appreciate your help, thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Complete-Wicket-Websockets-example-tp4654203.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: Complete Wicket Websockets example
Hi, I guess you talk about my examples. Java: source code: https://github.com/martin-g/blogs/tree/master/wicket6-native-websockets explanations: http://wicketinaction.com/2012/07/wicket-6-native-websockets/ It uses mostly server side push, i.e. the communication in this example is mostly server - client. Scala: https://github.com/martin-g/wicket-native-websocket-example My Scala code style is Object Oriented so it is very similar to Java, i.e. it is easy to translate to Java. This is a good example for your need because it is very close to Chat application. Official docs: https://cwiki.apache.org/WICKET/wicket-native-websockets.html On Mon, Nov 26, 2012 at 12:16 PM, lsm_7 luismi.amo...@gmail.com wrote: Hi all, I am trying to develop a web application which includes a chat inside it. The idea is to provide the messaging using XMPP and websockets. However, I didn't find a complete example in Java about WebSockets and Wicket. I found one which uses scala and I don't understand it so much. The other I found was Wicket in Action, but it's very short. I really need an application working with websockets in order to download it and understand its working operation. I appreciate your help, thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Complete-Wicket-Websockets-example-tp4654203.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 http://jweekend.com/
WiQuery tabs remain selected across requests?
Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery tabs remain selected across requests?
Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Re: WiQuery tabs remain selected across requests?
In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery tabs remain selected across requests?
I see there is a http://api.jqueryui.com/tabs/#option-active which does not seem to be implemented on wiquery (I will add it). So, what you will need is some sort of AJAX version for http://api.jqueryui.com/tabs/#event-activate and on server side record this number (that you will pass as an extra parameter to AJAX request). Which wicket version are you using? On Mon, Nov 26, 2012 at 1:07 PM, Stefan Renz s.r...@efonds.com wrote: In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Re: WiQuery tabs remain selected across requests?
Hi Ernesto, thanks for the quick feedback. We're working on top of Wicket/WiQuery 1.5.7. Ciao Stefan Ernesto Reinaldo Barreiro wrote: I see there is a http://api.jqueryui.com/tabs/#option-active which does not seem to be implemented on wiquery (I will add it). So, what you will need is some sort of AJAX version for http://api.jqueryui.com/tabs/#event-activate and on server side record this number (that you will pass as an extra parameter to AJAX request). Which wicket version are you using? On Mon, Nov 26, 2012 at 1:07 PM, Stefan Renz s.r...@efonds.com wrote: In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery tabs remain selected across requests?
Let me see if I can add those features today or tomorrow. On Mon, Nov 26, 2012 at 1:24 PM, Stefan Renz s.r...@efonds.com wrote: Hi Ernesto, thanks for the quick feedback. We're working on top of Wicket/WiQuery 1.5.7. Ciao Stefan Ernesto Reinaldo Barreiro wrote: I see there is a http://api.jqueryui.com/tabs/#option-active which does not seem to be implemented on wiquery (I will add it). So, what you will need is some sort of AJAX version for http://api.jqueryui.com/tabs/#event-activate and on server side record this number (that you will pass as an extra parameter to AJAX request). Which wicket version are you using? On Mon, Nov 26, 2012 at 1:07 PM, Stefan Renz s.r...@efonds.com wrote: In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
multiple requests and StalePageException
Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn
Re: multiple requests and StalePageException
The renderCount increases only when you use non-Ajax requests, i.e. when you re-render the whole page. Make sure that executes Wicket behavior via js uses Wicket.Ajax.** On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page
Thx for this post, it also helped me :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4654214.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
WicketURLEncoder: escaping / in parameter value
Hi, I'm using WicketURLEncoder (1.4.18) to encode some parameter values. Exactly WicketURLEncoder.QUERY_INSTANCE, but the problem if parameter value contains / (slash) character, eg.: 1 Mbit/s, which is not escaped. This cause an error in url coding startegy which is based on key/value pairs (/key1/value1/key2/value2) because value contains / and brokes the whole url. Here it is an output from different version of WicketURLEncoder for this value: WicketURLEncoder.PATH_INSTANCE = 1%20Mbit%2Fs WicketURLEncoder.FULL_PATH_INSTANCE = 1%20Mbit/s WicketURLEncoder.QUERY_INSTANCE = 1+Mbit/s So should I use PATH_INSTANCE to encode these parameter values instead of QUERY_INSTANCE? I do not use Wicket 6, but maybe the same problem is in that version? -- Best regards, Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketURLEncoder: escaping / in parameter value
Hi, Since you use parameters in the path you have to use PATH_INSTANCE. On Mon, Nov 26, 2012 at 2:28 PM, Daniel Stoch daniel.st...@gmail.comwrote: Hi, I'm using WicketURLEncoder (1.4.18) to encode some parameter values. Exactly WicketURLEncoder.QUERY_INSTANCE, but the problem if parameter value contains / (slash) character, eg.: 1 Mbit/s, which is not escaped. This cause an error in url coding startegy which is based on key/value pairs (/key1/value1/key2/value2) because value contains / and brokes the whole url. Here it is an output from different version of WicketURLEncoder for this value: WicketURLEncoder.PATH_INSTANCE = 1%20Mbit%2Fs WicketURLEncoder.FULL_PATH_INSTANCE = 1%20Mbit/s WicketURLEncoder.QUERY_INSTANCE = 1+Mbit/s So should I use PATH_INSTANCE to encode these parameter values instead of QUERY_INSTANCE? I do not use Wicket 6, but maybe the same problem is in that version? -- Best regards, Daniel - 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 http://jweekend.com/
Re: WicketURLEncoder: escaping / in parameter value
Thanks for the very fast answer. I wanted to change it on PATH_INSTANCE but I wanted to make sure, so I have asked ;) -- DS On Mon, Nov 26, 2012 at 2:32 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Since you use parameters in the path you have to use PATH_INSTANCE. On Mon, Nov 26, 2012 at 2:28 PM, Daniel Stoch daniel.st...@gmail.comwrote: Hi, I'm using WicketURLEncoder (1.4.18) to encode some parameter values. Exactly WicketURLEncoder.QUERY_INSTANCE, but the problem if parameter value contains / (slash) character, eg.: 1 Mbit/s, which is not escaped. This cause an error in url coding startegy which is based on key/value pairs (/key1/value1/key2/value2) because value contains / and brokes the whole url. Here it is an output from different version of WicketURLEncoder for this value: WicketURLEncoder.PATH_INSTANCE = 1%20Mbit%2Fs WicketURLEncoder.FULL_PATH_INSTANCE = 1%20Mbit/s WicketURLEncoder.QUERY_INSTANCE = 1+Mbit/s So should I use PATH_INSTANCE to encode these parameter values instead of QUERY_INSTANCE? I do not use Wicket 6, but maybe the same problem is in that version? -- Best regards, Daniel - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Howto display 404 cause of response on custom error page?
Hi, i'm looking for a way to display the cause of a 404 send by myself on my custom error page. In a behavior i do code throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND, Missing subsite in behavior); /code It is displayed in my custom error page code @MountPath(404.html) public class PageNotFound extends AbstractErrorPage { public PageNotFound() { super(); } @Override protected void setHeaders(WebResponse response) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); super.setHeaders(response); } } /code But i wouuld like to display the cause of the 404 to. If i debug i can see the cause deep inside the response. But i can't imagine that i have to rebuild the path to the cause by myself. Thanks for helping me Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxCallListener precondition with user input
Hey Sekib, Thanks a lot for your input! In case anybody has a similar problem, I ended up solving it through an AjaxCallListener with a little workaround. If the user confirms the alert, I re-trigger a click on the link with additional data and check for that in my precondition. This can be used to perform arbitrary async actions in a listener precondition. @Override public CharSequence getPrecondition(final Component component) { return if (attrs.event.extraData != 'OK') { jConfirm(function(r) { if (r) { $('# + component.getMarkupId() + ').trigger('click', 'OK'); } }); return false;; } Cheers, Thomas On Mon, Nov 5, 2012 at 2:35 PM, Sekib_Omazic sekib1...@gmail.com wrote: If this is an option for you, you could use modal dialog from twitter bootstrap (short example can be fond here: https://github.com/sekib/twittermodal). I don't use public CharSequence getPrecondition(final Component component) at all. Modal dialog is shown after clicking the link (no ajax call). Only a click on Of course button triggers an ajax call. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxCallListener-precondition-with-user-input-tp4653566p4653622.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
Functional tests with QUnit
Hi Wicketeers, I've just published an article at http://wicketinaction.com/2012/11/javascript-based-functional-testing/ that describes a fun way to do functional testing of web applications. I hope you'll find it useful! -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Howto display 404 cause of response on custom error page?
Hi, See ErrorAttributes.java. By Servlet spec several request attributes are available when the web container does error dispatching. On Mon, Nov 26, 2012 at 3:14 PM, Per Newgro per.new...@gmx.ch wrote: Hi, i'm looking for a way to display the cause of a 404 send by myself on my custom error page. In a behavior i do code throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND, Missing subsite in behavior); /code It is displayed in my custom error page code @MountPath(404.html) public class PageNotFound extends AbstractErrorPage { public PageNotFound() { super(); } @Override protected void setHeaders(WebResponse response) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); super.setHeaders(response); } } /code But i wouuld like to display the cause of the 404 to. If i debug i can see the cause deep inside the response. But i can't imagine that i have to rebuild the path to the cause by myself. Thanks for helping me Per - 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 http://jweekend.com/
Re: Functional tests with QUnit
Excellent food for thoughts! Thank you very much! On Mon, Nov 26, 2012 at 3:53 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi Wicketeers, I've just published an article at http://wicketinaction.com/2012/11/javascript-based-functional-testing/that describes a fun way to do functional testing of web applications. I hope you'll find it useful! -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
RE: multiple requests and StalePageException
Hi Martin, Thanks for a tip. What do you mean by uses Wicket.Ajax.**? Applet till now generated fake event to trigger Wicket ajax behavior. I have just tried calling behavior directly with wicketAjaxGet (https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html) but I get the same result. Best regards, Michal Wegrzyn -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 14:03 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException The renderCount increases only when you use non-Ajax requests, i.e. when you re-render the whole page. Make sure that executes Wicket behavior via js uses Wicket.Ajax.** On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Howto display 404 cause of response on custom error page?
Hi, we had a similar requirement, so we did the following: instead of throwing a AbortWithHttpErrorCodeException, we throw a semantic exception. In your case, throw MissingSubsiteException( your message ). How to make Wicket aware of such an exception and implement a proper reaction/response? In your application's #init()-Method, add a RequestCycleListener (e.g. extends org.apache.wicket.request.cycle.AbstractRequestCycleListener) which implements #onException() to dispatch to a particular error page depending on the exception passed in. AFAIK, this is regular Wicket stuff and nothing terribly internal (right?). We have a bunch of error pages which are regular WebPages with #isErrorPage() returning true. Those are triggered via the mentioned RequestCycleListener by means of a org.apache.wicket.request.handler.PageProvider, which can be used to initialize the page just as you may need it. For example, by passing the exception's message, or the exception itself to also display the stack trace. Such an error page can also set a status code by using #getResponse() in #onBeforeRender(), i.e. set a HttpResponseCode.SC_BAD_REQUEST for missing parameters. I hope this helps, bye Stefan Martin Grigorov wrote: Hi, See ErrorAttributes.java. By Servlet spec several request attributes are available when the web container does error dispatching. On Mon, Nov 26, 2012 at 3:14 PM, Per Newgro per.new...@gmx.ch wrote: Hi, i'm looking for a way to display the cause of a 404 send by myself on my custom error page. In a behavior i do code throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND, Missing subsite in behavior); /code It is displayed in my custom error page code @MountPath(404.html) public class PageNotFound extends AbstractErrorPage { public PageNotFound() { super(); } @Override protected void setHeaders(WebResponse response) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); super.setHeaders(response); } } /code But i wouuld like to display the cause of the 404 to. If i debug i can see the cause deep inside the response. But i can't imagine that i have to rebuild the path to the cause by myself. Thanks for helping me Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: multiple requests and StalePageException
Can you show the code that the applet uses to make requests to the page ? On Mon, Nov 26, 2012 at 4:47 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi Martin, Thanks for a tip. What do you mean by uses Wicket.Ajax.**? Applet till now generated fake event to trigger Wicket ajax behavior. I have just tried calling behavior directly with wicketAjaxGet ( https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html) but I get the same result. Best regards, Michal Wegrzyn -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 14:03 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException The renderCount increases only when you use non-Ajax requests, i.e. when you re-render the whole page. Make sure that executes Wicket behavior via js uses Wicket.Ajax.** On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
RE: multiple requests and StalePageException
private JSObject window; public void documentUpdated( String newDocumentId ) { window.call( documentUpdated, new String[] { param1, param2 } ); } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 16:51 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException Can you show the code that the applet uses to make requests to the page ? On Mon, Nov 26, 2012 at 4:47 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi Martin, Thanks for a tip. What do you mean by uses Wicket.Ajax.**? Applet till now generated fake event to trigger Wicket ajax behavior. I have just tried calling behavior directly with wicketAjaxGet ( https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html) but I get the same result. Best regards, Michal Wegrzyn -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 14:03 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException The renderCount increases only when you use non-Ajax requests, i.e. when you re-render the whole page. Make sure that executes Wicket behavior via js uses Wicket.Ajax.** On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: multiple requests and StalePageException
The problem is clear. On Mon, Nov 26, 2012 at 4:54 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: private JSObject window; public void documentUpdated( String newDocumentId ) { window.call( documentUpdated, new String[] { param1, param2 } ); } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 16:51 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException Can you show the code that the applet uses to make requests to the page ? On Mon, Nov 26, 2012 at 4:47 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi Martin, Thanks for a tip. What do you mean by uses Wicket.Ajax.**? Applet till now generated fake event to trigger Wicket ajax behavior. I have just tried calling behavior directly with wicketAjaxGet ( https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html) but I get the same result. Best regards, Michal Wegrzyn -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 14:03 To: users@wicket.apache.org Subject: Re: multiple requests and StalePageException The renderCount increases only when you use non-Ajax requests, i.e. when you re-render the whole page. Make sure that executes Wicket behavior via js uses Wicket.Ajax.** On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote: Hi group, In my Wicket application I have an applet. In the background it requests servlet and finally executes Wicket behavior via js. If one request is performed, then everything works without problems. Lately I have changed applet and now it can do one or three requests. If it performs three requests then StalePageException is thrown, which causes page refreshed and that is not a desired behavior. When I debug difference between render counter and page counter is exactly 2, so I think that issue is connected with two extra applet requests. Do I miss something on the Wicket side? If not, what is the best way to avoid StalePageException in this case? Best regards, Michal Wegrzyn -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
RE: Cloneing Wicket Objects
I stand corrected, Martin is right. We cache our SQL results hence why this is not a problem for us. ~ Thank you, Paul Bors -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, November 26, 2012 3:33 AM To: users@wicket.apache.org Subject: Re: Cloneing Wicket Objects Hi, You cannot add a component twice. A component can have just one parent. I think jQuery clone() should work, but I'm not totally sure. You can use WicketObjects#clone() method to clone any kind of Object. It uses Java Serialization to do it. Just make sure you clone it before adding the component to its parent, because the relation will be cloned too. On Mon, Nov 26, 2012 at 12:53 AM, Paul Bors p...@bors.ws wrote: Can't you crate the navigation panel once and call add() on it twice by passing the same reference to it from within your page hierarchy? On the client side I don't see why you would push this cloning to the client. Just let the page contain the same panel (html/js) via a single reference. You should be fine as long as you handle the db trip in the constructor or your own init() method. ~ Thank you, Paul Bors -Original Message- From: Colin Rogers [mailto:colin.rog...@objectconsulting.com.au] Sent: Sunday, November 25, 2012 6:28 PM To: users@wicket.apache.org Subject: Cloneing Wicket Objects Wicketeers, I was wondering what the best was to duplicate or clone wicket components. I need guidance as to the best way to do this. I have, on my screen two 'navigation panels' that are identical - one at the top of the page, another at the bottom. They contain dropdown choice fields that, when 'onchange' event occurs, it triggers an ajax request that redirects the user to another page. As, in order to create the navigation panels - I have to visit the DB, and create them dynamically, so it doesn't make sense to perform this operation twice. Also they generate a large amount of HTML, in order render them, so it seems sensible to do as much as I can on the client side. The idea was - I generate the components once, and then clone them on the client side. This saves going to the DB twice and rendering them twice. I've attempted to use jquery's clone function as; clone(), clone(true) and clone(true, true) - but none work. The elements are copied, but the ajax actions never execute onchange. Is there another way to do this that works? A more wicket-centric way? 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. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAX not working after migrating from wicket 1.5.5 to 6.3.0
After a lot of tries, here is what I obeserved so far in my envionment. Basically, it appears how the page with AJAX is loaded affects whether AJAX listeners are enabled on the page. Could anyone please take a look at below and let me know why this is the case and what I need to do to fix it? Thanks a lot!! I turned on the web console in my Firefox browser and watched the logging messages. The page with AJAX is http://127.0.0.1:7999/newmetaprofile;. The page that contains a link to the newmetaprofile page is http://127.0.0.1:7999/8770main;. When the newmetaprofile page is loaded by clicking on the newmetaprofile link on the 8770main page, AJAX does not work. Here is the log (after the transition from the 8770main page to the newmetaprofile page, nothing happens) [13:16:44.637] GET http://127.0.0.1:7999/8770main [HTTP/1.1 200 OK 342ms] [13:16:54.010] GET http://127.0.0.1:7999/newmetaprofile [HTTP/1.1 302 Found 2766ms] [13:16:56.886] GET http://127.0.0.1:7999/newmetaprofile?13 [HTTP/1.1 200 OK 37ms] But if I type http://127.0.0.1:7999/newmetaprofile; in the address bar to load the page manually or if I refresh/reload the http://127.0.0.1:7999/newmetaprofile; page, a whole bunch of things happen including the ajax scripts being called: -- [13:18:54.754] GET http://127.0.0.1:7999/newmetaprofile [HTTP/1.1 302 Found 2761ms] [13:18:57.494] GET http://127.0.0.1:7999/newmetaprofile?14 [HTTP/1.1 200 OK 79ms] [13:18:57.621] GET http://127.0.0.1:7999/wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-ver-1353527137996.js [HTTP/1.1 304 Not Modified 300ms] [13:18:57.622] GET http://127.0.0.1:7999/wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1353527137996.js [HTTP/1.1 304 Not Modified 276ms] [13:18:57.622] GET http://127.0.0.1:7999/wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-ver-1353527137996.js [HTTP/1.1 304 Not Modified 290ms] [13:18:57.623] GET http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css [HTTP/1.1 304 Not Modified 165ms] [13:18:57.623] GET http://code.jquery.com/jquery-1.8.3.min.js [HTTP/1.1 304 Not Modified 186ms] [13:18:57.624] GET http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js [HTTP/1.1 304 Not Modified 154ms] ... Subsequently, AJAX behaves as expected, it resets fields when a metaprofile type is selected. I diff'd the newmetaprofile page source for the above two scenarios. Everything is the same, EXCEPT one difference in the generated baseUrl: Wicket.Ajax.baseUrl=newmetaprofile; vs. Wicket.Ajax.baseUrl=newmetaprofile?13; For your reference, the entire header is attached below::: html xmlns:wicket=http://wicket.apache.org/; head title wicket:id=pageTitleCreate Metaprofile/title meta name=viewport content=width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no link rel=stylesheet href=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css; / /head body div id=container div id=header Create Metaprofile /div form id=createMPForm wicket:id=createMPForm method=post action=./newmetaprofile?11-1.IFormSubmitListener-createMPFormdiv style=width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hiddeninput type=hidden name=createMPForm_hf_0 id=createMPForm_hf_0 //div div id=content div id=metaprofile images/asterisk.gif label for=profileType wicket:id=profileTypeLabel class=requiredLabelMetaprofile Type/label select id=profileType name=type wicket:id=type option selected=selected value=Choose One/option option value=OXEOXE/option option value=OXE_WITH_OTOXE_WITH_OT/option option value=OXE_WITH_ICSOXE_WITH_ICS/option option value=OTOT/option /select ... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654234.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: AJAX not working after migrating from wicket 1.5.5 to 6.3.0
Just to add a bit more info. The newmetaprofile link on the 8770main page looks like the following: li Create ./newmetaprofile /li Any suggestions/ideas for me to try would be appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAX-not-working-after-migrating-from-wicket-1-5-5-to-6-3-0-tp4654065p4654235.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
DropDownChoice box does not display the value I selected
I have a DropDownChoice box that loads a list of values on load(), but when I selected a value from the list, the selected value does not show up in the box, even though it appears that getModelObject() does return the correct value (the value I selected). It's just the box does not display it. I use Wicket 6.3.0, locally tested using jetty server 6.1.26 and FireFox 17.0, JQuery Mobile 1.2.0, JQuery 1.8.3. Any suggestions or ideas? Here is the Wicket code: IModelListlt;String oxeNodeModel = null; oxeNodeModel = new LoadableDetachableModelListlt;String() { private static final long serialVersionUID = 1L; @Override protected ListString load() { try { ListString names = null; if ((profile!=null) (profile.getType().equals(MetaProfileType.OXE) || profile.getType().equals(MetaProfileType.OXE_WITH_OT))) names = getOXENodeList(); if (names == null) return Collections.emptyList(); else { return names; } }catch (Exception e) { return Collections.emptyList(); } } }; oxeNodeBox = new DropDownChoice(oxeNode, new PropertyModelString(profile, oxeNodeName), oxeNodeModel); oxeNodeBox.setEnabled(true); oxeNodeBox.setOutputMarkupId(true); add(oxeNodeBox); The html template is: label for=oxeNode wicket:id=oxeNodeLabel class=requiredLabelOXE Node/label select id=oxeNode name=oxeNode wicket:id=oxeNode option selectedOXENode/option /select -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-box-does-not-display-the-value-I-selected-tp4654236.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 fix this error in wicket app
My problem has become worse now, earlier i only had issues selecting all rows on grid but now anything that refreshes the data table grid is giving me error. Any help would be appreciated. I dont have too many Ajax calls in the grid, i am not sure what causes the recursion that it is complaining. see this on Firefox, debug [14:37:28.174] Wicket.Ajax: FunctionsExecuter.processNext: Error on wicket debug: var submitStateCallback = function (columnState) { var attrs = {u:./?5-6.IBehaviorListener.1-homePageTabs-panel-pricingPropertyTabs-panel-fitlerGridPanel-snapshotGridForm-snapshotGrid,c:snapshotGrid827,dep:[function(attrs){return {'columnState': attrs.columnState}}]^}; var params = {}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } InMethod.XTableManager.instance.register(snapshotGrid827, columns, submitStateCallback); })(); ]]/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate encoding=wicket1/evaluateevaluate encoding=wicket1/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluateevaluate/evaluate/ajax-response ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: InternalError: too much recursion, text:
wicket-mousetrap behavior
Would love to get any feedback on a new component I just built. I came across an awesome JS library (http://craig.is/killing/mice) for adding key bindings to a webpage. I immediately thought it would be fun to add it to Mystic Paste (http://mysticpaste.com). And it's now live after doing some work on how to make a behavior to cover most of my use cases. Code available here: https://github.com/kinabalu/wicket-mousetrap Suggestions on additions are welcome, and if you have ideas for other key bindings for the paste bin, I'd be open to those as well. I've listed all the key commands I've added on a recent blog post: http://www.mysticcoders.com/blog/integrating-mousetrap-js-with-wicket/ Cheers and Thanks! To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com ofc: 714-352-0298 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: @kinabalu facebook: http://www.facebook.com/lombardi fan mystic: http://www.facebook.com/mysticcoders flickr: http://www.flickr.com/photos/kinabalu Eco-Tip: Printing e-mails is usually a waste.
Re: WiQuery tabs remain selected across requests?
Stefan, I have added support for AJAX events https://github.com/WiQuery/wiquery/commit/cd1fa658a6bd8bd896b1f46c7750ecb04ee2e034 You can use them to track selected index at server side as tabs.setAjaxSelectEvent(new ITabsAjaxEvent() { private static final long serialVersionUID = 1L; public void onEvent(AjaxRequestTarget target, Tabs tabs, int index) { // store the index on sever side } }); Conversely you can use methods Tabs#select(int index) and Tabs#select(AjaxRequestTarget ajaxRequestTarget, int index) to set back the selected tab. P.S. See also the Tabs#setCookie method (to store selected index in cookie). On Mon, Nov 26, 2012 at 1:51 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Let me see if I can add those features today or tomorrow. On Mon, Nov 26, 2012 at 1:24 PM, Stefan Renz s.r...@efonds.com wrote: Hi Ernesto, thanks for the quick feedback. We're working on top of Wicket/WiQuery 1.5.7. Ciao Stefan Ernesto Reinaldo Barreiro wrote: I see there is a http://api.jqueryui.com/tabs/#option-active which does not seem to be implemented on wiquery (I will add it). So, what you will need is some sort of AJAX version for http://api.jqueryui.com/tabs/#event-activate and on server side record this number (that you will pass as an extra parameter to AJAX request). Which wicket version are you using? On Mon, Nov 26, 2012 at 1:07 PM, Stefan Renz s.r...@efonds.com wrote: In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Avoid session timeout through AjaxSelfUpdatingTimerBehavior
hi, i got a problem with wicket's session timeout. i'm using wicket version 1.4.9. i set the session timeout to 1 minute in the file web.xml. in my case this is necessary to recognize if an user is on-/offline quite fast. if the user closes the browser the session is timed out after 1 minute. i don't want the session to timeout in case the user is hanging around on one of the pages. so what i did is to establish a self updating timer in the following way: add(lblMessages); lblMessages.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(GloCon.TIMER_UPDATE_HEADER))); the label is updated every 30 seconds and part of a panel that is part of all pages. and still i got session timeouts. i can't figure out why!? i searched the web already for a while: the above mentioned solutions is exactly what should work. i found also something about constructors and PageParameters ... but this happens also on pages with PageParameters in the constructor. or is tomcat the problem (version 6)? can you please help me ... regards, tobi -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-session-timeout-through-AjaxSelfUpdatingTimerBehavior-tp4654240.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: Cloneing Wicket Objects
Martin, For some reason JQuery clone doesn't work - even with the withDataAndEvents and deepWithDataAndEvents flags set to true... :/ But - thank you for your suggestion - sounds just the thing - will give it a spin tonight :) Cheers, Col. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, 26 November 2012 7:33 PM To: users@wicket.apache.org Subject: Re: Cloneing Wicket Objects Hi, You cannot add a component twice. A component can have just one parent. I think jQuery clone() should work, but I'm not totally sure. You can use WicketObjects#clone() method to clone any kind of Object. It uses Java Serialization to do it. Just make sure you clone it before adding the component to its parent, because the relation will be cloned too. On Mon, Nov 26, 2012 at 12:53 AM, Paul Bors p...@bors.ws wrote: Can't you crate the navigation panel once and call add() on it twice by passing the same reference to it from within your page hierarchy? On the client side I don't see why you would push this cloning to the client. Just let the page contain the same panel (html/js) via a single reference. You should be fine as long as you handle the db trip in the constructor or your own init() method. ~ Thank you, Paul Bors -Original Message- From: Colin Rogers [mailto:colin.rog...@objectconsulting.com.au] Sent: Sunday, November 25, 2012 6:28 PM To: users@wicket.apache.org Subject: Cloneing Wicket Objects Wicketeers, I was wondering what the best was to duplicate or clone wicket components. I need guidance as to the best way to do this. I have, on my screen two 'navigation panels' that are identical - one at the top of the page, another at the bottom. They contain dropdown choice fields that, when 'onchange' event occurs, it triggers an ajax request that redirects the user to another page. As, in order to create the navigation panels - I have to visit the DB, and create them dynamically, so it doesn't make sense to perform this operation twice. Also they generate a large amount of HTML, in order render them, so it seems sensible to do as much as I can on the client side. The idea was - I generate the components once, and then clone them on the client side. This saves going to the DB twice and rendering them twice. I've attempted to use jquery's clone function as; clone(), clone(true) and clone(true, true) - but none work. The elements are copied, but the ajax actions never execute onchange. Is there another way to do this that works? A more wicket-centric way? 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. - 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 http://jweekend.com/ 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.
AjaxTabPanel stateless is possible?
I would the url of my site without pageId ?2 or ?3 etc. I know that to do this I need to make the page stateless, so I did it for all my pages. But one page have 2 tabs, using AjaxTabbedPanel. I tried to use simple TabbedPanel, but it is not usefull, because so I have that all the page is reloaded, and it is not good, because I have a flashplayer video playing in the page, and when the user change tab, the video is restarted. Does exist a solution? I am ready to put in the url some information to make the page stateless or to store the selected tab. Thank you. Some part of the code: List tabs = new ArrayList(); tabs.add(new AbstractTab(new Model(Info Video)) { public Panel getPanel(String panelId) { return new TabPanel1(panelId); } }); tabs.add(new AbstractTab(new Model(Commenti)) { public Panel getPanel(String panelId) { return new TabPanel2(panelId); } }); tabs.add(new AbstractTab(new Model(mp3)) { public Panel getPanel(String panelId) { return new TabPanel3(panelId); } }); add(new AjaxTabbedPanel(tabs, tabs)); // tabsdx TabPanel di destra: List tabsdx = new ArrayList(); tabsdx.add(new AbstractTab(new Model(Video Correlati)) { public Panel getPanel(String panelId) { return new TabPaneldx1(panelId); } }); tabsdx.add(new AbstractTab(new Model(Video dello stesso autore)) { public Panel getPanel(String panelId) { return new TabPaneldx2(panelId); } }); add(new AjaxTabbedPanel(tabsdx, tabsdx)); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery tabs remain selected across requests?
Stefan, Yes it will make it into the next 1.5.x release. It will be good if you can test it before that, so that we can fix/add anything else you need. On Mon, Nov 26, 2012 at 10:58 PM, Stefan Renz s.r...@efonds.com wrote: Hi Ernesto, fabulous, thanks for the quick solution. I'll try that as soon as I can. Will your commit make it into next official release of WiQuery? Thank you very much for your support. Bye Stefan Ernesto Reinaldo Barreiro wrote: Stefan, I have added support for AJAX events https://github.com/WiQuery/wiquery/commit/cd1fa658a6bd8bd896b1f46c7750ecb04ee2e034 You can use them to track selected index at server side as tabs.setAjaxSelectEvent(new ITabsAjaxEvent() { private static final long serialVersionUID = 1L; public void onEvent(AjaxRequestTarget target, Tabs tabs, int index) { // store the index on sever side } }); Conversely you can use methods Tabs#select(int index) and Tabs#select(AjaxRequestTarget ajaxRequestTarget, int index) to set back the selected tab. P.S. See also the Tabs#setCookie method (to store selected index in cookie). On Mon, Nov 26, 2012 at 1:51 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Let me see if I can add those features today or tomorrow. On Mon, Nov 26, 2012 at 1:24 PM, Stefan Renz s.r...@efonds.com wrote: Hi Ernesto, thanks for the quick feedback. We're working on top of Wicket/WiQuery 1.5.7. Ciao Stefan Ernesto Reinaldo Barreiro wrote: I see there is a http://api.jqueryui.com/tabs/#option-active which does not seem to be implemented on wiquery (I will add it). So, what you will need is some sort of AJAX version for http://api.jqueryui.com/tabs/#event-activate and on server side record this number (that you will pass as an extra parameter to AJAX request). Which wicket version are you using? On Mon, Nov 26, 2012 at 1:07 PM, Stefan Renz s.r...@efonds.com wrote: In principle, yes, that's one part of the solution. However, I need to know which index the page currently displays. How can I get the information, which tab is selected? Ernesto Reinaldo Barreiro wrote: Can you try setDefaultSelectedTabIndex? On Mon, Nov 26, 2012 at 12:55 PM, Stefan Renz s.r...@efonds.com wrote: Hi, we're using WiQuery tabs in our web application to divide information into smaller, logically grouped chunks. Often times, our users will select a few items in a list in order to browse through information. For each of those selected items we present a detail page with WiQuery tabs on them, along with a navigation toolbar to quickly flip through the selected items. Now, when clicking Prev or Next on the navigation toolbar, we swap the information panels with Ajax, but the selected WiQuery tab will of course by default reset itself to the first tab. How can I make the selected tab remain sticky? Is there a way to register for a tab selected event, so that I can manage the selection on the server? Thanks for your help, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Re: AjaxTabPanel stateless is possible?
Hi, I think it is possible but I haven't tried it. TabbedPanel can easily become stateless by using BookmarkablePageLink. AjaxTabbedPanel will need more work. You need to use https://github.com/jolira/wicket-stateless and maybe even add your own Ajax behaviors which work like the ones in this project. On Tue, Nov 27, 2012 at 6:40 AM, Paolo irresistible...@gmail.com wrote: I would the url of my site without pageId ?2 or ?3 etc. I know that to do this I need to make the page stateless, so I did it for all my pages. But one page have 2 tabs, using AjaxTabbedPanel. I tried to use simple TabbedPanel, but it is not usefull, because so I have that all the page is reloaded, and it is not good, because I have a flashplayer video playing in the page, and when the user change tab, the video is restarted. Does exist a solution? I am ready to put in the url some information to make the page stateless or to store the selected tab. Thank you. Some part of the code: List tabs = new ArrayList(); tabs.add(new AbstractTab(new Model(Info Video)) { public Panel getPanel(String panelId) { return new TabPanel1(panelId); } }); tabs.add(new AbstractTab(new Model(Commenti)) { public Panel getPanel(String panelId) { return new TabPanel2(panelId); } }); tabs.add(new AbstractTab(new Model(mp3)) { public Panel getPanel(String panelId) { return new TabPanel3(panelId); } }); add(new AjaxTabbedPanel(tabs, tabs)); // tabsdx TabPanel di destra: List tabsdx = new ArrayList(); tabsdx.add(new AbstractTab(new Model(Video Correlati)) { public Panel getPanel(String panelId) { return new TabPaneldx1(panelId); } }); tabsdx.add(new AbstractTab(new Model(Video dello stesso autore)) { public Panel getPanel(String panelId) { return new TabPaneldx2(panelId); } }); add(new AjaxTabbedPanel(tabsdx, tabsdx)); - 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 http://jweekend.com/
Re: Adding Components to fit markup
Hi, Since the markup is added dynamically it looks like MarkupContainer#autoAdd() is the best match. You'll need to create the MarkupStream yourself. On Tue, Nov 27, 2012 at 3:53 AM, Nick Pratt nbpr...@gmail.com wrote: If I create an empty element (a div) in HTML (via jQuery), and assign it an ID, is it possible to create a Wicket Panel (via an Ajax callback) to replace that element? N -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Avoid session timeout through AjaxSelfUpdatingTimerBehavior
Hi, This should work. Make sure the Ajax call hits the server side, i.e. check that onTimer() method is actually called. Next try with a quickstart application that uses newer versions of both Wicket and Tomcat. On Mon, Nov 26, 2012 at 10:14 PM, Tobi81 tobias.go...@web.de wrote: hi, i got a problem with wicket's session timeout. i'm using wicket version 1.4.9. i set the session timeout to 1 minute in the file web.xml. in my case this is necessary to recognize if an user is on-/offline quite fast. if the user closes the browser the session is timed out after 1 minute. i don't want the session to timeout in case the user is hanging around on one of the pages. so what i did is to establish a self updating timer in the following way: add(lblMessages); lblMessages.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(GloCon.TIMER_UPDATE_HEADER))); the label is updated every 30 seconds and part of a panel that is part of all pages. and still i got session timeouts. i can't figure out why!? i searched the web already for a while: the above mentioned solutions is exactly what should work. i found also something about constructors and PageParameters ... but this happens also on pages with PageParameters in the constructor. or is tomcat the problem (version 6)? can you please help me ... regards, tobi -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-session-timeout-through-AjaxSelfUpdatingTimerBehavior-tp4654240.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 http://jweekend.com/