Re: Loading Velocity Templates
OK, so the iterator does return all combinations, so I guess I have to loop through them and check for their existence. I don't suppose Wicket has anything to do that already since it must be doing something like this with the HTML? On Tue, Jul 21, 2009 at 5:06 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: On Tue, Jul 21, 2009 at 4:17 PM, Andrew Bermanatber...@gmail.com wrote: What exactly do I pass into the path part? Do I pass in a full directory structure or just the name of the file? it doesnt matter - whatever you pass in is whatever you will get back - it is basically a prefix. i havent tried to use this myself, but looking from the source code in wicket it looks like it should work. -igor I've tried this before and I always get a null. Thanks Igor On Tue, Jul 21, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: see if ResourceNameIterator helps -igor On Tue, Jul 21, 2009 at 3:55 PM, Andrew Bermanatber...@gmail.com wrote: Hello, I currently use Velocity templates within my Wicket 1.3 application, and I have been using VelocityPanel.forTemplateResource to locate my resources passing it the actual file URL of the velocity template. However, I now have a need to find the velocity templates in the same way the HTML files are found. In other words, I need to find it based on the default algorithm of: 1. [sourcePath]/name[style][locale].[extension] 2. [sourcePath]/name[locale].[extension] 3. [sourcePath]/name[style].[extension] 4. [sourcePath]/name.[extension] 5. [classPath]/name[style][locale].[extension] 6. [classPath]/name[locale].[extension] 7. [classPath]/name[style].[extension] 8. [classPath]/name.[extension] Each velocity template is named the same as the Page or Panel it is used with. How would I go about loading the velocity template to accomplish this? Thanks for your help, Andrew - 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: Loading Velocity Templates
It looks like ResourceStreamLocator has the logic I'm looking for. Let me give it a shot and I'll let you know if it works. Thanks for your help! On Wed, Jul 22, 2009 at 11:05 AM, Andrew Berman atber...@gmail.com wrote: OK, so the iterator does return all combinations, so I guess I have to loop through them and check for their existence. I don't suppose Wicket has anything to do that already since it must be doing something like this with the HTML? On Tue, Jul 21, 2009 at 5:06 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: On Tue, Jul 21, 2009 at 4:17 PM, Andrew Bermanatber...@gmail.com wrote: What exactly do I pass into the path part? Do I pass in a full directory structure or just the name of the file? it doesnt matter - whatever you pass in is whatever you will get back - it is basically a prefix. i havent tried to use this myself, but looking from the source code in wicket it looks like it should work. -igor I've tried this before and I always get a null. Thanks Igor On Tue, Jul 21, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: see if ResourceNameIterator helps -igor On Tue, Jul 21, 2009 at 3:55 PM, Andrew Bermanatber...@gmail.com wrote: Hello, I currently use Velocity templates within my Wicket 1.3 application, and I have been using VelocityPanel.forTemplateResource to locate my resources passing it the actual file URL of the velocity template. However, I now have a need to find the velocity templates in the same way the HTML files are found. In other words, I need to find it based on the default algorithm of: 1. [sourcePath]/name[style][locale].[extension] 2. [sourcePath]/name[locale].[extension] 3. [sourcePath]/name[style].[extension] 4. [sourcePath]/name.[extension] 5. [classPath]/name[style][locale].[extension] 6. [classPath]/name[locale].[extension] 7. [classPath]/name[style].[extension] 8. [classPath]/name.[extension] Each velocity template is named the same as the Page or Panel it is used with. How would I go about loading the velocity template to accomplish this? Thanks for your help, Andrew - 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: Loading Velocity Templates
I was not able to get it to work with ResourceStreamLocator. Whatever I passed in for the path yielded a null stream. The iterator does work though, so I'm just going to loop through it and check for null. Thanks again Igor! On Wed, Jul 22, 2009 at 11:09 AM, Andrew Berman atber...@gmail.com wrote: It looks like ResourceStreamLocator has the logic I'm looking for. Let me give it a shot and I'll let you know if it works. Thanks for your help! On Wed, Jul 22, 2009 at 11:05 AM, Andrew Berman atber...@gmail.comwrote: OK, so the iterator does return all combinations, so I guess I have to loop through them and check for their existence. I don't suppose Wicket has anything to do that already since it must be doing something like this with the HTML? On Tue, Jul 21, 2009 at 5:06 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: On Tue, Jul 21, 2009 at 4:17 PM, Andrew Bermanatber...@gmail.com wrote: What exactly do I pass into the path part? Do I pass in a full directory structure or just the name of the file? it doesnt matter - whatever you pass in is whatever you will get back - it is basically a prefix. i havent tried to use this myself, but looking from the source code in wicket it looks like it should work. -igor I've tried this before and I always get a null. Thanks Igor On Tue, Jul 21, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: see if ResourceNameIterator helps -igor On Tue, Jul 21, 2009 at 3:55 PM, Andrew Bermanatber...@gmail.com wrote: Hello, I currently use Velocity templates within my Wicket 1.3 application, and I have been using VelocityPanel.forTemplateResource to locate my resources passing it the actual file URL of the velocity template. However, I now have a need to find the velocity templates in the same way the HTML files are found. In other words, I need to find it based on the default algorithm of: 1. [sourcePath]/name[style][locale].[extension] 2. [sourcePath]/name[locale].[extension] 3. [sourcePath]/name[style].[extension] 4. [sourcePath]/name.[extension] 5. [classPath]/name[style][locale].[extension] 6. [classPath]/name[locale].[extension] 7. [classPath]/name[style].[extension] 8. [classPath]/name.[extension] Each velocity template is named the same as the Page or Panel it is used with. How would I go about loading the velocity template to accomplish this? Thanks for your help, Andrew - 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
VelocityTemplate and UTF-8
Hello, I cannot seem to get VelocityPanel to output my files properly. I am embedding vm files within Wicket HTML files using VelocityPanels and no matter how I encode the vm file (UTF-8 encoded or unicode escaped), I am not getting the proper characters displayed when the page is served. I have set the default encoding on the MarkupSettings and I have also created a velocity.properties file with: input.encoding=UTF-8 and output.encoding=UTF-8 and set the proper init params on the servlet. Is there something else I need to do or something I'm doing wrong? I know there must be a lot of non-English people using Wicket so if you guys have the solution, it would be a huge help as I'm really struggling getting international languages to work. Thanks!
Re: VelocityTemplate and UTF-8
I figured it out. For reference, I overrode the parseGeneratedMarkup() method to return true and it all comes out properly. On Wed, Jul 22, 2009 at 12:54 PM, Andrew Berman atber...@gmail.com wrote: Hello, I cannot seem to get VelocityPanel to output my files properly. I am embedding vm files within Wicket HTML files using VelocityPanels and no matter how I encode the vm file (UTF-8 encoded or unicode escaped), I am not getting the proper characters displayed when the page is served. I have set the default encoding on the MarkupSettings and I have also created a velocity.properties file with: input.encoding=UTF-8 and output.encoding=UTF-8 and set the proper init params on the servlet. Is there something else I need to do or something I'm doing wrong? I know there must be a lot of non-English people using Wicket so if you guys have the solution, it would be a huge help as I'm really struggling getting international languages to work. Thanks!
Loading Velocity Templates
Hello, I currently use Velocity templates within my Wicket 1.3 application, and I have been using VelocityPanel.forTemplateResource to locate my resources passing it the actual file URL of the velocity template. However, I now have a need to find the velocity templates in the same way the HTML files are found. In other words, I need to find it based on the default algorithm of: 1. [sourcePath]/name[style][locale].[extension] 2. [sourcePath]/name[locale].[extension] 3. [sourcePath]/name[style].[extension] 4. [sourcePath]/name.[extension] 5. [classPath]/name[style][locale].[extension] 6. [classPath]/name[locale].[extension] 7. [classPath]/name[style].[extension] 8. [classPath]/name.[extension] Each velocity template is named the same as the Page or Panel it is used with. How would I go about loading the velocity template to accomplish this? Thanks for your help, Andrew
Re: Loading Velocity Templates
What exactly do I pass into the path part? Do I pass in a full directory structure or just the name of the file? I've tried this before and I always get a null. Thanks Igor On Tue, Jul 21, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: see if ResourceNameIterator helps -igor On Tue, Jul 21, 2009 at 3:55 PM, Andrew Bermanatber...@gmail.com wrote: Hello, I currently use Velocity templates within my Wicket 1.3 application, and I have been using VelocityPanel.forTemplateResource to locate my resources passing it the actual file URL of the velocity template. However, I now have a need to find the velocity templates in the same way the HTML files are found. In other words, I need to find it based on the default algorithm of: 1. [sourcePath]/name[style][locale].[extension] 2. [sourcePath]/name[locale].[extension] 3. [sourcePath]/name[style].[extension] 4. [sourcePath]/name.[extension] 5. [classPath]/name[style][locale].[extension] 6. [classPath]/name[locale].[extension] 7. [classPath]/name[style].[extension] 8. [classPath]/name.[extension] Each velocity template is named the same as the Page or Panel it is used with. How would I go about loading the velocity template to accomplish this? Thanks for your help, Andrew - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Hiding Components based on style
Cool that's what I was looking for Igor. Thank you! Also, thank you Richard. I know of the CSS route, but I really wanted to not have it show up in the actual HTML as I didn't want someone hacking the form or being able to turn on the link using something like Web Developer in Firefox. Thanks guys! On Fri, Jun 26, 2009 at 11:24 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: so you want to include all possible components in the class, but exclude some in the markup and not have an error? fine, just turn off componentusecheck in debug settings. -igor On Fri, Jun 26, 2009 at 11:13 AM, Andrew Bermanatber...@gmail.com wrote: Right, I know that way, but I don't want to I don't want to do that though Igor. That seems like really bad practice as I add styles constantly and I don't want to have to make a code change every time I add a style. It's much better for me to just modify the HTML and be done with it without having to make code changes. I really think there should be a way to do this with some sort of comment tag or something. Maybe there needs to be a wicket:comment tag where the code inside is evaluated so there are no errors but that the component is hidden. Thanks for your help, Andrew On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: add(new textfield(..) { isvisible() { return getsession.getstyle().equals(foo); }}); -igor On Thu, Jun 25, 2009 at 8:41 PM, Andrew Bermanatber...@gmail.com wrote: I am using Wicket 1.3 and was wondering if there is a way to hide components in the HTML itself. Here's the issue, say I have two forms and two different styles. In one style I want to display all the form fields, however in the other one I want to display only a couple of them. I currently have two HTML files, one for each style, but I can't seem to find a way to hide the form fields aside from using CSS and adding display:none. Is that the only way to do it? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Hiding Components based on style
Right, I know that way, but I don't want to I don't want to do that though Igor. That seems like really bad practice as I add styles constantly and I don't want to have to make a code change every time I add a style. It's much better for me to just modify the HTML and be done with it without having to make code changes. I really think there should be a way to do this with some sort of comment tag or something. Maybe there needs to be a wicket:comment tag where the code inside is evaluated so there are no errors but that the component is hidden. Thanks for your help, Andrew On Thu, Jun 25, 2009 at 8:47 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: add(new textfield(..) { isvisible() { return getsession.getstyle().equals(foo); }}); -igor On Thu, Jun 25, 2009 at 8:41 PM, Andrew Bermanatber...@gmail.com wrote: I am using Wicket 1.3 and was wondering if there is a way to hide components in the HTML itself. Here's the issue, say I have two forms and two different styles. In one style I want to display all the form fields, however in the other one I want to display only a couple of them. I currently have two HTML files, one for each style, but I can't seem to find a way to hide the form fields aside from using CSS and adding display:none. Is that the only way to do it? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Hiding Components based on style
I am using Wicket 1.3 and was wondering if there is a way to hide components in the HTML itself. Here's the issue, say I have two forms and two different styles. In one style I want to display all the form fields, however in the other one I want to display only a couple of them. I currently have two HTML files, one for each style, but I can't seem to find a way to hide the form fields aside from using CSS and adding display:none. Is that the only way to do it? Thanks!
Problem with Crypted URL
I upgraded from 1.3.4 to 1.3.5 and now I am seeing this error all over the place in my log files.. [ERROR] 21:44:24 CryptedUrlWebRequestCodingStrategy - Invalid URL: foo/?x=kSQEmQImbZiH47lvkBIVh0gnXDVDx7-UQqHufLUVx5IVu10xEJYI8UXQ2B0gQCTDdAzJ7rUByXI org.apache.wicket.WicketRuntimeException: Unable to decrypt the text '�$^D�^Bm���o�^R^U�H'\5Cǿ�B��|�^Uǒ^U�]1^P�^H�E��^] @$�t^L��^A�r' at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:145) at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:67) at org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy.decodeURL(CryptedUrlWebRequestCodingStrategy.java:250) at org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy.decode(CryptedUrlWebRequestCodingStrategy.java:98) at org.apache.wicket.Request.getRequestParameters(Request.java:171) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1233) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124) Anyone have any ideas what in the world is causing the jibberish? I am using JDK 6 and Wicket 1.3.5. Thanks, Andrew
Re: Issue with nested forms
Nevermind, error on my part. On Mon, Nov 3, 2008 at 5:20 PM, Andrew Berman [EMAIL PROTECTED] wrote: So even if I do this, all child pages need to add their components to the body and not the direct page itself which to me doesn't seem right. Is there a way to get around this or is there a better way to add a dynamic class to the body tag? On Fri, Oct 31, 2008 at 2:54 PM, Andrew Berman [EMAIL PROTECTED] wrote: Awesome, thanks Igor! On Fri, Oct 31, 2008 at 2:59 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: put the container back, override its istransparentresolver() and return true -igor On Fri, Oct 31, 2008 at 2:50 PM, Andrew Berman [EMAIL PROTECTED] wrote: Actually, i had something more like this: body wicket:id=body form wicket:id=form.../form wicket:child/ /body And in the child: form wicket:id=form/form When I removed the WebMarkupContainer on the body tag, everything worked perfectly. On Fri, Oct 31, 2008 at 2:48 PM, Andrew Berman [EMAIL PROTECTED] wrote: I figured out why it was happening. It was because I put a WebMarkupContainer on the body tag which includes the wicket:child. So I had: body wicket:id=body wicket:child/ /body I need to be able to dynamically update the class attribute on the body tag which exists in the parent page, how can I do this since the way I want to do it doesn't work? On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Really strange... I have something similar on 1.4, although never more that 1 nested form. Could you show us some code and markup cut out? Andrew Berman wrote: Hello, I am using Wicket 1.3.5 and I created a panel which contains a form. I have a parent template page and a child of the parent page, both of which contain an instance of the panel. However, even if I give the panels two different ids, I get an error like: The component [MarkupContainer [Component id = emailLabel]] has the same wicket:id as another component already added at the same level Why is this happening since I am putting them in a different part of the hierarchy? Thanks, Andrew -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue with nested forms
I figured out why it was happening. It was because I put a WebMarkupContainer on the body tag which includes the wicket:child. So I had: body wicket:id=body wicket:child/ /body I need to be able to dynamically update the class attribute on the body tag which exists in the parent page, how can I do this since the way I want to do it doesn't work? On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Really strange... I have something similar on 1.4, although never more that 1 nested form. Could you show us some code and markup cut out? Andrew Berman wrote: Hello, I am using Wicket 1.3.5 and I created a panel which contains a form. I have a parent template page and a child of the parent page, both of which contain an instance of the panel. However, even if I give the panels two different ids, I get an error like: The component [MarkupContainer [Component id = emailLabel]] has the same wicket:id as another component already added at the same level Why is this happening since I am putting them in a different part of the hierarchy? Thanks, Andrew -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue with nested forms
Actually, i had something more like this: body wicket:id=body form wicket:id=form.../form wicket:child/ /body And in the child: form wicket:id=form/form When I removed the WebMarkupContainer on the body tag, everything worked perfectly. On Fri, Oct 31, 2008 at 2:48 PM, Andrew Berman [EMAIL PROTECTED] wrote: I figured out why it was happening. It was because I put a WebMarkupContainer on the body tag which includes the wicket:child. So I had: body wicket:id=body wicket:child/ /body I need to be able to dynamically update the class attribute on the body tag which exists in the parent page, how can I do this since the way I want to do it doesn't work? On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Really strange... I have something similar on 1.4, although never more that 1 nested form. Could you show us some code and markup cut out? Andrew Berman wrote: Hello, I am using Wicket 1.3.5 and I created a panel which contains a form. I have a parent template page and a child of the parent page, both of which contain an instance of the panel. However, even if I give the panels two different ids, I get an error like: The component [MarkupContainer [Component id = emailLabel]] has the same wicket:id as another component already added at the same level Why is this happening since I am putting them in a different part of the hierarchy? Thanks, Andrew -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Issue with nested forms
Hello, I am using Wicket 1.3.5 and I created a panel which contains a form. I have a parent template page and a child of the parent page, both of which contain an instance of the panel. However, even if I give the panels two different ids, I get an error like: The component [MarkupContainer [Component id = emailLabel]] has the same wicket:id as another component already added at the same level Why is this happening since I am putting them in a different part of the hierarchy? Thanks, Andrew
Issues in Wicket Filter
So, I'm having a problem with Wicket in that it is ignoring query string parameters. There are two problems. Here is the use case for problem 1: 1. Go to http://foo.com/yourapp?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In either method you will never get the id. It always comes out null. I looked in the WicketFilter code and there is all this URL manipulation with forward slash going on. Why? I compared this to WicketServlet in 1.2and there is nothing about all this forward slash stuff. So, if you change the url to http://foo.com/yourapp/?id=2 you do get the id. That makes no sense. This broke functionality from Wicket 1.2 and there is nothing about this stuff in the migration guide. So problem 2: 1. Go to http://foo.com/yourapp/?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In newRequestCycle, call session.invalidateNow(); 4. When it first hits newRequestCycle, you have the id. But after it calls session.invalidateNow(), the WicketFilter redirects back to your homepage and goes back to newRequestCycle and then to newSession. This second time it hits these methods, the id comes out null. Again, the WicketFilter code ignores query string params. Why? Doesn't make sense and again broke functionality that was working in Wicket 1.2 and was never documented. I have tried all the different IRequestTargetUrlCodingStrategies and none of them fix this problem. It appears to be a problem in the WicketFilter code in ignoring query string params. Any thoughts on this? Thanks!
Re: Issues in Wicket Filter
I was able to fix my issue by making sure that the home page was not mounted to any coding strategy. However, the / issue is still there, but I think I can get around it with Apache. Still this should be in the migration guide, because both problems broke functionality that worked in 1.2 On Wed, Mar 12, 2008 at 10:58 AM, Andrew Berman [EMAIL PROTECTED] wrote: So, I'm having a problem with Wicket in that it is ignoring query string parameters. There are two problems. Here is the use case for problem 1: 1. Go to http://foo.com/yourapp?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In either method you will never get the id. It always comes out null. I looked in the WicketFilter code and there is all this URL manipulation with forward slash going on. Why? I compared this to WicketServlet in 1.2 and there is nothing about all this forward slash stuff. So, if you change the url to http://foo.com/yourapp/?id=2 you do get the id. That makes no sense. This broke functionality from Wicket 1.2 and there is nothing about this stuff in the migration guide. So problem 2: 1. Go to http://foo.com/yourapp/?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In newRequestCycle, call session.invalidateNow(); 4. When it first hits newRequestCycle, you have the id. But after it calls session.invalidateNow(), the WicketFilter redirects back to your homepage and goes back to newRequestCycle and then to newSession. This second time it hits these methods, the id comes out null. Again, the WicketFilter code ignores query string params. Why? Doesn't make sense and again broke functionality that was working in Wicket 1.2and was never documented. I have tried all the different IRequestTargetUrlCodingStrategies and none of them fix this problem. It appears to be a problem in the WicketFilter code in ignoring query string params. Any thoughts on this? Thanks!
Re: Issues in Wicket Filter
BTW - The slash problem is Line 255 of WicketFilter. It just completely disregards the query string... final String redirectUrl = servletRequest.getRequestURI() + /; https://issues.apache.org/jira/browse/WICKET-1416 On Wed, Mar 12, 2008 at 12:36 PM, Andrew Berman [EMAIL PROTECTED] wrote: I was able to fix my issue by making sure that the home page was not mounted to any coding strategy. However, the / issue is still there, but I think I can get around it with Apache. Still this should be in the migration guide, because both problems broke functionality that worked in 1.2 On Wed, Mar 12, 2008 at 10:58 AM, Andrew Berman [EMAIL PROTECTED] wrote: So, I'm having a problem with Wicket in that it is ignoring query string parameters. There are two problems. Here is the use case for problem 1: 1. Go to http://foo.com/yourapp?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In either method you will never get the id. It always comes out null. I looked in the WicketFilter code and there is all this URL manipulation with forward slash going on. Why? I compared this to WicketServlet in 1.2 and there is nothing about all this forward slash stuff. So, if you change the url to http://foo.com/yourapp/?id=2 you do get the id. That makes no sense. This broke functionality from Wicket 1.2 and there is nothing about this stuff in the migration guide. So problem 2: 1. Go to http://foo.com/yourapp/?id=2 2. In your application class override newRequestCycle and newSession and put breakpoints in there 3. In newRequestCycle, call session.invalidateNow(); 4. When it first hits newRequestCycle, you have the id. But after it calls session.invalidateNow(), the WicketFilter redirects back to your homepage and goes back to newRequestCycle and then to newSession. This second time it hits these methods, the id comes out null. Again, the WicketFilter code ignores query string params. Why? Doesn't make sense and again broke functionality that was working in Wicket 1.2and was never documented. I have tried all the different IRequestTargetUrlCodingStrategies and none of them fix this problem. It appears to be a problem in the WicketFilter code in ignoring query string params. Any thoughts on this? Thanks!
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
For the record, I was able to accomplish what I want a lot easier using OnChangeAjaxBehavior. On Sat, Mar 8, 2008 at 3:24 PM, Andrew Berman [EMAIL PROTECTED] wrote: I'm doing a custom autocomplete and simply wanted to use AbstractAutoCompleteBehavior to at least pass me back the search term. I want to return a JavaScript call with the results which opens up a custom results panel. I'm not looking to pass back HTML with the results. I think Wicket should either change the behavior to use the same pipeline as Ajax event or make the respond method final and make sure that AjaxTargetRequest.get() returns null or an exception. On Sat, Mar 8, 2008 at 7:35 AM, Ryan Sonnek [EMAIL PROTECTED] wrote: FYI: you might want to check out the wicketstuff-scriptaculous auto complete component instead. http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior On Sat, Mar 8, 2008 at 6:38 AM, i ii [EMAIL PROTECTED] wrote: that does suck! why would wicket use a different pipeline??? that is misleading!!! Date: Sat, 8 Mar 2008 00:21:26 -0800 From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: Re: Javascript not evaluating with AbstractAutoCompleteBehavior Oh, that sucks. That's VERY misleading because I can override respond and I have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid object. Doesn't really make much sense that a different pipeline would be used. I guess I'll have to come up with a better solution using WicketAjaxEvent. Thanks for your help! On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp [EMAIL PROTECTED] wrote: The autocomplete component doesn't use the wicket ajax pipeline so that ajaxrequesttarget methods will not work for request invoked by the autocomplete behavior. -Matej On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman [EMAIL PROTECTED] wrote: Hello, If I have the following code: textField.add(new AbstractAutoCompleteBehavior() { /** * */ private static final long serialVersionUID = 1L; @Override protected void onRequest(final String input, RequestCycle requestCycle) { } @Override protected void respond(AjaxRequestTarget target) { target.appendJavascript(alert(\hello\);); } }); When the page renders, the textfield is calling this event and I see the response in the Wicket debug box, but the response is never being parsed and the alert never shows up. Am I missing something here? I tested using an AjaxEventBehavior with onkeypress and it works great. The only problem is that I have no way of getting the text typed into the text field, which is why I used the auto complete stuff. Any thoughts? Thanks for your help! -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
Oh, that sucks. That's VERY misleading because I can override respond and I have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid object. Doesn't really make much sense that a different pipeline would be used. I guess I'll have to come up with a better solution using WicketAjaxEvent. Thanks for your help! On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp [EMAIL PROTECTED] wrote: The autocomplete component doesn't use the wicket ajax pipeline so that ajaxrequesttarget methods will not work for request invoked by the autocomplete behavior. -Matej On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman [EMAIL PROTECTED] wrote: Hello, If I have the following code: textField.add(new AbstractAutoCompleteBehavior() { /** * */ private static final long serialVersionUID = 1L; @Override protected void onRequest(final String input, RequestCycle requestCycle) { } @Override protected void respond(AjaxRequestTarget target) { target.appendJavascript(alert(\hello\);); } }); When the page renders, the textfield is calling this event and I see the response in the Wicket debug box, but the response is never being parsed and the alert never shows up. Am I missing something here? I tested using an AjaxEventBehavior with onkeypress and it works great. The only problem is that I have no way of getting the text typed into the text field, which is why I used the auto complete stuff. Any thoughts? Thanks for your help! -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
I'm doing a custom autocomplete and simply wanted to use AbstractAutoCompleteBehavior to at least pass me back the search term. I want to return a JavaScript call with the results which opens up a custom results panel. I'm not looking to pass back HTML with the results. I think Wicket should either change the behavior to use the same pipeline as Ajax event or make the respond method final and make sure that AjaxTargetRequest.get() returns null or an exception. On Sat, Mar 8, 2008 at 7:35 AM, Ryan Sonnek [EMAIL PROTECTED] wrote: FYI: you might want to check out the wicketstuff-scriptaculous auto complete component instead. http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior On Sat, Mar 8, 2008 at 6:38 AM, i ii [EMAIL PROTECTED] wrote: that does suck! why would wicket use a different pipeline??? that is misleading!!! Date: Sat, 8 Mar 2008 00:21:26 -0800 From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: Re: Javascript not evaluating with AbstractAutoCompleteBehavior Oh, that sucks. That's VERY misleading because I can override respond and I have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid object. Doesn't really make much sense that a different pipeline would be used. I guess I'll have to come up with a better solution using WicketAjaxEvent. Thanks for your help! On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp [EMAIL PROTECTED] wrote: The autocomplete component doesn't use the wicket ajax pipeline so that ajaxrequesttarget methods will not work for request invoked by the autocomplete behavior. -Matej On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman [EMAIL PROTECTED] wrote: Hello, If I have the following code: textField.add(new AbstractAutoCompleteBehavior() { /** * */ private static final long serialVersionUID = 1L; @Override protected void onRequest(final String input, RequestCycle requestCycle) { } @Override protected void respond(AjaxRequestTarget target) { target.appendJavascript(alert(\hello\);); } }); When the page renders, the textfield is calling this event and I see the response in the Wicket debug box, but the response is never being parsed and the alert never shows up. Am I missing something here? I tested using an AjaxEventBehavior with onkeypress and it works great. The only problem is that I have no way of getting the text typed into the text field, which is why I used the auto complete stuff. Any thoughts? Thanks for your help! -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javascript not evaluating with AbstractAutoCompleteBehavior
Hello, If I have the following code: textField.add(new AbstractAutoCompleteBehavior() { /** * */ private static final long serialVersionUID = 1L; @Override protected void onRequest(final String input, RequestCycle requestCycle) { } @Override protected void respond(AjaxRequestTarget target) { target.appendJavascript(alert(\hello\);); } }); When the page renders, the textfield is calling this event and I see the response in the Wicket debug box, but the response is never being parsed and the alert never shows up. Am I missing something here? I tested using an AjaxEventBehavior with onkeypress and it works great. The only problem is that I have no way of getting the text typed into the text field, which is why I used the auto complete stuff. Any thoughts? Thanks for your help!
Re: Exception occurring in 1.3.1
No, I'm not using Wicket-Stuff. I am using: 1. wicket-1.3.1.jar 2. wicket-datetime-1.3.1.jar 3. wicket-extensions-1.3.1.jar 4. wicket-ioc-1.3.1.jar 5. wicket-spring-1.3.1.jar 6. wicket-spring-annot-1.3.1.jar 7. wicket-velocity-1.3.1.jar On Feb 10, 2008 11:14 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: What additional (wicket stuff?) components are you using? Martijn On 2/10/08, Andrew Berman [EMAIL PROTECTED] wrote: I never explicitly reference any WIcket JS in my html. Whatever the Java code spits out for JS references is all I'm using. I searched my code and I'm not using a single reference any more to the wicket.* packages. I'm not really sure what is going on. On Feb 10, 2008 5:52 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: But your javascript/page or something else is referencing old wicket 1.2style Wicket-ajax javascript resource. java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior Which is not *org.apache.*wicket Martijn On 2/10/08, Andrew Berman [EMAIL PROTECTED] wrote: FYI - I do not have any old wicket jars in the classpath, they're all 1.3.1versions On Feb 9, 2008 8:41 PM, Andrew Berman [EMAIL PROTECTED] wrote: Anyone else getting this exception: [ERROR] 23:06:32 SharedResourceRequestTarget - shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js not found [ERROR] 23:08:24 SharedResourceRequestTarget - unable to lazily register shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket- ajax.js java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1204) at org.apache.wicket.application.DefaultClassResolver.resolveClass (DefaultClassResolver.java:103) at org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond (SharedResourceRequestTarget.java:146) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond (AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond( RequestCycle.java:1172) at org.apache.wicket.RequestCycle.step(RequestCycle.java :1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java :1316) at org.apache.wicket.RequestCycle.request( RequestCycle.java :493) at org.apache.wicket.protocol.http.WicketFilter.doGet( WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketServlet.doGet( WicketServlet.java:121) -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1 -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
Re: Exception occurring in 1.3.1
I never explicitly reference any WIcket JS in my html. Whatever the Java code spits out for JS references is all I'm using. I searched my code and I'm not using a single reference any more to the wicket.* packages. I'm not really sure what is going on. On Feb 10, 2008 5:52 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: But your javascript/page or something else is referencing old wicket 1.2style Wicket-ajax javascript resource. java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior Which is not *org.apache.*wicket Martijn On 2/10/08, Andrew Berman [EMAIL PROTECTED] wrote: FYI - I do not have any old wicket jars in the classpath, they're all 1.3.1versions On Feb 9, 2008 8:41 PM, Andrew Berman [EMAIL PROTECTED] wrote: Anyone else getting this exception: [ERROR] 23:06:32 SharedResourceRequestTarget - shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js not found [ERROR] 23:08:24 SharedResourceRequestTarget - unable to lazily register shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1204) at org.apache.wicket.application.DefaultClassResolver.resolveClass (DefaultClassResolver.java:103) at org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond (SharedResourceRequestTarget.java:146) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond (AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond( RequestCycle.java:1172) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java :1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java :493) at org.apache.wicket.protocol.http.WicketFilter.doGet( WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketServlet.doGet( WicketServlet.java:121) -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
Exception occurring in 1.3.1
Anyone else getting this exception: [ERROR] 23:06:32 SharedResourceRequestTarget - shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js not found [ERROR] 23:08:24 SharedResourceRequestTarget - unable to lazily register shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1204) at org.apache.wicket.application.DefaultClassResolver.resolveClass( DefaultClassResolver.java:103) at org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond (SharedResourceRequestTarget.java:146) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond( AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond( RequestCycle.java:1172) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet( WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketServlet.doGet( WicketServlet.java:121)
Re: Exception occurring in 1.3.1
FYI - I do not have any old wicket jars in the classpath, they're all 1.3.1versions On Feb 9, 2008 8:41 PM, Andrew Berman [EMAIL PROTECTED] wrote: Anyone else getting this exception: [ERROR] 23:06:32 SharedResourceRequestTarget - shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js not found [ERROR] 23:08:24 SharedResourceRequestTarget - unable to lazily register shared resource wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js java.lang.ClassNotFoundException: wicket.ajax.AbstractDefaultAjaxBehavior at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass( WebappClassLoader.java:1204) at org.apache.wicket.application.DefaultClassResolver.resolveClass (DefaultClassResolver.java:103) at org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond (SharedResourceRequestTarget.java:146) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond (AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond( RequestCycle.java:1172) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet( WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketServlet.doGet( WicketServlet.java:121)
Migration issue from 1.2.6 to 1.3
Hey guys, I am having an issue migrating from 1.2.6 to 1.3. I changed my Application class so it would compile for 1.3 and the method in question is newRequestCycle(Request request, Response response). Before I was looking at the URL and based on the URL selecting a skin for the site and logging in as a particular user which creates the new session. With 1.3 I am now getting an exception of java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle. Is there some other method I can use to do the URL testing and creating of the session? Thanks, Andew