RE: Appending to CSS url to prevent caching.
You could just add your own cache buster. You could do something like: String cachebuster = something that will always be unique - maybe time stamp; response.renderCSSReference(style/theme.css? + cachebuster); not sure if this will bust the cache because the file is really the same. -or- String cachebuster = something that will always be unique - maybe time stamp; response.renderCSSReference(style/theme- + cachebuster + .css); Then you just need a url rewrite rule to change it back to style/theme.css on the server. I use something similar to this and it works great. -Original Message- From: dickster [mailto:derek.i...@gmail.com] Sent: Tuesday, October 02, 2012 5:09 PM To: users@wicket.apache.org Subject: Re: Appending to CSS url to prevent caching. sorry, i didn't give a great example. here's something better. response.renderCSSReference(style/theme.css); it renders the link rel=stylesheet type=text/css href=style/theme.css/ html without the version parameter appended. maybe i need to do something like... response.renderCssReference(new CachingReference(style/theme.css))??? thanks, derek. On Tue, Oct 2, 2012 at 4:31 PM, Martin Grigorov-4 [via Apache Wicket] ml-node+s1842946n4652625...@n4.nabble.com wrote: On Tue, Oct 2, 2012 at 6:46 PM, dickster [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=0 wrote: i tried using... getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy(new MessageDigestResourceVersion())); ...but not all of my urls are rewritten. the wiquery ones are but the one's i've added via... renderHead(response) { response.renderCssReference(blah); What kind of CSS this produces ? I think this generates: style blah /style directly in the page markup. If I'm correct then there is no need to add anti-caching here because next render of the page will deliver whatever is needed. Only external file resources can be cached. } ...don't get appended with version MD5. do i have to use different technique for adding them? (is my current way of adding them not the preferred way?) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-pre vent-caching-tp4652508p4652618.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=1 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=2 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=3 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=4 -- If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-pre vent-caching-tp4652508p4652625.html To unsubscribe from Appending to CSS url to prevent caching., click herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.j tp?macro=unsubscribe_by_codenode=4652508code=ZGVyZWsuaXBvZEBnbWFpbC5 jb218NDY1MjUwOHwtMjM5OTAwMTA0 . NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.j tp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabbl e.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamesp ace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscrib ers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_in stant_email%21nabble%3Aemail.naml -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-prevent-caching-tp4652508p4652626.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Anybody is having problems with Wicket and Facebook Like button?
We have been using the Like button on one of our client's sites. I have not been told of or noticed any problems with it. I believe we are removing the JSESSIONID as well. -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Thursday, July 05, 2012 2:47 PM To: users@wicket.apache.org Subject: Re: Anybody is having problems with Wicket and Facebook Like button? Sorry for pushing this again, but this is a huge issue for us. Is anybody having problems with Facebook Like button? On Tue, Jul 3, 2012 at 3:34 PM, Alec Swan alecs...@gmail.com wrote: Hello, We started receiving complaints from users saying that Facebook Like buttons don't work on our web site anymore. I don't know what happened on the Facebook side but now we are seeing the following errors when user clicks Like button, e.g. on http://galecsy.com:88/lrm/ms/oid/74989: The page at http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1F BAE4A7B21CA0FC7B8B10BB21EF1 could not be reached. I read SEO - Search Engine Optimization and overwrote newWebResponse to remove JSESSIONID, however it looks like JSESSIONID is still being added somewhere, probably Tomcat. I know this is not directly related to Wicket, but I am wondering how other Wicket users handled interaction with Facebook Like button. 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: Redirect to Wicket page with 301 Moved Permanently
Are you using Apache HTTPD in front of your app server? If so, you can just use a Rewrite Rule to send the 301 redirect with the new URL. You may want to look into your app server to see if url rewriting is an option. -Original Message- From: jarnis [mailto:jarnis.bertel...@exedio.com] Sent: Monday, May 14, 2012 5:56 AM To: users@wicket.apache.org Subject: Redirect to Wicket page with 301 Moved Permanently Hey guys I'm trying to make a redirect form an old url to a new one. The browser url should be changed to the new one and the response code for the original request to the old url should be 301 Moved permanently so search engines will forget the old url. Making the redirect by throwing a RestartResponseException works fine, except I can't change the response code from 302 Moved Temporarily to 301 Moved Permanetly I've also tried using the RedirectToUrlException, where setting the response code is easy, but I have problems getting it to construct a correct relative url so I don't have to hard code it to a specific host name. What is the best way to solve this? Thanks in advance Jarnis -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-to-Wicket-page-with-301-Moved-Permanently-tp4631888.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Built with Wicket: showcases for Wicket applications
Thanks for the reminder. FYI... whoever built ZipGrocery - you are running your site with the ajax debugger still on. -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Thursday, April 12, 2012 5:49 AM To: users@wicket.apache.org Subject: Built with Wicket: showcases for Wicket applications Built with Wicket is Apache Wicket's portfolio blog showcasing what our community has created with your favorite web framework. But why only see what others are building when you can share your own creation? Submit your application to Built with Wicket. Your application doesn't necessarily need to be publicly accessible, but we do want a description of what your application does and a screenshot. http://builtwithwicket.tumblr.com Share the love, share your application at Built with Wicket! - 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
wicketstuff.org - down
Wicketstuff.org appears to be down. Any ideas on when it will be back up?
RE: Favicon best practice
I just put the favicon.ico at the root of the WebContent directory and don't specify anything in the HTML. I believe browsers look in the root unless specified differently in the html (like you are doing). BTW... app is on Apache + Tomcat and runs as the root app of the tomcat instance. -Original Message- From: Ian Marshall [mailto:ianmarshall...@gmail.com] Sent: Friday, March 30, 2012 4:14 PM To: users@wicket.apache.org Subject: Re: Favicon best practice With Wicket 1.5.5, I have tried: In the HTML of my base page I have: link rel=shortcut icon type=image/x-icon href=favicon.ico/ and in my WebApplication-descended application class, I have: @Override protected void init() { super.init(); ... PackageResourceReference prrFavicon = new PackageResourceReference( ResourcesLocator.class, favicon.ico); mountResource(favicon.ico, prrFavicon); } Sadly, the favicon shown remains that stored in web/favicon.ico, not the favicon.ico file stored in the same folder as my ResourcesLocator class. Oh well, I shall just live with the favicon in my web folder, and leave the other one in place just in case. Ian Marshall wrote Alas I am getting MidasTouchCodingExceptions. I tried protected void init() { super.init(); ... // New code ResourceReference rrefFavicon = new ResourceReference( ResourcesLocator.class, favicon.ico); IMountableRequestTargetUrlCodingStrategy mrtURLCodingStrategy = new SharedResourceRequestTargetUrlCodingStrategy(favicon.ico, rrefFavicon.getSharedResourceKey()); // One of: mount(mrtURLCodingStrategy); mountSharedResource(favicon.ico, mrtURLCodingStrategy.getMountPath()); } with link rel=shortcut icon href=[/]favicon.ico type=image/x-icon/ but to no avail. I shall try your suggestion when 1.5 comes out, which I am looking forward to. Thank you again for your suggestions. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4520242.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Repalcement of servlets in wicket.
I would stop using 1.4.10 as it is very old at this point. If you are just starting out I would use 1.5.x where x is the latest revision. If you need to stay in the 1.4.x world then I would go with 1.4.20 which I think is the most current version. -Original Message- From: SudeepShakya [mailto:shakyasud...@live.com] Sent: Thursday, March 29, 2012 6:08 AM To: users@wicket.apache.org Subject: Re: Repalcement of servlets in wicket. I am using version 1.4.10 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repalcement-of-servlets-in-wicket-tp4514480p4514980.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Event handling and swapping panels
I want to swap panels using the event model in 1.5. This is very similar to the panel swapping code (wicket 1.4.x) found in the Apache Wicket Cookbook but uses the event model instead. The problem is I can't set the panel equal to its replacement, like you would in 1.4.x. This is found on the line marked * THIS IS NOT POSSIBLE *. How would you go about doing this? Is it even possible? Component workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyFirstPanel(this.getId()); break; default: replacement = this; break; } this.replaceWith(replacement); this. = replacement; // ** THIS IS NOT POSSIBLE - HOW WOULD I DO THIS *** this.setOutputMarkupId(true); AjaxRequestTarget target = e.getTarget(); target.add(this); } super.onEvent(event); } workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink firsttab = new AjaxLink(firsttab) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent (target, MyPanelEvent.PANEL1)); } }; firsttab.setOutputMarkupId(true); firsttab.setMarkupId(firsttab ); add(firsttab);
RE: Event handling and swapping panels
Thanks. But what does OuterPanelClass refer to in my example? I don't think either of these are right: MyEmptyPanel.this.panel.replaceWith(replacement); -or- MyPage.this.panel.replaceWith(replacement); Or do I need to define workingPanel as a private member of my page class and then have: MyPage.this.workingPanel.replaceWith(replacement); MyPage.this.workingPanel = replacement; -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:07 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels OuterPanelClass.this.panel.replaceWith(replacement); OuterPanelClass.this.panel=replacement; -igor On Wed, Mar 28, 2012 at 11:33 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I want to swap panels using the event model in 1.5. This is very similar to the panel swapping code (wicket 1.4.x) found in the Apache Wicket Cookbook but uses the event model instead. The problem is I can't set the panel equal to its replacement, like you would in 1.4.x. This is found on the line marked * THIS IS NOT POSSIBLE *. How would you go about doing this? Is it even possible? Component workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyFirstPanel(this.getId()); break; default: replacement = this; break; } this.replaceWith(replacement); this. = replacement; // ** THIS IS NOT POSSIBLE - HOW WOULD I DO THIS *** this.setOutputMarkupId(true); AjaxRequestTarget target = e.getTarget(); target.add(this); } super.onEvent(event); } workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink firsttab = new AjaxLink(firsttab) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent (target, MyPanelEvent.PANEL1)); } }; firsttab.setOutputMarkupId(true); firsttab.setMarkupId(firsttab ); add(firsttab); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Event handling and swapping panels
Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyPanel1(this.getId()); break; case MyPanelEvent.PANEL2: replacement = new MyPanel2(this.getId()); break; case MyPanelEvent.PANEL3: replacement = new MyPanel3(this.getId()); break; default: replacement = Admin.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); // IS THIS RIGHT? Admin.this.workingPanel = replacement; // IS THIS RIGHT? this.setOutputMarkupId(true); target.add(this); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); // place-holder for future javascript to be called } super.onEvent(event); } }; workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:29 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels paste your entire panel/page class... -igor On Wed, Mar 28, 2012 at 12:15 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Thanks. But what does OuterPanelClass refer to in my example? I don't think either of these are right: MyEmptyPanel.this.panel.replaceWith(replacement); -or- MyPage.this.panel.replaceWith(replacement); Or do I need to define workingPanel as a private member of my page class and then have: MyPage.this.workingPanel.replaceWith(replacement); MyPage.this.workingPanel = replacement; -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:07 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels
RE: Event handling and swapping panels
Only problem is that it is not working. The panels never update to the new panels. I can see that the onEvent fires as the javascript alert is shown. But the javascript is only shown the first time I click a link. After the first click, all the links call their onClick method and send the event out but the event is never picked up. Does every panel need to have its own onEvent method to listen for the events. If so, I think the old method of handling ajax is going to be easier. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:49 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels that is correct -igor On Wed, Mar 28, 2012 at 12:41 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyPanel1(this.getId()); break; case MyPanelEvent.PANEL2: replacement = new MyPanel2(this.getId()); break; case MyPanelEvent.PANEL3: replacement = new MyPanel3(this.getId()); break; default: replacement = Admin.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); // IS THIS RIGHT? Admin.this.workingPanel = replacement; // IS THIS RIGHT? this.setOutputMarkupId(true); target.add(this); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); // place-holder for future javascript to be called } super.onEvent(event); } }; workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:29 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels paste your entire panel/page class... -igor
RE: Event handling and swapping panels
Thank you Igor and Francois!! This solved my problem and it is working perfectly now. -Original Message- From: Francois Meillet [mailto:qq...@gmail.com] Sent: Wednesday, March 28, 2012 4:45 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels Unless you override the onEvent method for each panel (MyPanel1, MyPanel2 and MyPanel3) , only the first working panel will manage the event. one solution would be : public class Admin extends WebPage { @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent yourEvent = (MyPanelEvent) event.getPayload(); showSelectedPanel(yourEvent.getTarget(), yourEvent); } else { // your code here } } private void showSelectedPanel(AjaxRequestTarget target, MyPanelEvent e) { Component replacement; switch (e.getType()) { case PANEL1: replacement = new MyPanel1(workingPanel); // break; case PANEL2: replacement = new MyPanel2(workingPanel); break; case PANEL3: replacement = new MyPanel3(workingPanel); break; default: replacement = Test333.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); Admin.this.workingPanel = replacement; replacement.setOutputMarkupId(true); target.add(replacement); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); } public void init() { workingPanel = new PanelAAA(workingPanel); workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } François Le 28 mars 2012 à 22:35, Jeffrey Schneller a écrit : Only problem is that it is not working. The panels never update to the new panels. I can see that the onEvent fires as the javascript alert is shown. But the javascript is only shown the first time I click a link. After the first click, all the links call their onClick method and send the event out but the event is never picked up. Does every panel need to have its own onEvent method to listen for the events. If so, I think the old method of handling ajax is going to be easier. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:49 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels that is correct -igor On Wed, Mar 28, 2012 at 12:41 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1
LDM - correct construction
Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } }
RE: LDM - correct construction
My service implementation uses hibernate dao objects which should be managing its own connections via the c3p0 connection pool. All my service objects and Dao objects are marked as singletons in my Spring applicationContext.xml file. I don't think any of my transactions are failing as it would most likely throw an exception if the there was a problem performing a transactions and all exceptions are logged (at least I believe they are). I will most likely put the following c3p0 settings in place and wait to see what comes out of this in production. c3p0.unreturnedConnectionTimeout=30 c3p0.debugUnreturnedConnectionStackTraces=true This should give me a stack trace of what checked out a connection, where that connection hasn't been returned to the pool in 30 seconds. It will be a slight performance hit on production but I should be able to find the problem very quickly. Thanks. Jeff -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:04 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction Jeffrey, That won't prevent a connection from being released. The LDM holds a reference to the page, and the page has a serializable proxy to the service implementation. No problem there. Injecting the service into the LDM is only an advantage if you want to share it among pages; then the LDM can be static and its page reference goes away. It sounds like your service implementation may have an issue. Does your service manage its own connections? If so, is it a singleton? Other than that, I'd guess there's a bug in your transaction management such that a transaction gets started but not finished. HTH, Dan On Wed, Mar 21, 2012 at 1:45 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: LDM - correct construction
The application is using the open-session-in-view pattern which is what makes this so troubling to figure out. -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:44 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction That sounds like a good strategy. Generally speaking, applications use an open-session-in-view pattern which makes it easy to ensure that the Hibernate session gets closed. As long as that happens, the (mis)handling of transactions shouldn't cause your symptoms. On Wed, Mar 21, 2012 at 2:31 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: My service implementation uses hibernate dao objects which should be managing its own connections via the c3p0 connection pool. All my service objects and Dao objects are marked as singletons in my Spring applicationContext.xml file. I don't think any of my transactions are failing as it would most likely throw an exception if the there was a problem performing a transactions and all exceptions are logged (at least I believe they are). I will most likely put the following c3p0 settings in place and wait to see what comes out of this in production. c3p0.unreturnedConnectionTimeout=30 c3p0.debugUnreturnedConnectionStackTraces=true This should give me a stack trace of what checked out a connection, where that connection hasn't been returned to the pool in 30 seconds. It will be a slight performance hit on production but I should be able to find the problem very quickly. Thanks. Jeff -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:04 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction Jeffrey, That won't prevent a connection from being released. The LDM holds a reference to the page, and the page has a serializable proxy to the service implementation. No problem there. Injecting the service into the LDM is only an advantage if you want to share it among pages; then the LDM can be static and its page reference goes away. It sounds like your service implementation may have an issue. Does your service manage its own connections? If so, is it a singleton? Other than that, I'd guess there's a bug in your transaction management such that a transaction gets started but not finished. HTH, Dan On Wed, Mar 21, 2012 at 1:45 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } } - 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
Grouped ListView
I am looking to create a grouped listview where each group only contains a specific number of items. For example: I have a list of 5 items and I want each group to have 3 items in it. I would expect the html to look something like the following: div id=list div class=group div class=item div class=item div class=item /div div class=group div class=item div class=item /div /div Any ideas on how this can be done? I obviously can use a listview and get the entire list displayed without the grouping but I need to add the grouping. Is there a repeater that does such a thing? Thanks.
RE: Wicket in a Dot Net World
I know it is overly simplistic but you can almost think of the .aspx and the .aspx.c code-behind file as the .html and the .java file in Wicket if it will make you feel any better. It is not that simple but it is quick way that our junior .NET developers can relate to what the Java folks do in Wicket. In the end .NET at least C# is very similar to Java so it is a somewhat easy learning curve [if you need to make the switch]. Learning how to use all the assorted and at times overly complex controls is a much steeper learning curve. Not to be a Microsoft fanboy [which I am not] but if done right (and very few are) a .NET site can be very clean and elegant in terms of the code architecture. Jeff -Original Message- From: shetc [mailto:sh...@bellsouth.net] Sent: Tuesday, February 07, 2012 2:57 PM To: users@wicket.apache.org Subject: Wicket in a Dot Net World Well friends, it's happened -- the company I work for has been bought by a larger competitor. Sadly, the new bosses prefer to work with .NET I don't suppose anyone has ported Wicket to .NET? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-in-a-Dot-Net-World-tp4366058p4366058.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Wizard finish button prevent double click
Any additional thoughts on this. I tried just putting an onclick on the button itself. But it still prevents the form from submitting. If I remove the onclick then everything works fine. This should not be this hard. The button is defined below: button class=cmdButton wicket:id=finish type=submit onclick=showBusysign();return true;wicket:message key=wizardFinishButton/wicket:message/button The showBusysign() javascript function is below. And this does what I expect it should. function showBusysign() { $('#finishbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#previousbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#nextbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#cancel').css('backgroundImage', 'url(images/button_disable.gif)'); $('#finishbtn').attr('disabled', 'disabled'); $('#previousbtn').attr('disabled', 'disabled'); $('#nextbtn').attr('disabled', 'disabled'); $('#cancel').attr('disabled', 'disabled'); } -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Tuesday, November 15, 2011 6:41 PM To: users@wicket.apache.org Subject: RE: Wizard finish button prevent double click I have. I even added a breakpoint in my onFinish code to be sure that it was getting there. I do the bind to the click event in the document onReady. It definitely fires the jquery but the onFinish code is never executed. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, November 15, 2011 6:34 PM To: users@wicket.apache.org Subject: Re: Wizard finish button prevent double click with jquery have you tried saying $(button).attr(disabled, disabled) ? -igor On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I was using version 1.4.3 and recently updated to 1.4.19. I am trying to prevent the double click of the Finish button causing a double submit on the finish step of a wizard. Was this resolved between version 1.4.3 and 1.4.19? Hopefully it was. If not... There was mention of this in the following thread: http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click -w ithout-breaking-Form-setDefaultButton-td3018140.html The proposed solution of adding a Boolean flag to form itself is a bit confusing. How do you go about doing this. Do you add a Boolean field to the model that backs the form that is initially set to false and then when the onFinish() method fires the field is checked and only continue if false and then set it to true. How does this prevent the double submit from occurring? Is there a way to disable the button visually? In the Apache Wicket Cookbook (btw, great book) there is the section on blocking until an Ajax request is complete but the default wizard doesn't appear to be ajax enabled. If I could bind a click event to the button via jquery that disables the buttons and then continues with the wizard submit, that would be ideal. I can get the jquery bind to occur but the wizard is never submitted to the onFinish() method. It is like jquery prevents the wicket javascript from firing. 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: Wizard finish button prevent double click
Problem has been solved. The finish button needs to remain enabled for the wizard to submit to the onFinish() method. So I was not able to mark the finish button as disabled. The javascript/jquery that I had was correct. To resolve the problem I just hide the finish button once it is pressed and show an image of the finish button it's disabled state. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, November 16, 2011 11:15 AM To: users@wicket.apache.org Subject: Re: Wizard finish button prevent double click Hi, On Wed, Nov 16, 2011 at 5:50 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Any additional thoughts on this. I tried just putting an onclick on the button itself. But it still prevents the form from submitting. If I remove the onclick then everything works fine. This should not be this hard. The button is defined below: button class=cmdButton wicket:id=finish type=submit onclick=showBusysign();return true;wicket:message key=wizardFinishButton/wicket:message/button The showBusysign() javascript function is below. And this does what I expect it should. function showBusysign() { $('#finishbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#previousbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#nextbtn').css('backgroundImage', 'url(images/button_disable.gif)'); $('#cancel').css('backgroundImage', 'url(images/button_disable.gif)'); $('#finishbtn').attr('disabled', 'disabled'); $('#previousbtn').attr('disabled', 'disabled'); $('#nextbtn').attr('disabled', 'disabled'); $('#cancel').attr('disabled', 'disabled'); you can combine this selector into jQuery('#btn1, #btn2').css(...).prop('disabled', 'disabled') use prop() instead of attr() check their docs } -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Tuesday, November 15, 2011 6:41 PM To: users@wicket.apache.org Subject: RE: Wizard finish button prevent double click I have. I even added a breakpoint in my onFinish code to be sure that it was getting there. I do the bind to the click event in the document onReady. It definitely fires the jquery but the onFinish code is never executed. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, November 15, 2011 6:34 PM To: users@wicket.apache.org Subject: Re: Wizard finish button prevent double click with jquery have you tried saying $(button).attr(disabled, disabled) ? -igor On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I was using version 1.4.3 and recently updated to 1.4.19. I am trying to prevent the double click of the Finish button causing a double submit on the finish step of a wizard. Was this resolved between version 1.4.3 and 1.4.19? Hopefully it was. If not... There was mention of this in the following thread: http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-clic k -w ithout-breaking-Form-setDefaultButton-td3018140.html The proposed solution of adding a Boolean flag to form itself is a bit confusing. How do you go about doing this. Do you add a Boolean field to the model that backs the form that is initially set to false and then when the onFinish() method fires the field is checked and only continue if false and then set it to true. How does this prevent the double submit from occurring? Is there a way to disable the button visually? In the Apache Wicket Cookbook (btw, great book) there is the section on blocking until an Ajax request is complete but the default wizard doesn't appear to be ajax enabled. If I could bind a click event to the button via jquery that disables the buttons and then continues with the wizard submit, that would be ideal. I can get the jquery bind to occur but the wizard is never submitted to the onFinish() method. It is like jquery prevents the wicket javascript from firing. 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wizard finish button prevent double click
I was using version 1.4.3 and recently updated to 1.4.19. I am trying to prevent the double click of the Finish button causing a double submit on the finish step of a wizard. Was this resolved between version 1.4.3 and 1.4.19? Hopefully it was. If not... There was mention of this in the following thread: http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-w ithout-breaking-Form-setDefaultButton-td3018140.html The proposed solution of adding a Boolean flag to form itself is a bit confusing. How do you go about doing this. Do you add a Boolean field to the model that backs the form that is initially set to false and then when the onFinish() method fires the field is checked and only continue if false and then set it to true. How does this prevent the double submit from occurring? Is there a way to disable the button visually? In the Apache Wicket Cookbook (btw, great book) there is the section on blocking until an Ajax request is complete but the default wizard doesn't appear to be ajax enabled. If I could bind a click event to the button via jquery that disables the buttons and then continues with the wizard submit, that would be ideal. I can get the jquery bind to occur but the wizard is never submitted to the onFinish() method. It is like jquery prevents the wicket javascript from firing. Thanks.
RE: Wizard finish button prevent double click
I have. I even added a breakpoint in my onFinish code to be sure that it was getting there. I do the bind to the click event in the document onReady. It definitely fires the jquery but the onFinish code is never executed. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, November 15, 2011 6:34 PM To: users@wicket.apache.org Subject: Re: Wizard finish button prevent double click with jquery have you tried saying $(button).attr(disabled, disabled) ? -igor On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I was using version 1.4.3 and recently updated to 1.4.19. I am trying to prevent the double click of the Finish button causing a double submit on the finish step of a wizard. Was this resolved between version 1.4.3 and 1.4.19? Hopefully it was. If not... There was mention of this in the following thread: http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click -w ithout-breaking-Form-setDefaultButton-td3018140.html The proposed solution of adding a Boolean flag to form itself is a bit confusing. How do you go about doing this. Do you add a Boolean field to the model that backs the form that is initially set to false and then when the onFinish() method fires the field is checked and only continue if false and then set it to true. How does this prevent the double submit from occurring? Is there a way to disable the button visually? In the Apache Wicket Cookbook (btw, great book) there is the section on blocking until an Ajax request is complete but the default wizard doesn't appear to be ajax enabled. If I could bind a click event to the button via jquery that disables the buttons and then continues with the wizard submit, that would be ideal. I can get the jquery bind to occur but the wizard is never submitted to the onFinish() method. It is like jquery prevents the wicket javascript from firing. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: 1.5.1
Yes, that would be very nice to have an improved exception message. I ran into this problem as well during a migration to 1.5.1 and it caused lots of wasted time trying to find the problem. On a side note 1.5.1 is awesome. The migration was relatively painless. -Original Message- From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] Sent: Friday, October 07, 2011 9:02 AM To: users@wicket.apache.org Subject: Re: 1.5.1 yup that would be really nice. 2011/10/7 Andrea Del Bene adelb...@ciseonweb.it: Hi nino, XmlPullParser has became more strict in Wicket 1.5.1 in order to solve WICKET-3773. Now it complains about not balanced quotes of tag attributes. Maybe we could improve exception message. virtual ipod on its way to matt.. Dead on! thanks :) 2011/10/7 Matthias Kellermatthias.kel...@ergon.ch: Hi Seems to be right here: wicket:container wicket:id=entranceNameHeader.. You're missing an opening quote Matt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Migration to 1.5.1 -- unable to render page because of head tag
Been migrating an app to 1.5.1 and wanted to test a simple first page. I continue to run into problems rendering the page. I continue to get the following exception: Caused by: java.text.ParseException: No matching close bracket at (line 196, column 27) at org.apache.wicket.markup.parser.XmlPullParser.next(XmlPullParser.java:21 6) Below is the simplified html and the java code. Any ideas on what is going on? BasePage.html -- !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; head title wicket:id=title[page title]/title meta wicket:id=keywords name=keywords content=/ meta wicket:id=description name=description content=/ /head body div id=main wicket:child/ /div /body /html BasePage.java -- public class BasePage extends WebPage { // title of the current page private String pageTitle = ; // page meta-data private String pageDescription = ; private String pageKeyword = ; public BasePage() { super(); init(); } private init() { // Page Title add(new Label(title, new PropertyModelString(this, pageTitle))); // Meta Tags WebMarkupContainer metaKeywords = new WebMarkupContainer(keywords); metaKeywords.add(AttributeModifier.replace(content, new PropertyModelString(this, pageKeyword))); add(metaKeywords); WebMarkupContainer metaDescription = new WebMarkupContainer(description); metaDescription.add(AttributeModifier.replace(content, new PropertyModelString(this, pageDescription))); add(metaDescription); } protected void setPageTitle(String title) { this.pageTitle = title; } protected void setMetaKeywords(String keywords) { this.pageKeyword = keywords; } protected void setMetaDescription(String description) { this.pageDescription = description; } public String getPageDescription() { return pageDescription; } public String getPageKeyword() { return pageKeyword; } public String getPageTitle() { return pageTitle; } } HomePage.html --- !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; wicket:head/wicket:head body wicket:extend [bunch of html] /wicket:extend /body HomePage.java - public class HomePage extends BasePage { public HomePage() { this.setPageTitle(My homepage); this.setMetaKeywords(); this.setMetaDescription(); } }
RE: Migration to 1.5.1 -- unable to render page because of head tag
I solved my problem. I had a double quote in the title tag. Removing that resolved the problem. -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Monday, October 03, 2011 3:18 PM To: users@wicket.apache.org Subject: Migration to 1.5.1 -- unable to render page because of head tag Been migrating an app to 1.5.1 and wanted to test a simple first page. I continue to run into problems rendering the page. I continue to get the following exception: Caused by: java.text.ParseException: No matching close bracket at (line 196, column 27) at org.apache.wicket.markup.parser.XmlPullParser.next(XmlPullParser.java:21 6) Below is the simplified html and the java code. Any ideas on what is going on? BasePage.html -- !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; head title wicket:id=title[page title]/title meta wicket:id=keywords name=keywords content=/ meta wicket:id=description name=description content=/ /head body div id=main wicket:child/ /div /body /html BasePage.java -- public class BasePage extends WebPage { // title of the current page private String pageTitle = ; // page meta-data private String pageDescription = ; private String pageKeyword = ; public BasePage() { super(); init(); } private init() { // Page Title add(new Label(title, new PropertyModelString(this, pageTitle))); // Meta Tags WebMarkupContainer metaKeywords = new WebMarkupContainer(keywords); metaKeywords.add(AttributeModifier.replace(content, new PropertyModelString(this, pageKeyword))); add(metaKeywords); WebMarkupContainer metaDescription = new WebMarkupContainer(description); metaDescription.add(AttributeModifier.replace(content, new PropertyModelString(this, pageDescription))); add(metaDescription); } protected void setPageTitle(String title) { this.pageTitle = title; } protected void setMetaKeywords(String keywords) { this.pageKeyword = keywords; } protected void setMetaDescription(String description) { this.pageDescription = description; } public String getPageDescription() { return pageDescription; } public String getPageKeyword() { return pageKeyword; } public String getPageTitle() { return pageTitle; } } HomePage.html --- !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; wicket:head/wicket:head body wicket:extend [bunch of html] /wicket:extend /body HomePage.java - public class HomePage extends BasePage { public HomePage() { this.setPageTitle(My homepage); this.setMetaKeywords(); this.setMetaDescription(); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Version 1.5 event model
I am currently converting an app to version 1.5.1 and am starting to look into/work with the event model. What is the suggested approach for using the event model? Should all Ajax be moved to the event model (anywhere where in 1.4 the code had target.addComponent or target.addJavascript calls)? Are there some areas of code that should not be using the event model? Should/can feedback panels use the event model? Thanks for any advice.
CSS and JS references in wicket 1.4.18
I know there is a current thread discussing how to remove the wicket-ver-XXX from the url for a js file. I was wondering if there was a way to include the wicket-ver-XXX for all CSS and JS references in wicket 1.4.18? I am sure it is probably something simple that I am overlooking. Thanks.
RE: E-commerce site built on Wicket
It is using Daisy as a CMS but mostly just to store content in a JCR for easy access to place on the pages where needed. It also allows the business users to modify content on the fly. The site itself was coded straight up. -Original Message- From: Arjun Dhar [mailto:dhar...@yahoo.com] Sent: Thursday, July 21, 2011 2:11 AM To: users@wicket.apache.org Subject: Re: E-commerce site built on Wicket Looks pretty nice. Did you guys use any CMS (say wicket based like BRIX) .. or simply coded it straight up? - Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/E-commerce-site-built-on-Wick et-tp3682832p3682897.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
E-commerce site built on Wicket
Wanted to let the user-group know about another successful site built with Wicket which was launched about 1.5 years ago. I am just getting around to letting the usergroup know about it, sorry for the delay. The url for the site is: http://www.stoneside.com. The site is a consumer e-commerce site. We have utilized JQuery to help with the UI functionality. We use straight JQuery and do not wrap it with wiQuery. The site does utilize a few other open source projects such as: Hibernate Drools [rules engine for performing all pricing and configuration rules] Spring Daisy [CMS repository] The site is currently under a redesign and A/B testing so you may see one of two versions of the site. I am unable to provide traffic numbers at this time. Thanks to everyone on the user-group for their answers to questions over the past few years. In particular and in no order: Igor, Jeremy, and Martin. Let me know what you think and if you have questions.
BookmarkableLink to download a CSV file
I want to have a link that when hit will download a csv file. I would prefer to use a Page or a component that I can use the @SpringBean notation on so the csv file data can be retrieved via my service layer beans. I can generate the file using a WebPage with the following in my constructor for the page where sb is my StringBuilder holding the data. WebResponse response = (WebResponse) this.getResponse(); java.io.OutputStream cout = response.getOutputStream(); try { cout.write(sb.toString().getBytes()); cout.flush(); cout.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } My page also overrides setHeaders to set the proper headers, ContentType and Header specifying download and file name. The problem with this is the following 2 errors are thrown: 011-07-13 17:58:23,910 ERROR org.apache.wicket.RequestCycle RequestCycle:1529 - Markup of type 'html' for component 'com.company.myPage' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: [Page class = com.company.myPage, id = 4, version = 0] org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component ' com.company.myPage ' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: [Page class = com.company.myPage, id = 4, version = 0] 2011-07-13 17:58:24,549 ERROR org.apache.wicket.protocol.http.WicketFilter WicketFilter:507 - closing the buffer error java.lang.IllegalStateException: getOutputStream() has already been called for this response Any ideas?
RE: HybridUrlCodingStrategy SEO
Try adding rel=nofollow to the ajax links. This should tell google not to follow the link. We have had pretty good results using this. Other spiders do not recognize this so some indexers may still hit those links. -Original Message- From: Phil Franken [mailto:phil.fran...@gmail.com] Sent: Tuesday, June 21, 2011 2:38 AM To: users@wicket.apache.org Subject: Re: HybridUrlCodingStrategy SEO I've considered stateless but I don't want google to follow any of my ajax links so I don't really need it (I think). I only want google to index my home page, but I can't provide a direct link with the HybridUrl strategy as far as I know. Also I've got a custom RequestCycle so I've got an integration with wicket-stateless. On 6/21/2011 2:28 AM, Martin Grigorov wrote: Hi, To avoid the redirect the page should be stateless. You can use Jolira's stateless Ajax behaviors/components instead. On Tue, Jun 21, 2011 at 9:16 AM, Phil Frankenphil.fran...@gmail.com wrote: I've mapped my home page to home usingHybridUrlCodingStrategy. Testing with http://www.internetofficer.com/seo-tool/redirect-check/ shows a 302 redirect for; domain.com to domain.com/home.0 domain.com/home to domain.com/home.1 Google does not like the redirect and is reporting a redirect error in Webmaster Tools. Google will not follow the page with a redirect and wants a direct link in sitemap.xml. Well with HybridUrl I'm not sure this is possible because it will redirect to the numbered version, home.0, home.1, etc... I'm thinking of switching to a BookmarkablePage mount to solve this issue, but the home page has ajax controls and I'd prefer to support the browser back button without the cache control fix for ajax. Any other suggestions? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: WicketRuntimeException
Thanks for the idea of using kill -3 pid I don't see the page in the stack trace which is below, unless it is the line I have started with ===. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink Stack Trace: org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) org.apache.wicket.protocol.https.HttpsRequestCycleProcessor.resolve(HttpsRequestCycleProcessor.java:219) org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) org.apache.wicket.RequestCycle.request(RequestCycle.java:545) org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ===com.myapp.web.MDCSessionFilter.doFilter(MDCSessionFilter.java:40) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) java.lang.Thread.run(Thread.java:619) -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Wednesday, June 08, 2011 3:30 AM To: users@wicket.apache.org Subject: Re: WicketRuntimeException The stack trace shows the page that is holding the lock as well Martijn On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov mgrigo...@apache.org wrote: On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I have started to see more and more of the following exception when users are using the wicket app. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink If my understanding is right, it is a timeout that is occurring because the app is still processing for the page that is trying to be viewed. Is this correct? Any ideas on how to debug or solve? What are some common reasons for this type of exception? Correct. You can dump the thread's state with tools like jconsole or on unix machines with kill -3 pid. Making several dumps you will see the thread that is stuck. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: WicketRuntimeException
I don't see anything in the logs but I will look. I will try kill -3 pid when it happens again. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, June 08, 2011 9:38 AM To: users@wicket.apache.org Subject: Re: WicketRuntimeException This is the wrong thread. I bet there is another one with longer stack. On Wed, Jun 8, 2011 at 3:27 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Thanks for the idea of using kill -3 pid I don't see the page in the stack trace which is below, unless it is the line I have started with ===. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink Stack Trace: org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) org.apache.wicket.protocol.https.HttpsRequestCycleProcessor.resolve(HttpsRequestCycleProcessor.java:219) org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) org.apache.wicket.RequestCycle.request(RequestCycle.java:545) org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ===com.myapp.web.MDCSessionFilter.doFilter(MDCSessionFilter.java:40) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) java.lang.Thread.run(Thread.java:619) -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Wednesday, June 08, 2011 3:30 AM To: users@wicket.apache.org Subject: Re: WicketRuntimeException The stack trace shows the page that is holding the lock as well Martijn On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov mgrigo...@apache.org wrote: On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I have started to see more and more of the following exception when users are using the wicket app. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink If my understanding is right, it is a timeout that is occurring because the app is still processing for the page that is trying to be viewed. Is this correct? Any ideas on how to debug or solve? What are some common reasons for this type of exception? Correct. You can dump the thread's state with tools like jconsole or on unix machines with kill -3 pid. Making several dumps you will see the thread that is stuck. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WicketRuntimeException
I have started to see more and more of the following exception when users are using the wicket app. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink If my understanding is right, it is a timeout that is occurring because the app is still processing for the page that is trying to be viewed. Is this correct? Any ideas on how to debug or solve? What are some common reasons for this type of exception?
RE: Color Picker
We use the same one as well. As Martin stated it is mostly just plug and play. Jeff -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Tuesday, March 22, 2011 1:45 PM To: users@wicket.apache.org Subject: Re: Color Picker Hi! I myself have used this one: http://www.eyecon.ro/colorpicker/ Is mostly just plug and play... ** Martin 2011/3/22 Jered Myers jer...@maplewoodsoftware.com: Does anybody know of a good color picker component for Wicket? I am seeing the DojoColorPicker in Wicket Stuff, but I am not finding code for it in Github. I am using Wicket 1.4.16. I don't want to waste time rolling my own if there is already one out there that is already setup as a Wicket component. Jered Myers - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket - tomcat - apache - haproxy
I am trying to setup my environment so that HAProxy sits in front of my apache server so I can turn the server off and send requests to a different site without the user knowing. [ie... like apple does when they are refreshing their catalog/site the morning of a new product launch]. I have HAProxy working correctly with HTTP. However, HTTPS is causing ssl_error_rx_record_too_long errors. If I go directly against the apache instance and remove HAProxy from the mix everything works. Is there anything with wicket that would be causing the problem? The SSL certs are defined on the apache server. I am just trying to narrow down where my problem lies. Has anyone done something like this before? Any recommendations on an easy solution to the problem? The wicket application would be down so I can't server the page from my wicket application. Thanks.
DiskPageStore - Error FileNotFoundException
Hi... my site in production has been running and after our latest code change we started to get the error below after a few days. It appears it is something to do with wicket's PageMap. In the past this error would come up after weeks or months of the app running [we were re-starting tomcat fairly regularly back then]. The sys-admin of the box said he increased the open file limit from 1024 to 65535 per the following thread [http://osdir.com/ml/users-wicket.apache.org/2009-09/msg00674.html ]. However this seems like a hack and not solving the underlying problem. In fact we got the exception thrown even quicker after the file limit change was made. We are running wicket 1.4.3 [yes, it is an outdated version and moving to 1.4.16 *may* solve the problem.] Any ideas? What can we be doing wrong? 2011-03-03 15:42:26,681 | [] | ERROR (DiskPageStore.java:930) Error flushing page java.lang.RuntimeException: java.io.FileNotFoundException: /usr/share/apache-tomcat-6.0.20/work/Catalina/localhost/_/wicket-spring- hibernate-filestore/7815/9545/64D2A385CF347B9FF9074C8345CA99FB/pm-null (Too many open files) at org.apache.wicket.protocol.http.pagestore.FileChannelPool.newFileChannel (FileChannelPool.java:103) at org.apache.wicket.protocol.http.pagestore.FileChannelPool.getFileChannel (FileChannelPool.java:170) at org.apache.wicket.protocol.http.pagestore.DiskPageStore$SessionEntry.sav ePage(DiskPageStore.java:241) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.flushPagesToSave List(DiskPageStore.java:924) at org.apache.wicket.protocol.http.pagestore.DiskPageStore$PageSavingThread .run(DiskPageStore.java:996) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.FileNotFoundException: /usr/share/apache-tomcat-6.0.20/work/Catalina/localhost/_/wicket-spring- hibernate-filestore/7815/9545/64D2A385CF347B9FF9074C8345CA99FB/pm-null (Too many open files) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.init(RandomAccessFile.java:212) at org.apache.wicket.protocol.http.pagestore.FileChannelPool.newFileChannel (FileChannelPool.java:98) ... 5 more
Ajax Response xml showing in browser
Got an odd issue occurring where the Ajax Response xml is showing in the browser rather than modifying the DOM of the page as it usually does. The scenario is the following: My Login page is abstract and has an abstract method called onLoginSuccess. When the login is successful we call onLoginSuccess. Abstract Class called LoginLink which extends AjaxLink LoginLink has an abstract method called onSuccess() and onAlreadyLoggedIn() The Login page is constructed and has it's abstract method onLoginSuccess defined to call onSuccess() The onClick method of LoginLink does a setResponsePage to my Login page if not already logged in and calls onAlreadyLoggedIn() if the user is already logged into the site. I have a page called Page1 which contains a LoginLink. The onSuccess() method is defined to setResponsePage() to the page I ultimately need to go to say Page2. The onAlreadyLoggedIn() method is defined to setResponsePage() to the page I ultimately need to go to say Page2. On Page2, there are AjaxButtons to submit forms. If any button is clicked I get the AjaxResponse xml showing in the browser window. Any ideas on how to solve this? Is there another way of doing this interaction with built in wicket components. Thanks. Jeff
Page mounting
I think this was discussed here but I can't seems to find it so I will ask again. I would like to mount a page Login to Login.class. I know how to do this and have it working. Now I would like to mount a page called AdminLogin to Login.class but also pass a parameter to Login.class so that I can change the login form but still use the same page. Is this possible? How would I do this? Thanks.
robots.txt wicket urls
How can I add an entry to robots.txt for a page of my site that is not currently mounted and cannot be made bookmarkable. The url is the wicket url of ?wicket:interface. I guess I could say block everything that contains ?wicket:interface but that seems kind of brute force. I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy to mount the page as a named page. This works but then if someone changes the number after the . in the url, they may request a page out of the pagemap and an exception is thrown and we show our error page. Is this the only way to do it? Thanks.
RE: robots.txt wicket urls
So using the HybridUrlCodingStrategy is correct and if users want to muck with the URL they can and they may just get an error? Then for the robots.txt I just say to block XYZ without the .. For example I have a page called Login that is mounted with the HybridUrlCodingStrategy. So the url to the user is Login.1 or Login.7 depending on how many times they hit the page. In the robots.txt I just need to say to ignore the url of Login Can I set the pagemap to only store N number of pages per session? I tried using: getSessionSettings().setMaxPageMaps(1) but what does this really do? Is it 1 page per session or 1 of each page per session. Thanks. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, October 12, 2010 12:21 PM To: users@wicket.apache.org Subject: Re: robots.txt wicket urls in your robots.txt put the url without the ., that way a new version of the page will get created. -igor On Tue, Oct 12, 2010 at 8:30 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: How can I add an entry to robots.txt for a page of my site that is not currently mounted and cannot be made bookmarkable. The url is the wicket url of ?wicket:interface. I guess I could say block everything that contains ?wicket:interface but that seems kind of brute force. I tried using IndexedHybridUrlCodingStrategy and HybridUrlCodingStrategy to mount the page as a named page. This works but then if someone changes the number after the . in the url, they may request a page out of the pagemap and an exception is thrown and we show our error page. Is this 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
Logging sessionId for every log event
I am trying to log the session id with every log event so that I can trace a visitors steps in the log file. I am using log4j and was hoping I could use either the NDC or MDC. I am not able to figure out where to push the session id into the context and pop it out of the context when using NDC. If I wanted to use MDC, where could I put the session id in to the map for each request? Is there a particular wicket method to override and put this in? Should this be done as a servlet filter instead [before or after OSIV filter]? Thanks for any help.
RE: ModalWIndow and update of jQuery component
Try using AppendJavascript on the target of the wicket ajax link/button that shows the ModalWindow. -Original Message- From: zoran [mailto:jeremy...@gmail.com] Sent: Monday, August 09, 2010 9:55 PM To: users@wicket.apache.org Subject: ModalWIndow and update of jQuery component Hi, I'm using a ModalWindow with Panel content inside containing a form that should edit a data for existing objects. From the parent page I'm accessing the Modal window content to send an Java instance object containing values that will set the initial values in the form, then I call a show() method to show a modal window. The problem is that in the form I'm using two jQuery UI components (slider and datepicker), and I can't find appropriate way to set its' values. Normally it should be changed with this javascript: $('#slider').slider('option','value',5); $('#datepicker').datepicker('setDate','08/31/2010'); I've tried to add this code in Panel class, and call it before or after show() method call. add(new AbstractBehavior(){ private static final long serialVersionUID = 1L; public void renderHead(IHeaderResponse response){ String js=$('#slider').slider('option','value',+sliderExpectedLevel+);; response.renderJavascript(js, updateSlider); }; }); However, this doesn't give results. The similar panel I'm using on the other page (but this one is not in ModalWindow) and here this is updated in appropriate way. Do you know what is the problem here and how can I solve this? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWIndow-and-update-of-jQu ery-component-tp2319239p2319239.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Encrypt Form Fields Using JS
Can you create the text field and a hidden text field and have some javascript that validates as the user types or an update link next to the field? Once the entire SSN is entered or the link is pressed then hash the ssn and store in the hidden text field. Once hashed, overwrite the value in the visible text field with ###-##- and disable the text entry. You could even leave the text entry enabled and have the client-side validator check if the field contains ###-##- and don't perform the re-hash. Don't do the validation through wicket validators. There are plenty of jquery or standalone javascript ssn validators out there. -Original Message- From: mzem...@osc.state.ny.us [mailto:mzem...@osc.state.ny.us] Sent: Tuesday, August 03, 2010 2:24 PM To: users@wicket.apache.org Subject: Re: Encrypt Form Fields Using JS I have to laugh because I also agree its kind of crazy... Yes the original value must be hashed by the client. The reasoning being that SSL could be broken and expose the data. I don't necessarily agree but thats how the original system was written. James Carman ja...@carmanconsulting.com Sent by: jcar...@carmanconsulting.com 08/03/2010 02:19 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS And, you don't want to convert it before you store it in the db? It must be converted at the browser level? Is there any more information you can give us that would make this requirement not sound so crazy? :) On Tue, Aug 3, 2010 at 2:15 PM, mzem...@osc.state.ny.us wrote: Correct James Carman ja...@carmanconsulting.com Sent by: jcar...@carmanconsulting.com 08/03/2010 02:12 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS So, you never need to get the original values out of the database? On Tue, Aug 3, 2010 at 2:10 PM, mzem...@osc.state.ny.us wrote: An already existing system is being rewritten and the db currently stores hashed values. I don't disagree there are better ways to reach the end goal, but this is the spec I am working with. James Carman ja...@carmanconsulting.com Sent by: jcar...@carmanconsulting.com 08/03/2010 01:45 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS And, what does that buy you? Why do you want to submit one-way hashed values? On Tue, Aug 3, 2010 at 1:37 PM, mzem...@osc.state.ny.us wrote: Ok, the value will be hashed, one-way...anyone have any ideas? James Carman ja...@carmanconsulting.com Sent by: jcar...@carmanconsulting.com 08/02/2010 04:42 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS Then it's not encryption. Encrypted data should be readable to those who have the key. On Mon, Aug 2, 2010 at 3:29 PM, mzem...@osc.state.ny.us wrote: Thanks for the reply, that would work however per our business rules the encryption must be one-way and will not be decrypted... Igor Vaynberg igor.vaynb...@gmail.com 08/02/2010 03:23 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS override getinputasarray() on the field and decrypt it there, that way wicket sees the decrypted value -igor On Mon, Aug 2, 2010 at 12:14 PM, mzem...@osc.state.ny.us wrote: I totally agree, seems like double-duty that accomplishes very little, and actually adds overhead. But this is another debate and the feature has been requested and must be implemented as I described... Craig McIlwee craig.mcil...@openroadsconsulting.com 08/02/2010 03:06 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Re: Encrypt Form Fields Using JS Why not use a password field to keep the value hidden and SSL to make sure there are no man in the middle attacks. Seems like you are making it too hard? - Original Message - From: mzem...@osc.state.ny.us To: users@wicket.apache.org Sent: Mon, 02 Aug 2010 15:00:55 -0400 Subject: Encrypt Form Fields Using JS Problem: Encrypt sensitive form fields (ie ssn) on client (javascript) Solution: Create behavior which fires javascript to hash field value and replace original value (###-##-) This sounds simple enough, but since the length of the hashed string will be considerably longer than the original string, validations
RE: Clean URLs without /?wicket:interface=:0:::: stuff - is it possible?
Look into page mounting, BookmarkablePageLink mount(new BookmarkablePageRequestTargetUrlCodingStrategy(nicename, your.package.PageName.class, null)); BookmarkablePageLink nicenameLink = new BookmarkablePageLink(nicename_link, your.package.PageName.class); -Original Message- From: Laurentiu Trica [mailto:laurentiu.tr...@finalfolder.biz] Sent: Wednesday, July 21, 2010 11:23 AM To: users@wicket.apache.org Subject: Clean URLs without /?wicket:interface=:0 stuff - is it possible? Hello, I'm rather new to wicket but I'm amazed about it's power. I still have a bothering question: is it possible to make the website with clean URLs? I mean I want to have the first page like /welcome, the about page like /about and somehow to get rid of the /?wicket:interface=:0 stuff - this appears if you click the banner twice, for example... This is for usability issues as is for SEO reasons. Thank you in advance. -- Best regards, Laurentiu Trica - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Submitting form via AJAX over SSL - RESEND
How can I submit a form via AJAX over SSL? I have a login form that appears via Ajax and I want the form submission to be under SSL when it is submitted via AJAX. How can I go about doing this? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Submitting form via AJAX over SSL
How can I submit a form via AJAX over SSL? I have a login form that appears via Ajax and I want the form submission to be under SSL when it is submitted via AJAX. How can I go about doing this? Thanks.
Panel under https
I have a panel which contains a form on my page that is shown as a modal window via JQuery. The page itself is not under https but I would like the form to be submitted via SSL. The form is submitted via an IndicatingAjaxButton. How can I make the form submitted via https but not have the rest of the page under ssl. Thanks. Jeff
AjaxLink that forces to login page before continuing
I am looking for a way to have an AjaxLink or a regular link do the following: User clicks on link 1. If not logged in then show login page and allow user to login and then continue with #2 2. Perform some business logic 3. Show a message [if ajaxlink] or send to a page [if regular link] I have #2 and #3 working without trying to do #1. I can't seem to figure out #1. I tried the following in the onClick of my AjaxLink. However after a successful login I am brought back to the page with the AjaxLink and #2 and #3 are never executed unless I click on the link again [since the user would already be authenticated on the second click]. // #1 if (not authenticated) { throw new RestartResponseAtInterceptPageException(Login.class); } // #2 // Do business logic // #3 // show message Login.java: // after successful login if (!this.continueToOriginalDestination()) { this.setResponsePage(HomePage.class); } ___ Jeffrey A. Schneller Envisa End-to-End E-Commerce for the Multi-Channel Merchant 281 Pleasant Street Framingham, MA 01701 P: (508) 405-1220 x115 C: (508) 954-8044 F: (508) 405-1219
RE: Interstitial window prompt then open a new window
You may want to look into this. I am using this to send a user to page off our site via a link. Link myLink = new Link(myLink) { @Override public void onClick() { String url = http://your_url;; throw new RestartResponseAtInterceptPageException(new RedirectPage(url)); } }; PopupSettings settings = new PopupSettings(); settings.setTarget(_new); settings.setWindowName(My Other Site); myLink.setPopupSettings(settings); add(myLink); It does not have the interstitial window prompt but this may get your closer to what you want. -Original Message- From: Doug Leeper [mailto:douglee...@yahoo.com] Sent: Friday, April 16, 2010 11:51 AM To: users@wicket.apache.org Subject: Interstitial window prompt then open a new window We are needing an interstitial window that prompts a user if they want to continue to another site. Additionally, we would like to provide a checkbox if they would not longer like to see this prompt again. I can prompt via a ModalWindow and capture their response...but what I am not sure what to do now is open a window with the destination URL via Ajax. I like the target=_blank behavior on an href...but this can't apply since I am opening a modal window with that link. Do I have to create custom javascript to append to the Ajax request to open a new window with that url? Are there other options? Thanks in advance! - Doug - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Wiki
Any ideas on when the Wicket Wiki will be back up? http://cwiki.apache.org/WICKET Thanks.
LoadableDetachable Models
I am having issues with LDM, Hibernate lazy loaded lists, and ajax. I create a CompoundPropertyModel of a LDM and set that as the default model for the page. I then pass the model to the form and to a custom component in the form. The custom component is a list editor. Basically a ListView with lots of ajax link for editing the values. The issue I am having is I can get everything to work however because of the LDM, the model is being over-written on each Ajax request and also on form submission so I cannot modify any values since they are not available in the onsubmit because the LDM reloads. If I do not use the LDM then I get Hibernate errors because of the lazy loading. If I remove the lazy loading and use eager loading and don't use the LDM then everything works fine. The issue is because of the eager loading then other parts of the application load lots of data that is not needed. Any ideas? Can I not use the LDM for what I want? Thanks.
RE: Hibernate - OSIV
The issue was the object was being evicted from the Hibernate session. getSession().evict(object). I had forgot that the object was being evicted from the session. If I do not evict the object from the session then lazy loading worked. This is more of a Hibernate question but, how can I get unique object from a hibernate query for each query and have each object be tied to the session? example: select * from Product where sku = ? I want to select the same sku but get two different java objects from Hibernate so the objects are not the same. Thanks. -Original Message- From: Josh Chappelle [mailto:jchappe...@4redi.com] Sent: Wednesday, March 31, 2010 7:01 PM To: users@wicket.apache.org Subject: RE: Hibernate - OSIV What error are you getting? -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Wednesday, March 31, 2010 4:47 PM To: users@wicket.apache.org Subject: Hibernate - OSIV I think I have the OSIV filter setup correctly but I can't access any lazy loaded properties of my objects. I am not even between requests when this is happening. Does anyone have any ideas? I can't seem to figure this out. I have looked at OSIV in Spring and OSIV in Wicket. I can't seem to find any examples that will help me to determine the problem. I have included all the code and xml configuration that I believe is relevant. Any help would be appreciated. Also a clean example of how to setup Spring + Hibernate OSIV in the wiki would be a big help. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Hibernate - OSIV
Because the objects have transient properties on them that are set by another process. Basically the object is pulled from the db to create a shell/container and the transient properties are filled in at a later time and may be different. Not a great example but, the object is a survey and the transient properties are the answers that a user will provide. I want to get the same survey twice but allow the transient properties to have different values. If it is the same object, I can't do this. The following setting seems to do the trick. The problem is that after some amount of time, everything locks up. It appears I am out of db connections. filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class init-param param-namesingleSession/param-name param-valuefalse/param-value /init-param /filter -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Thursday, April 01, 2010 4:37 PM To: users@wicket.apache.org Subject: Re: Hibernate - OSIV Why do you need different objects? On Thu, Apr 1, 2010 at 4:25 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: So by using the OSIV, I am out of luck? Any ideas? -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Thursday, April 01, 2010 3:59 PM To: users@wicket.apache.org Subject: Re: Hibernate - OSIV They have to be different sessions. Hibernate's cache (the first level) guarantees that you get the same object for any given entity within the same session. On Thu, Apr 1, 2010 at 3:47 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: The issue was the object was being evicted from the Hibernate session. getSession().evict(object). I had forgot that the object was being evicted from the session. If I do not evict the object from the session then lazy loading worked. This is more of a Hibernate question but, how can I get unique object from a hibernate query for each query and have each object be tied to the session? example: select * from Product where sku = ? I want to select the same sku but get two different java objects from Hibernate so the objects are not the same. Thanks. -Original Message- From: Josh Chappelle [mailto:jchappe...@4redi.com] Sent: Wednesday, March 31, 2010 7:01 PM To: users@wicket.apache.org Subject: RE: Hibernate - OSIV What error are you getting? -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Wednesday, March 31, 2010 4:47 PM To: users@wicket.apache.org Subject: Hibernate - OSIV I think I have the OSIV filter setup correctly but I can't access any lazy loaded properties of my objects. I am not even between requests when this is happening. Does anyone have any ideas? I can't seem to figure this out. I have looked at OSIV in Spring and OSIV in Wicket. I can't seem to find any examples that will help me to determine the problem. I have included all the code and xml configuration that I believe is relevant. Any help would be appreciated. Also a clean example of how to setup Spring + Hibernate OSIV in the wiki would be a big help. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Hibernate - OSIV
I think I have the OSIV filter setup correctly but I can't access any lazy loaded properties of my objects. I am not even between requests when this is happening. Does anyone have any ideas? I can't seem to figure this out. I have looked at OSIV in Spring and OSIV in Wicket. I can't seem to find any examples that will help me to determine the problem. I have included all the code and xml configuration that I believe is relevant. Any help would be appreciated. Also a clean example of how to setup Spring + Hibernate OSIV in the wiki would be a big help. Here is what I have [a very simplified example]: @SpringBean private IProductDao dao; // the following two lines are in the constructor for the page Product product = dao.findBySku(sku); ListOption options = product.getOptions();// this is lazy loaded - Yes, I know in this example I could just eager fetch it but other times I don't need the options // a generic dao public abstract class GenericDaoT extends DomainObject extends HibernateDaoSupport // the product dao public class ProductDao extends GenericDaoProduct implements IProductDao { !-web app à display-namewicket-spring-hibernate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:resources/applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valuecom.mycompany.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping !-application context [key pieces] à bean id=sessionFactory class=com.mycompany.hibernate.SessionFactory property name=hibernateProperties props prop key=hibernate.dialectorg.hibernate.dialect.MySQL5Dialect/prop prop key=hibernate.show_sqltrue/prop !-- connection pooling -- prop key=hibernate.connection.driver_classcom.mysql.jdbc.Driver/prop prop key=hibernate.connection.provider_classorg.hibernate.connection.C3P0ConnectionProvider/prop prop key=hibernate.c3p0.initialPoolSize1/prop prop key=hibernate.c3p0.idleConnectionTestPeriod300/prop prop key=hibernate.c3p0.acquire_increment1/prop prop key=hibernate.c3p0.min_size5/prop prop key=hibernate.c3p0.max_size20/prop prop key=hibernate.c3p0.timeout1800/prop prop key=hibernate.c3p0.max_statements50/prop /props /property property name=packagesToScan list valuecom.mycompany.entities/value /list /property /bean bean id=txManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref bean=sessionFactory / /property /bean tx:annotation-driven transaction-manager=txManager / bean id=ProductDao class=com.mycompany.hibernate.dao.ProductDao scope=singleton property name=sessionFactory ref=sessionFactory / /bean ___ Jeffrey A. Schneller Envisa End-to-End E-Commerce for the Multi-Channel Merchant 281 Pleasant Street Framingham, MA 01701 P: (508) 405-1220 x115 C: (508) 954-8044 F: (508) 405-1219
RE: Hibernate - OSIV
I don't think that is it. I haven't even put the object into any model yet. I am just calling the dao and then calling the getter. I haven't even gotten to the point where models would be in use. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Wednesday, March 31, 2010 5:59 PM To: users@wicket.apache.org Subject: Re: Hibernate - OSIV Loadabledetachablemodel? On Mar 31, 2010 5:47 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I think I have the OSIV filter setup correctly but I can't access any lazy loaded properties of my objects. I am not even between requests when this is happening. Does anyone have any ideas? I can't seem to figure this out. I have looked at OSIV in Spring and OSIV in Wicket. I can't seem to find any examples that will help me to determine the problem. I have included all the code and xml configuration that I believe is relevant. Any help would be appreciated. Also a clean example of how to setup Spring + Hibernate OSIV in the wiki would be a big help. Here is what I have [a very simplified example]: @SpringBean private IProductDao dao; // the following two lines are in the constructor for the page Product product = dao.findBySku(sku); ListOption options = product.getOptions();// this is lazy loaded - Yes, I know in this example I could just eager fetch it but other times I don't need the options // a generic dao public abstract class GenericDaoT extends DomainObject extends HibernateDaoSupport // the product dao public class ProductDao extends GenericDaoProduct implements IProductDao { !-web app à display-namewicket-spring-hibernate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:resources/applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valuecom.mycompany.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping !-application context [key pieces] à bean id=sessionFactory class=com.mycompany.hibernate.SessionFactory property name=hibernateProperties props prop key=hibernate.dialectorg.hibernate.dialect.MySQL5Dialect/prop prop key=hibernate.show_sqltrue/prop !-- connection pooling -- prop key=hibernate.connection.driver_classcom.mysql.jdbc.Driver/prop prop key=hibernate.connection.provider_classorg.hibernate.connection.C3P0ConnectionProvider/prop prop key=hibernate.c3p0.initialPoolSize1/prop prop key=hibernate.c3p0.idleConnectionTestPeriod300/prop prop key=hibernate.c3p0.acquire_increment1/prop prop key=hibernate.c3p0.min_size5/prop prop key=hibernate.c3p0.max_size20/prop prop key=hibernate.c3p0.timeout1800/prop prop key=hibernate.c3p0.max_statements50/prop /props /property property name=packagesToScan list valuecom.mycompany.entities/value /list /property /bean bean id=txManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref bean=sessionFactory / /property /bean tx:annotation-driven transaction-manager=txManager / bean id=ProductDao class=com.mycompany.hibernate.dao.ProductDao scope=singleton property name=sessionFactory ref=sessionFactory / /bean ___ Jeffrey A. Schneller Envisa End-to-End E-Commerce for the Multi-Channel Merchant 281 Pleasant Street Framingham, MA 01701 P: (508) 405-1220 x115 C: (508) 954-8044 F: (508) 405-1219 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Modal window issue
I am running into a very odd problem with modal windows. The problem occurs in Firefox and not in IE7. I have a list of links which each display a modal window to create a different type of item. One of the links(call it item A) brings up a modal with the same links so you can create a particular sub-item. All but one of the links displays the modal window correctly from the original list. The link that does not work tries to create a modal window for item D.The link for item D tries to open the modal as a brand new page. However if I click the link for modal A and then from within that click the link for modal D, I get a message Are you sure you want to navigate away from this page. Reloading this page will cause the modal window to disappear. If I click cancel repeatedly then the correct modal window finally displays. I can then go back to the original list of links and click modal D and it all works. Everything works correctly under IE 7. Any ideas? Thanks.
Palette filtering available list
How can I filter the available list in a palette? I have a dropdown to specify the filter and I can retrieve the filtered list from my data access. How do I set the available list in the palette to be my new filtered list? Here is my code for creating the palette and also the filter button that is going to do the filtering. I can get the definedChoices. The problem I am having is what needs to go between the comments. Thanks for any help. ListItems definedChoices = dao.findItems(); IChoiceRenderer renderer = new ItemChoiceRenderer(name, value); final Palette palette = new Palette(values, new Model((Serializable)definedChoices), renderer, 10, true); palette.setMarkupId(values); palette.setOutputMarkupId(true); palette.setOutputMarkupPlaceholderTag(true); add(palette); AjaxButton filterButton = new AjaxButton(filter) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { String product = productDropDown.getValue(); String type = typeDropDown.getValue(); ListItem definedChoices = dao.findItemsByFilter(product, type); // ** // HOW DO I SET THE AVAILABLE LIST FOR THE PALETTE??? // *** target.addComponent(palette); } }; filterButton.setDefaultFormProcessing(false); add(filterButton);
RE: Wicket used for mobile.walmart.com
Joachim, Thanks for this information. It shows that we made the right choice with Wicket for a new retail site. Also thank you for posting your components as open source. Do you have any examples of how these components can and should be used. In particular the jofilter, wicket-stateless, and expiring-cache. Thanks. Jeff From: Joachim F. Kainz [mailto:j...@jolira.com] Sent: Monday, February 22, 2010 12:05 PM To: users@wicket.apache.org Subject: Wicket used for mobile.walmart.com Fellow Wicket Users, The question if Wicket is suitable for large enterprises has just become easier to answer: The largest enterprise in the world is now using Wicket for its mobile site. Check out mobile.walmart.com (or just point your mobile phone to www.walmart.com and get redirected automatically). The reason why my client decided to go with Wicket makes it easy to support multiple different types of devices. The walmart mobile application supports different HTML for three categories of devices (L1: iPhones challengers, L2: BlackBerries, L3: Plain Old Devices). These three experiences are supported by the same Java code on the server side. We added a few components to Wicket, mostly because in the retail arena being stateless is very important. Our components are available at http://code.google.com/p/jolira-tools/. http://code.google.com/p/jolira-tools/ Wicket is an awesome product and I would like to thank the Wicket team for all there work. One day I hope to get the largest enterprise in the world to donate an appropriate amount of money for future development! :) Best regards, Joachim http://www.jolira.com
Wizard busy indicators
I am trying to figure out how I could add a busy indicator to my wizard so that when transitioning between steps the busy indicator appears. The transition between steps in my wizard may take a long time. 1.How could this be done with just Wicket? 2. How could this be done using JQuery and Wicket? Also, how would I add a busy indicator to a dropdown within a wizard panel with an onchange behavior. I tried adding an inidicatingAjaxButton instead of using the onchange behavior but can't seem to access the model correctly to get the value of the dropdown. Any ideas?? Thanks.
RE: Wizard busy indicators
Martin, Thanks. That should do it. I should be able to use Jquery instead using the functions provided. -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Tuesday, January 26, 2010 12:40 PM To: users@wicket.apache.org Subject: Re: Wizard busy indicators Hi! You do not need Wicket to make a busy indicator. It's plain HTML + JavaScript. The only thing about wicket that is relevant is that you want to remove the busy indicator after ajax-request has been processed. Here is an example: http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html ** Martin 2010/1/26 Jeffrey Schneller jeffrey.schnel...@envisa.com: I am trying to figure out how I could add a busy indicator to my wizard so that when transitioning between steps the busy indicator appears. The transition between steps in my wizard may take a long time. 1. How could this be done with just Wicket? 2. How could this be done using JQuery and Wicket? Also, how would I add a busy indicator to a dropdown within a wizard panel with an onchange behavior. I tried adding an inidicatingAjaxButton instead of using the onchange behavior but can't seem to access the model correctly to get the value of the dropdown. Any ideas?? 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: The Field 'emailInput' is required
Actually, this is how you would do it. Or at least how I did it in the past. If you call setLabel on the input component and the value you pass to set label can come from the xml file based on the language using the StringResourceModel. Example: Java Code (myform.java): RequiredTextField firstName = new RequiredTextField(firstName); firstName.setLabel(new StringResourceModel(firstName, this, null)); Xml File: English (myform.xml): properties entry key=firstNameforename/entry /properties German (myform_de.xml): properties entry key=firstNameVorname/entry /properties You can also customize the error messages as others have shown and you can have both English and German error messages. -Original Message- From: Whats'Up [mailto:s.abel...@gmx.de] Sent: Thursday, January 21, 2010 2:52 PM To: users@wicket.apache.org Subject: Re: The Field 'emailInput' is required No this it isn't. A better example, I have 2 properties files (german and englisch) English: Field 'forenameInput' is required. German: Bitte tragen Sie einen Wert im Feld 'forenameInput' ein. These both texts wicket generates by using add(new RequiredTextFieldString(forenameInput)). These both texts are great, but I want to change the forenameInput to forename in the englisch properties file and in the german to Vorname without writing the whole error code. svenmeier wrote: FormComponent#setLabel() ? Sven Whats'Up wrote: Sorry, I think I wrote not enough, to tell you the problem. With the code test.emailInput.Required=The Email address is required: I have to write for every field the same code, but the wicket code is ok, and I thought it is perhaps possible only to change the field name. Normally I get the error code: Field 'emailInput' is required. I only want to change the field-name and not the completely error-code. The standart wicket-error code ist ok, and I only want to change the field name, because I have very much fields. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/The-Field-%27emailInput%27-is-required-tp27262234p 27263504.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Panel and Model inside of a wizard
I am trying to figure out why a panel in a step of my wizard is not showing the correct data after an Ajax call. The step contains a re-usable panel (TotalPanel) for displaying information from the wizard that is backing the model.The problem is the values in the TotalPanel never reflect the values that have been updated via the Ajax call. I know everything should work because if I change the TotalPanel to take the entire model then everything works. The problem being, I only want my TotalPanel to need to take an Estimate and not the CheckoutModel. At the wizard level I have: CheckoutModel bean = new CheckoutModel(); CompoundPropertyModelCheckoutModel myModel = new CompoundPropertyModelCheckoutModel(bean); setDefaultModel(myModel); On the step of the wizard that I want to display my re-usable panel I have: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(model.getObject().getEstimate())); totalPanel.setOutputMarkupId(true); add(totalPanel); btw... Estimate is a property of the CheckoutModel. Thanks.
RE: Panel and Model inside of a wizard
It does change its values. I have since changed it to: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(new PropertyModel(model, estimate))); this seems to work. I guess I had the chaining of models wrong. Am I right, or is still off base? -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Tuesday, January 19, 2010 3:11 PM To: users@wicket.apache.org Subject: Re: Panel and Model inside of a wizard Hi Jeffrey, new CompoundPropertyModel(model.getObject().getEstimate()) this doesn't look good, does the estimate object change its values or is it replaced by another object after an AJAX request? Sven Jeffrey Schneller wrote: I am trying to figure out why a panel in a step of my wizard is not showing the correct data after an Ajax call. The step contains a re-usable panel (TotalPanel) for displaying information from the wizard that is backing the model.The problem is the values in the TotalPanel never reflect the values that have been updated via the Ajax call. I know everything should work because if I change the TotalPanel to take the entire model then everything works. The problem being, I only want my TotalPanel to need to take an Estimate and not the CheckoutModel. At the wizard level I have: CheckoutModel bean = new CheckoutModel(); CompoundPropertyModelCheckoutModel myModel = new CompoundPropertyModelCheckoutModel(bean); setDefaultModel(myModel); On the step of the wizard that I want to display my re-usable panel I have: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(model.getObject().getEstimate())); totalPanel.setOutputMarkupId(true); add(totalPanel); btw... Estimate is a property of the CheckoutModel. 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: Help with Wicket Adoption Numbers
Lester, While I can't show actual numbers that speak to adoption rate, we struggled with the same question. In the end we decided that it made sense and in the past 5 months have developed and deployed a web application for one of our clients and are 1.5 months into development for another client. Unfortunately the deployed application is not available to the public. It is a medical device sales/manufacturing tool for sales reps and named customers. The application that is under development is a e-commerce site with a custom product configuration tool that will be ready for deployment in the late March timeframe. The application will be heavily based on AJAX and use JQuery. The reason we wanted to use Wicket was because of the great AJAX support. We built a similar application for another client a few years ago using servlets/jsp, json, rest. The speed of development with Wicket is unbelievable. What took many weeks with the old architecture, we were able to accomplish in less than half that time. Also the code is much cleaner. Feel free to ping me if you need any more information. Jeff -Original Message- From: Lester Chua [mailto:cicowic...@gmail.com] Sent: Thursday, January 07, 2010 7:44 PM To: users@wicket.apache.org Subject: Help with Wicket Adoption Numbers Hi, I am facing a hurdle that need crossing in my final attempt to push Wicket for use in an organization. I have: 1) Prototyped a small size module 2) Did 2-3 presentations on the key features and advantages of wicket No one is disputing my claims about productivity and good OO code that was the result. BUT, the technology evaluation committee is NOT recommending Wicket because of. of all things. - Wicket's Low Adoption Rate Can I find any numbers to blow this away? My alternative is to accept the finding and work with Struts 2. Which will mean the stack will need to expand to DWR (for security). I REALLY don't want to go there, and am even considering not taking part in this project due to the high risk involved, only 9 months to introduce huge changes to a system that has lots of legacy problems (took about 3 years to build). I think a lot of those years were spent wrestling with the monster that is EJB 1.1. The only way I thought the project can even be on time is to scrap the entire presentation layer (aka Struts) and redo it in Wicket with 1 dedicated developer while the rest of the team work on killing the beast that is EJB 1.1 by refactoring the biz code. Sigh, my choices are stark. It's either to keep the job and plough ahead and probably fail spectacularly 9 months later or go hungry and explain to my wife why we need to spend less on the kid.. It's easy to blame the tech committee but they did help me find wicket by rejecting my initial proposal to build the new system on a (JQuery+JSON+REST) framework, which can be very productive as well, if not as clean as Wicket. Sorry for rambling so much. Is there any way I can demolish the silly low adoption rate argument (omg I still don't believe it can be so lame)? Lester - 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
Orderable ListView
I am trying to create what is easily described as the right half of the Palette. The following functionality needed is: 1. Add items to the list via AJAX 2. Move an individual item either up or down in the list 3. Persist the ordered list to the model so the form has the correct order The palette does this but the available list is not really needed. Has someone does this before and does it work? The London Wicket ListEditor code does not work. The jar in wicket-stuff for something similar is very out-dated and does not compile with wicket 1.4.3 Any ideas on how I can accomplish this? This goes back to the question posted to the mailing list a few weeks back. Is there a list of components that have been built that is up to date? Why aren't components shared more often? It seems to grow adoption of Wicket that a component library is needed like other frameworks [.Net, JQuery, JSF, etc...]
Palette - adding available choice via AJAX
I have a palette defined with a set of available choices. I can move those choices to the right into the selected choices. On my page I have a modal popup that can be launched to add a custom choice. The choice is added to the available choices in the palette but the selected choices are reset. How do I keep the selected choices set and add the new choice to remaining available choices. I have done a Google search but don't have the correct keywords to find anything useful. The key pieces of code are below. Thanks. Private List definedOptions = new ArrayList(); // code found in constructor of page final Palette palette = new Palette(options, new Model((Serializable)definedOptions), renderer, 10, true); palette.setMarkupId(palette); palette.setOutputMarkupId(true); palette.setOutputMarkupPlaceholderTag(true); add(palette); // code found in the onclick of the AjaxLink on the page definedOptions.add(opt); target.addComponent(palette); ___ Jeffrey A. Schneller Envisa End-to-End E-Commerce for the Multi-Channel Merchant 281 Pleasant Street Framingham, MA 01701 P: (508) 405-1220 x115 C: (508) 954-8044 F: (508) 405-1219
Palette adding choices
I have a palette defined with a set of available choices. I can move those choices to the right into the selected choices. On my page I have a modal popup that can be launched to add a custom choice. The choice is added to the available choices in the palette but the selected choices are reset. How do I keep the selected choices set and add the new choice to remaining available choices. I have done a Google search but don't have the correct keywords to find anything useful. The key pieces of code are below. Thanks. Private List definedOptions = new ArrayList(); // code found in constructor of page final Palette palette = new Palette(options, new Model((Serializable)definedOptions), renderer, 10, true); palette.setMarkupId(palette); palette.setOutputMarkupId(true); palette.setOutputMarkupPlaceholderTag(true); add(palette); // code found in the onclick of the AjaxLink on the page definedOptions.add(opt); target.addComponent(palette);
Wicket + Spring + Hibernate - Wicket-In-Action
At the link[1] it describes how to configure wicket to use Spring and Hibernate. In the applicationContext.xml file there is reference to a n interceptor bean. What is this interceptor bean? What is the definition of this bean? Everything else seems to make sense. Also how would one move the configuration of the jdbc connection to code? It is desirable to db connection information reside at the server level so when deploying code from dev to stage to production, you do not need change or replace a file. The configuration is at the server level [in the server context] and it is pulled from there. Thanks. [1] http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
RE: OT: Relational database + Hibenate vs Content Repository (Jackrabbit)
I would be interested in learning what everyone thinks about this. I am planning on using a relational db as described below for things like users, roles, and other relational type things. I am planning on using a JCR for content based things like comments, descriptions, etc... The problem is I need to find a JCR administration tool that just will manage the data and not force me to run the server through the CMS system like Brix, and a bunch of others do. -Original Message- From: danisevsky [mailto:danisev...@gmail.com] Sent: Thursday, November 12, 2009 3:31 AM To: users@wicket.apache.org Subject: Re: OT: Relational database + Hibenate vs Content Repository (Jackrabbit) I think the best solution is combine JCR and relation database. Some data store to JCR (on filesystem) a some to database. But question is for which kind of data si better JCR. My opinion is that data like photos, blogs, comments is better store in JCR and data like users, roles, classifiers is better store in databaze. What do you think, is it right? 2009/11/12 Jeremy Thomerson jer...@wickettraining.com Anybody have thoughts on this? I am curious also. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 4, 2009 at 10:27 AM, danisevsky danisev...@gmail.com wrote: Hallo, I am thinking about learning and using Jackrabbit instead of relational database (+ Hibernate) in my new wicket application (which will be build on Brix CMS). Is it very wrong idea? Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: OT: Relational database + Hibenate vs Content Repository (Jackrabbit)
Scott, This goes slightly off-topic to wicket but I will post anyhow. That is exactly my plan. Transactional data and data that someone may want to report on would be in a relational database. The content repository would be for exactly that the content. The problem is I don't want to layer on a CMS server based system like Brix, Hippo, or OpenCMS. I just want some way to manage the content through a content repository (Jackrabbit) and I will use the API to pull the content into the appropriate areas on the site. Yes, I know I could build an administration UI to manage the content in Jackrabbit but really looking for something pre-built. -Original Message- From: Scott Swank [mailto:scott.sw...@gmail.com] Sent: Thursday, November 12, 2009 11:44 AM To: users@wicket.apache.org Subject: Re: OT: Relational database + Hibenate vs Content Repository (Jackrabbit) Before you consider a non-rdbms solution you should really think about who might be interested in your data. If anyone in the organization is going to want to report on, or do analysis of the data then it should be in a relational db. How many X per hour, and how does that compare with the same value at this time last week? What is the ratio between the cost of A and the number of B per day? etc. So yes, a blog is perfect for a cms. Most of the work that is central to a given organization is not. Cheers, Scott On Thu, Nov 12, 2009 at 6:25 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I would be interested in learning what everyone thinks about this. I am planning on using a relational db as described below for things like users, roles, and other relational type things. I am planning on using a JCR for content based things like comments, descriptions, etc... The problem is I need to find a JCR administration tool that just will manage the data and not force me to run the server through the CMS system like Brix, and a bunch of others do. -Original Message- From: danisevsky [mailto:danisev...@gmail.com] Sent: Thursday, November 12, 2009 3:31 AM To: users@wicket.apache.org Subject: Re: OT: Relational database + Hibenate vs Content Repository (Jackrabbit) I think the best solution is combine JCR and relation database. Some data store to JCR (on filesystem) a some to database. But question is for which kind of data si better JCR. My opinion is that data like photos, blogs, comments is better store in JCR and data like users, roles, classifiers is better store in databaze. What do you think, is it right? 2009/11/12 Jeremy Thomerson jer...@wickettraining.com Anybody have thoughts on this? I am curious also. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 4, 2009 at 10:27 AM, danisevsky danisev...@gmail.com wrote: Hallo, I am thinking about learning and using Jackrabbit instead of relational database (+ Hibernate) in my new wicket application (which will be build on Brix CMS). Is it very wrong idea? 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Replacing a panel with another panel
Thanks Igor. That did it. I knew it couldn't be that complicated. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, October 28, 2009 11:16 PM To: users@wicket.apache.org Subject: Re: Replacing a panel with another panel class mycomponent { component A; void onclick() { component B=new something(A.getId()); A.replaceWith(B); A=B; } } the A=B is what you are missing. -igor On Wed, Oct 28, 2009 at 7:06 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: So how would I reference B rather than A on all subsequent calls after the first. Is it as simple as checking to see if A does not have some property set? Then just use an if/then/else statement to use the correct panel. Thanks. -Original Message- From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com] Sent: Wed 10/28/2009 6:20 PM To: users@wicket.apache.org Subject: Re: Replacing a panel with another panel I am trying to replace a panel with another panel. The replacement works the first time. The next time I click on the replacement link, I get an exception. java.lang.IllegalStateException: This method can only be called on a component that has already been added to its parent. My guess is that you are referencing the the first panel again. When you replace panel A with panel B, panel A loses it's reference to the parent (which goes to B obviously), so if you were to replace on A again, you get an exception like that. The solution is to reference B rather than A. Eelco - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Wicket and JQuery
Can you expand on this? The plan was to replace components via ajax [using wicket's ajax support] and have the jquery+plugins skin the components. For example: Have a jQuery accordion that in each accordion step allows the user to click a button or a link. The button or the link would display a jquery dialog that the user can do something with [make a selection] and then other elements on the page would be updated to show what the user selected. The other elements on the page will also be jquery+plugins skinned elements. -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Wednesday, October 28, 2009 12:38 AM To: users@wicket.apache.org Subject: Re: Wicket and JQuery ... and expect trouble with ajaxifying jquery plugins that skin html components. They will not work properly if you replace your components via ajax - or at least you might have to work hard on it. ** Marin 2009/10/27 Jeremy Thomerson jer...@wickettraining.com: I'd suggest only using jQuery for the UI effects and let Wicket do the AJAX. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 27, 2009 at 4:06 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am trying to determine how to use Wicket and JQuery. I would prefer not using wiQuery or similar. I would like to just include the jQuery libraries in my html and then use jQuery as javascript and not wrap everything in java on the server side to generate the client code. How would one go about doing this? I assume the basic jQuery functionality is straight forward. However how would you implement jQuery code that uses Ajax to communicate back to the server using Wicket on the server? Or would the recommendation be to let Wicket handle the Ajax communication and only use jQuery for the UI components such as Lightbox, Greybox, apple like sliders, etc. Any ideas? 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: Wicket and JQuery
Richard, You lost me a bit with the AbstractAjaxBehaviour stuff. Was this to get wiquery to work or to not use wiquery. The problems I saw with wiquery when I first looked [a few weeks back] at were: 1) seemed a bit of a work-in-progress / proof of concept, 2) lack of samples + a good base of users, 3) how to integrate with the various plugins that are out there. I just took a second look at the wiquery site and it looks much better then when I first looked. There are now samples with code that actual work and the mailing list is getting more traffic. I still have a concern with integrating the various plugins available for jQuery. I don't want to re-invent the wheel and really don't want to spend time writing java code to get a jQuery plugin to be used with wiQuery. The point of the plugin is to not have to write additional code. How would I integrate the various plugins available into wiQuery? Thanks. -Original Message- From: richardwilko [mailto:richardjohnwilkin...@gmail.com] Sent: Wednesday, October 28, 2009 5:57 AM To: users@wicket.apache.org Subject: Re: Wicket and JQuery Hi Jeffery, I would be interested to know what put you off about wiquery, any feedback is always welcome. Anyway, for ajax communication, add an AbstractAajxBehaviour to your page / component, and use the url this generates to pass to your jquery ajax something like this: String callbackurl = ajaxBehaviour.getCallbackUrl(true).toString(). String ajaxJs = $.get(' + callbackurl +', function(data){alert('Data Loaded: ' + data);}); When you make an ajax request to this url the onRequest method is called, mine typically look like this: public void onRequest() { final RequestCycle requestCycle = RequestCycle.get(); final PageParameters pageParameters = new PageParameters(requestCycle.getRequest().getParameterMap()); } Using the page parameters object lets you get access to the request parameters easily. If you do not intend to return a result then you should add this line in: RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); to stop a response being sent. As for ajax replacing of ui components, I usually find that re-running the javascript code to create the ui component works fine. Or another way to get round the problem is to have a element inside the main javascript ui container, and only replace that. Hope this helps Regards - Richard Wilkinson Developer, jWeekend: OO Java Technologies - Development and Training http://jWeekend.com Jeffrey Schneller wrote: I am trying to determine how to use Wicket and JQuery. I would prefer not using wiQuery or similar. I would like to just include the jQuery libraries in my html and then use jQuery as javascript and not wrap everything in java on the server side to generate the client code. How would one go about doing this? I assume the basic jQuery functionality is straight forward. However how would you implement jQuery code that uses Ajax to communicate back to the server using Wicket on the server? Or would the recommendation be to let Wicket handle the Ajax communication and only use jQuery for the UI components such as Lightbox, Greybox, apple like sliders, etc. Any ideas? Thanks. - http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk -- View this message in context: http://www.nabble.com/Wicket-and-JQuery-tp26085243p26091993.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Replacing a panel with another panel
I am trying to replace a panel with another panel. The replacement works the first time. The next time I click on the replacement link, I get an exception. java.lang.IllegalStateException: This method can only be called on a component that has already been added to its parent. You will see I am trying to use jQuery . The jquery piece seems to be functioning correctly. I am getting the accordion and also the dialog popup. I do notice that in the DOM I am getting 2 divs for the dialog after the replacement. Thanks. Here is the java code for the page: final WebMarkupContainer options = new WebMarkupContainer(options); options.setMarkupId(options); options.setOutputMarkupId(true); options.setOutputMarkupPlaceholderTag(true); final Panel testPanel = new TabPanelStart(optPanel); testPanel.setMarkupId(dialog); testPanel.setOutputMarkupId(true); testPanel.setOutputMarkupPlaceholderTag(true); add(testPanel); final TabPanel2 panel2 = new TabPanel2(panel2); panel2.setOutputMarkupId(true); panel2.setOutputMarkupPlaceholderTag(true); TabPanel3 panel3 = new TabPanel3(panel3); TabPanel panel1 = new TabPanel(panel1) { @Override void setContent(AjaxRequestTarget target) { Panel myPanel = new TestPanel(testPanel.getId()) { @Override public void refresh(AjaxRequestTarget target) { target.addComponent(panel2); target.addComponent(options); } }; myPanel.setMarkupId(dialog); myPanel.setOutputMarkupId(true); testPanel.replaceWith(myPanel); target.addComponent(myPanel); } }; options.add(panel1); options.add(panel2); options.add(panel3); add(options); Here is the TabPanel class: public TabPanel(String id) { super(id); AjaxLink link = new AjaxLink(link) { @Override public void onClick(AjaxRequestTarget target) { setContent(target); target.appendJavascript($e('#dialog').dialog({ autoOpen: false });); target.appendJavascript($e('#dialog').dialog('open');); } }; add(link); } abstract void setContent(AjaxRequestTarget target); Here is the TestPanel class: public TestPanel(String id) { super(id); AjaxLink link = new AjaxLink(opt1) { @Override public void onClick(AjaxRequestTarget target) { refresh(target); this.getSession().error(The user selected something in option 1); target.appendJavascript($e('#dialog').dialog('close');); target.appendJavascript($e(document).trigger('optionsUpdated');); //target.appendJavascript($e('#options').accordion( 'activate' , false );); target.appendJavascript($e('#options').accordion( 'activate' , 1 );); } }; add(link); } abstract public void refresh(AjaxRequestTarget target);
RE: Replacing a panel with another panel
So how would I reference B rather than A on all subsequent calls after the first. Is it as simple as checking to see if A does not have some property set? Then just use an if/then/else statement to use the correct panel. Thanks. -Original Message- From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com] Sent: Wed 10/28/2009 6:20 PM To: users@wicket.apache.org Subject: Re: Replacing a panel with another panel I am trying to replace a panel with another panel. The replacement works the first time. The next time I click on the replacement link, I get an exception. java.lang.IllegalStateException: This method can only be called on a component that has already been added to its parent. My guess is that you are referencing the the first panel again. When you replace panel A with panel B, panel A loses it's reference to the parent (which goes to B obviously), so if you were to replace on A again, you get an exception like that. The solution is to reference B rather than A. Eelco - 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
Wicket and JQuery
I am trying to determine how to use Wicket and JQuery. I would prefer not using wiQuery or similar. I would like to just include the jQuery libraries in my html and then use jQuery as javascript and not wrap everything in java on the server side to generate the client code. How would one go about doing this? I assume the basic jQuery functionality is straight forward. However how would you implement jQuery code that uses Ajax to communicate back to the server using Wicket on the server? Or would the recommendation be to let Wicket handle the Ajax communication and only use jQuery for the UI components such as Lightbox, Greybox, apple like sliders, etc. Any ideas? Thanks.
Date Validation - message formatting
I looked around and saw various discussions on how to format the date for the error message in the DateValidator. Was there a fix for this? I am using DateValidator.minimum and I would like the date that is the minimum to be formatted with just MMM-dd- or dd-MMM- based on the locale. Is there a way to do this with the DateValidator.minimum as it is today [1.4.1] Thanks.
DateValidator - formatting date in the error message
I looked around and saw various discussions on how to format the date for the error message in the DateValidator. Was there a fix for this? I am using DateValidator.minimum and I would like the date that is the minimum to be formatted with just MMM-dd- or dd-MMM- based on the locale. Is there a way to do this with the DateValidator.minimum as it is today [1.4.1] Thanks.
AjaxFallbackDefaultDataTable - modifying look
I am using the AjaxFallbackDefaultDataTable for displaying a data table on my page. I have everything working [displaying of data, sorting columns. Paging]. I know would like to change the look and feel of the data table. I would like to be able to change the navigation toolbar so that the paging links appear directly to the right of the showing 1 to 15 of X? The html file has the paging links defined as a text-align: right in the html and it can't be overwritten with css classes. This is great for narrow width tables but a table that scrolls horizontally the navigation is lost on the far right. It looks like the navigation toolbar is automatically added by the constructor of the AjaxFallbackDrfaultDataTable. Is there a way to use my own Navigation Toolbar or make the changes so I can control the layout of the navigation toolbar. Thanks.
RE: AjaxFallbackDefaultDataTable - modifying look
Fair enough. Is there an example of how one should be created? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, October 20, 2009 1:53 PM To: users@wicket.apache.org Subject: Re: AjaxFallbackDefaultDataTable - modifying look dont use the Default version of the data table, create one yourself. -igor On Tue, Oct 20, 2009 at 10:48 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am using the AjaxFallbackDefaultDataTable for displaying a data table on my page. I have everything working [displaying of data, sorting columns. Paging]. I know would like to change the look and feel of the data table. I would like to be able to change the navigation toolbar so that the paging links appear directly to the right of the showing 1 to 15 of X? The html file has the paging links defined as a text-align: right in the html and it can't be overwritten with css classes. This is great for narrow width tables but a table that scrolls horizontally the navigation is lost on the far right. It looks like the navigation toolbar is automatically added by the constructor of the AjaxFallbackDrfaultDataTable. Is there a way to use my own Navigation Toolbar or make the changes so I can control the layout of the navigation toolbar. 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: AjaxFallbackDefaultDataTable - modifying look
Thanks. That worked perfectly. I now have my own AjaxFallbackCustomDataTable. Jeff -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Tuesday, October 20, 2009 2:03 PM To: users@wicket.apache.org Subject: Re: AjaxFallbackDefaultDataTable - modifying look example of how to create an DataTable? you can use the AjaxFallbackDefaultDataTable as an example :) On Tue, Oct 20, 2009 at 4:00 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Fair enough. Is there an example of how one should be created? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, October 20, 2009 1:53 PM To: users@wicket.apache.org Subject: Re: AjaxFallbackDefaultDataTable - modifying look dont use the Default version of the data table, create one yourself. -igor On Tue, Oct 20, 2009 at 10:48 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am using the AjaxFallbackDefaultDataTable for displaying a data table on my page. I have everything working [displaying of data, sorting columns. Paging]. I know would like to change the look and feel of the data table. I would like to be able to change the navigation toolbar so that the paging links appear directly to the right of the showing 1 to 15 of X? The html file has the paging links defined as a text-align: right in the html and it can't be overwritten with css classes. This is great for narrow width tables but a table that scrolls horizontally the navigation is lost on the far right. It looks like the navigation toolbar is automatically added by the constructor of the AjaxFallbackDrfaultDataTable. Is there a way to use my own Navigation Toolbar or make the changes so I can control the layout of the navigation toolbar. 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 -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Localization of values coming from my Model
I am trying to display a page using my CompoundPropertyModel however some of the values coming from the model need to be localized before displaying to the user. This is being done inside of a wizard step. For example: My model has the following properties String gender boolean active Gender is either male or female I have a getter in my object which is getActiveString which returns Yes or No based on the T/F of the Boolean.public String getActiveString() {if (active) { return Yes;} else {return No;}} The html is: span wicket:id=gender/span span wicket:id=activeString/span The java code is: add(new Label(gender)); add(new Label(activeString)); The issue is that I need to localize the gender value. The activeString also needs to be localized. How would one do this? I need to store the values in the model as they are since it is being persisted to a db. However for certain users the data needs to be shown in their particular language when presented on the page. Any ideas? BTW... thanks you all for your previous help. I am finally in the final steps of development for my project. Thanks.
RE: Localization of values coming from my Model
I tried this and it seems to work. Is this a correct way of doing it? Label gender = new Label(gender, new StringResourceModel(${gender}, this, model)); add(gender); Obviously the StringResourceModel uses the property file for the page. Thanks. -Original Message- From: Bernhard Michal [mailto:michal.bernh...@tigra.cz] Sent: Friday, October 16, 2009 1:39 PM To: users@wicket.apache.org Subject: RE: Localization of values coming from my Model Why don't you use special model for each component? Because this is very specific thing - CompoundPropertyModel is not supposed for this kind of model value's processing stuff. For example for activeString: add(new Label(activeString, new AbstractReadOnlyModelString() { @Override public String getObject() { return getString(yourModel.getActiveString()); } })); Anyway if you want it you can still write your own implementation of CompoundPropertyModel... -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Friday, October 16, 2009 4:36 PM To: users@wicket.apache.org Subject: Localization of values coming from my Model I am trying to display a page using my CompoundPropertyModel however some of the values coming from the model need to be localized before displaying to the user. This is being done inside of a wizard step. For example: My model has the following properties String gender boolean active Gender is either male or female I have a getter in my object which is getActiveString which returns Yes or No based on the T/F of the Boolean.public String getActiveString() {if (active) { return Yes;} else {return No;}} The html is: span wicket:id=gender/span span wicket:id=activeString/span The java code is: add(new Label(gender)); add(new Label(activeString)); The issue is that I need to localize the gender value. The activeString also needs to be localized. How would one do this? I need to store the values in the model as they are since it is being persisted to a db. However for certain users the data needs to be shown in their particular language when presented on the page. Any ideas? BTW... thanks you all for your previous help. I am finally in the final steps of development for my project. 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: Localization of values coming from my Model
Then is the javadoc wrong? This was taken right from the javadoc? http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wic ket/model/StringResourceModel.html === Example 2 In this example, the resource key is selected based on the evaluation of a property expression: public MyPage extends WebPage { public MyPage(final PageParameters parameters) { WeatherStation ws = new WeatherStation(); add(new Label(weatherMessage, new StringResourceModel(weather.${currentStatus}, this, new Model(ws))); } } Which will call the WeatherStation.getCurrentStatus() method each time the string resource model is used and where the resource bundle for the page contains the entries: weather.sunny=Don't forget sunscreen! weather.raining=You might need an umbrella weather.snowing=Got your skis? weather.overcast=Best take a coat to be safe -Original Message- From: Bernhard Michal [mailto:michal.bernh...@tigra.cz] Sent: Friday, October 16, 2009 2:15 PM To: users@wicket.apache.org Subject: RE: Localization of values coming from my Model It doesn't seem correct... StringResourceModel expect string which is supposed to be resource key to find localization in resource bundle. I recommend you to read http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications .html. -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] I tried this and it seems to work. Is this a correct way of doing it? Label gender = new Label(gender, new StringResourceModel(${gender}, this, model)); add(gender); Obviously the StringResourceModel uses the property file for the page. -Original Message- From: Bernhard Michal [mailto:michal.bernh...@tigra.cz] Why don't you use special model for each component? Because this is very specific thing - CompoundPropertyModel is not supposed for this kind of model value's processing stuff. For example for activeString: add(new Label(activeString, new AbstractReadOnlyModelString() { @Override public String getObject() { return getString(yourModel.getActiveString()); } })); Anyway if you want it you can still write your own implementation of CompoundPropertyModel... -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] I am trying to display a page using my CompoundPropertyModel however some of the values coming from the model need to be localized before displaying to the user. This is being done inside of a wizard step. For example: My model has the following properties String gender boolean active Gender is either male or female I have a getter in my object which is getActiveString which returns Yes or No based on the T/F of the Boolean.public String getActiveString() {if (active) { return Yes;} else {return No;}} The html is: span wicket:id=gender/span span wicket:id=activeString/span The java code is: add(new Label(gender)); add(new Label(activeString)); The issue is that I need to localize the gender value. The activeString also needs to be localized. How would one do this? I need to store the values in the model as they are since it is being persisted to a db. However for certain users the data needs to be shown in their particular language when presented on the page. Any ideas? - 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
Wizard step causing an infinite loop
I have a wizard and a wizard step. The wizard step is causing the wizard to go into an infinite loop. The loop starts way back at where the wizard is added to the page itself. I basically have a one step wizard. Now, I also have another step and if I add that step to the wizard and remove the other one [so I only have a 1 step wizard] everything works fine. Why would I be getting an infinite loop? The step only has RequiredTextFields, RadioGroup, and RadioChoice objects on it. Again... I am pleading for help on this. I am stuck and have no idea where to look and need to get this finished. Thanks.
RE: Wizard step causing an infinite loop
That is sort of a problem. Everything is driven from a db and creating a quickstart would be a major task. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Monday, October 12, 2009 11:41 AM To: users@wicket.apache.org Subject: Re: Wizard step causing an infinite loop creating a quickstart that reproduces this behavior will help us help you. otherwise we would have to slaughter a chicken and wave it around. -igor On Mon, Oct 12, 2009 at 8:12 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I have a wizard and a wizard step. The wizard step is causing the wizard to go into an infinite loop. The loop starts way back at where the wizard is added to the page itself. I basically have a one step wizard. Now, I also have another step and if I add that step to the wizard and remove the other one [so I only have a 1 step wizard] everything works fine. Why would I be getting an infinite loop? The step only has RequiredTextFields, RadioGroup, and RadioChoice objects on it. Again... I am pleading for help on this. I am stuck and have no idea where to look and need to get this finished. 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: Wizard step causing an infinite loop
UPDATE: The problem is tied to the radio group. I want to do something like the following. Where productGroup is the RadioGroup. Where do I put the RadioGroup so that this will work. Where it currently sits will not work. div span wicket:id=productGroup table border=0 tr tdinput wicket:id=p1 type=radio/span wicket:id=p1Name/span/td tdinput wicket:id=p2 type=radio/span wicket:id=p2Name/span/td tdinput wicket:id=p3 type=radio/span wicket:id=p3Name/span/td /tr tr tdimg src=product/p1.png/img/td tdimg src=product/p2.png/td tdimg src=product/p3.png/td /tr /table /span /div -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Monday, October 12, 2009 12:00 PM To: users@wicket.apache.org Subject: RE: Wizard step causing an infinite loop That is sort of a problem. Everything is driven from a db and creating a quickstart would be a major task. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Monday, October 12, 2009 11:41 AM To: users@wicket.apache.org Subject: Re: Wizard step causing an infinite loop creating a quickstart that reproduces this behavior will help us help you. otherwise we would have to slaughter a chicken and wave it around. -igor On Mon, Oct 12, 2009 at 8:12 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I have a wizard and a wizard step. The wizard step is causing the wizard to go into an infinite loop. The loop starts way back at where the wizard is added to the page itself. I basically have a one step wizard. Now, I also have another step and if I add that step to the wizard and remove the other one [so I only have a 1 step wizard] everything works fine. Why would I be getting an infinite loop? The step only has RequiredTextFields, RadioGroup, and RadioChoice objects on it. Again... I am pleading for help on this. I am stuck and have no idea where to look and need to get this finished. 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
Thank Jeremy. The LDM was causing the problem. It does make sense given your explanation. What do you intend with this code? public MyWizard(IModelFoo model) { super(new Model(model.getObject())); } The Wizard can only accept an IWizardModel and not the model I am going to back it with. Unless I am completely twisted up. Did you intend this to be the WizardStep? How then can I get my modal popup to store the values entered into it when the user presses a save button and discard them and keep the values from the model in the WizardStep if the user presses cancel. Thanks. Jeff -Original Message- From: Jeremy Thomerson [mailto:jer...@wickettraining.com] Sent: Thursday, October 08, 2009 11:03 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step Jeff, Sorry I have not had time to read the entire post and that you have not found better documentation on this issue. However, your problem on this is almost certainly caused by the LoadableDetachableModel that is backing your CompoundPropertyModel in your wizard. Since a wizard is a multi-page process, you can not really use an LDM to back it unless you persist changes after every step. With an LDM (and not persisting changes at every step), you end up with something like this flow: WizardPageOne - load model from LDM (presumably DB) - display page with form - submit page - load model from LDM (presumably DB) - stick values onto model object - redirect to page two WizardPageTwo - load model from LDM (presumably DB) This is where the problem is - because those changes weren't persisted, the model was detached, and when page two was rendered, reloaded. The changes were lost. So, in your situation, substitute the modal window for page two - the changes weren't making it into the model object that was used in the modal. So, in any multi-page process, you either need to persist the changes back down to wherever the LDM is loading from, or simply remove the LDM when the wizard (or other multi-page process) is started, OR pass the model object directly onto the other steps. I find it easiest to do something similar to this: public MyWizard(IModelFoo model) { super(new Model(model.getObject())); } Since the model holds on to the actual object between requests, your changes stay on the model object without persisting to your data store between each request. This goes against the standard use of models where you want something to detach after every request, so it is counter-intuitive, but it is actually very similar in thought to most any framework - where you will need to hold a transient object in session during a multi-page process or persist a partially-completed model object to the data store on every request. Hope this helps! -- Jeremy Thomerson http://www.wickettraining.com On Thu, Oct 8, 2009 at 3:43 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? To find out how to do something who would think to look in the issue tracking system which contains bugs and enhancement requests. Anyhow, I resolved my loading of the modal with data by ditching the LoadableDetachableModel for the time being and using a CompoundPropertyModel. I know it is not correct but it works for now. Now I am attempting to get the data back into the form that the modal is called from. You would think this is easy. But again I am stuck. Wizard WizardStep == data show is read only with a modify link which brings the modal up. Modal == shows the data as editable. Allows user to press submit button which closes window and updates the data in the WizardStep Please, any help with a simple real example will be appreciated. Pointing someone to a past post which may touch on the topic in the context of another question is not help. I am sure someone knows how to solve my issue. Thanks. PS: I need to stick with Wicket because I am at the point of no return on this project. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 4:01 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I disagree, at the moment a got this trouble, few minutes was necessary to I understand what was happening... any way: https://issues.apache.org/jira/browse/WICKET-2515 On Thu, Oct 8, 2009 at 2:32 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: We are using wicket to have clean html void of jsp tags. Because they cause maintenance problems as the sites evolve over time. Wicket was suggested as a possible solution for this. Which it is but the lack of decent documentation/examples of real world issues is getting to be an issue. -Original Message- From
Modal inside a WizardStep
I have a modal inside a wizard step. The modal is displaying and showing data. The modal is using a panel and not a page. The panel for the modal contains a form with text fields. The wizard step contains labels. I want to have a save and a cancel button in the modal. The save should take the values from the text fields and update the model in the wizard step. The wizard step should now show the updated values in the label. I tried implementing an AjaxButton in the panel for the modal but it never does anything. How would one do this? Example code, pseudo-code? Thanks.
RE: Modal inside a WizardStep
Think of an order form. Step 1 you enter the products you want to order. Step 2 based on your account it pulls up a list of billing addresses. In step 2 you choose your billing address and the details of the billing address are shown in step 2 with a modify link. The modify link allows you to modify the information and then when done the modified information is shown as the billing address in step 2. Step 3 is the shipping information with the same idea as step 2. Step 4 would be a confirmation of everything entered. Then 'Finish'. This to me is a very common way to use a wizard and modal windows. -Original Message- From: Jeremy Thomerson [mailto:jer...@wickettraining.com] Sent: Friday, October 09, 2009 12:37 PM To: users@wicket.apache.org Subject: Re: Modal inside a WizardStep I keep wondering, too, what you are doing in the wizard that needs an editing modal popup. Typically, wizards are used for multi-step forms. So to me it's weird to have a wizard that isn't the form - but displays values that you are then editing from a modal. Just curious -- Jeremy Thomerson http://www.wickettraining.com On Fri, Oct 9, 2009 at 11:35 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Some very brief pseudo code. Let us know if you need more detail. public MyWizard(IModelFoo model) { setModel(new ModelFoo(model.getObject()); initialize wizard steps - passing them this.getModel() so they all use the same model } make sure to pass all of your wizard steps AND the form inside your modal the same model. Then, in your wizard step and form, use property models (or a compound property model): new MyStep(IModelFoo model) { setModel(model); add(new Label(firstName, new PropertyModel(model, firstName)); .. or .. setModel(new CompoundPropertyModel(model)); add(new Label(firstName); } new MyForm(IModelFoo model) { setModel(model); add(new TextField(firstName, new PropertyModel(model, firstName)); .. or .. setModel(new CompoundPropertyModel(model)); add(new TextField(firstName); } By doing this, your modal form will actually update the object that is also backing the wizard. Then, you should just be able to submit the form, close the modal, and add the wizard step components to the ajax request (so that they will be repainted). When they are repainted, they will pull the values from the model object, which was updated by your form. If you hit a wall with that, you *may* have to set the model on your wizard step to the model from your form. For instance: // in your ajax submit: MyStep.this.setModel(form.getModel()) target.addComponent(MyStep.this.panelThatShowsYourStuff) // close modal -- Jeremy Thomerson http://www.wickettraining.com On Fri, Oct 9, 2009 at 11:24 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I have a modal inside a wizard step. The modal is displaying and showing data. The modal is using a panel and not a page. The panel for the modal contains a form with text fields. The wizard step contains labels. I want to have a save and a cancel button in the modal. The save should take the values from the text fields and update the model in the wizard step. The wizard step should now show the updated values in the label. I tried implementing an AjaxButton in the panel for the modal but it never does anything. How would one do this? Example code, pseudo-code? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
Thanks for the example. It makes perfect sense now that I see it. I can even run the sample as its own project and see it working. Now, I took your example and put it into my project's codebase and the submit button in the modal panel does not cause the form to be submitted. Obviously I have something wrong with my code. Any ideas on why the submit button does not cause any code to fire. The ajax debugger is showing that my button is not returning any data. In the Ajax Debugger for my app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:2:irf:form:view:modalWindow:content:modifyPerson:save ::IActivePageBehaviorListener:0:1wicket:ignoreIfNotActive=truerandom=0 .6665615341811421 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (69 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response INFO: Response parsed. Now invoking steps... In the Ajax Debugger for the sample app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:0:wizard:form:view:modalWindow:content:form:submit::I ActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truerandom=0.3 515502192017532 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (1985 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket -event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js /script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket -ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript src=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Modal Window/res/modal.js/script link rel=stylesheet type=text/css href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Moda lWindow/res/modal.css / /head]]/header-contributioncomponent id=view3 ![CDATA[div class=wicketExtensionsWizardViewInner id=view3 name: labelt/labelbr / description: labelt/labelbr / span id=modalWindow4 style=display:none div id=content5 style=display:none/div /spanbr / a id=showModal6 href=# onclick=var wcall=wicketAjaxGet('?wicket:interface=:0:wizard:form:view:showModal::IB ehaviorListener:0:-1',null,null, function() {return Wicket.$('showModal6') != null;}.bind(this));return !wcall;show modal/a /div]]/componentevaluate![CDATA[var win; try { win = window.parent.Wicket.Window; } catch (ignore) { } if (typeof(win) == undefined || typeof(win.current) == undefined) { try { win = window.Wicket.Window; } catch (ignore) { } } if (typeof(win) != undefined typeof(win.current) != undefined) { var close = function(w) { w.setTimeout(function() { win.current.close(); }, 0); } try { close(window.parent); } catch (ignore) { close(window); }; }]]/evaluate/ajax-response INFO: Response parsed. Now invoking steps... From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Friday, October 09, 2009 1:15 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? It is just an wish for javadoc improvements, not the solution. Sending an example attached On Fri, Oct 9, 2009 at 1:49 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Sorry - typo on that step. The intent was that you use new Model(model.getObject()) to pull an object out of any potential loadable / detachable model that may be passed in. -- Jeremy Thomerson http://www.wickettraining.com
RE: Showing Modal window within a wizard step
The only difference I can see in the code is that I extend the wizard to be MyWizard and create the model, wizard model, and steps in the constructor. I then use MyWizard in the page rather than the generic Wizard. I don't think anything should be different because I extended the same Wizard that is used. So close, yet still so far from working -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Friday, October 09, 2009 3:04 PM To: users@wicket.apache.org Subject: RE: Showing Modal window within a wizard step Thanks for the example. It makes perfect sense now that I see it. I can even run the sample as its own project and see it working. Now, I took your example and put it into my project's codebase and the submit button in the modal panel does not cause the form to be submitted. Obviously I have something wrong with my code. Any ideas on why the submit button does not cause any code to fire. The ajax debugger is showing that my button is not returning any data. In the Ajax Debugger for my app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:2:irf:form:view:modalWindow:content:modifyPerson:save ::IActivePageBehaviorListener:0:1wicket:ignoreIfNotActive=truerandom=0 .6665615341811421 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (69 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response INFO: Response parsed. Now invoking steps... In the Ajax Debugger for the sample app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:0:wizard:form:view:modalWindow:content:form:submit::I ActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truerandom=0.3 515502192017532 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (1985 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket -event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js /script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket -ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript src=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Modal Window/res/modal.js/script link rel=stylesheet type=text/css href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Moda lWindow/res/modal.css / /head]]/header-contributioncomponent id=view3 ![CDATA[div class=wicketExtensionsWizardViewInner id=view3 name: labelt/labelbr / description: labelt/labelbr / span id=modalWindow4 style=display:none div id=content5 style=display:none/div /spanbr / a id=showModal6 href=# onclick=var wcall=wicketAjaxGet('?wicket:interface=:0:wizard:form:view:showModal::IB ehaviorListener:0:-1',null,null, function() {return Wicket.$('showModal6') != null;}.bind(this));return !wcall;show modal/a /div]]/componentevaluate![CDATA[var win; try { win = window.parent.Wicket.Window; } catch (ignore) { } if (typeof(win) == undefined || typeof(win.current) == undefined) { try { win = window.Wicket.Window; } catch (ignore) { } } if (typeof(win) != undefined typeof(win.current) != undefined) { var close = function(w) { w.setTimeout(function() { win.current.close(); }, 0); } try { close(window.parent); } catch (ignore) { close(window); }; }]]/evaluate/ajax-response INFO: Response parsed. Now invoking steps... From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Friday, October 09, 2009 1:15 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? It is just an wish for javadoc improvements, not the solution. Sending an example attached On Fri, Oct 9, 2009 at 1:49 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Sorry - typo on that step. The intent was that you use new Model(model.getObject()) to pull an object out of any potential loadable / detachable model that may be passed in. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
I figured it out, the form is not submitting because of Required Field validations. I have a FeedbackPanel in the modal window panel. However the messages are not appearing in the feedback panel. If I change the fields to required in the example and add a FeedbackPanel the same thing happens. The messages are never shown. Ideas? -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Friday, October 09, 2009 3:21 PM To: users@wicket.apache.org Subject: RE: Showing Modal window within a wizard step The only difference I can see in the code is that I extend the wizard to be MyWizard and create the model, wizard model, and steps in the constructor. I then use MyWizard in the page rather than the generic Wizard. I don't think anything should be different because I extended the same Wizard that is used. So close, yet still so far from working -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Sent: Friday, October 09, 2009 3:04 PM To: users@wicket.apache.org Subject: RE: Showing Modal window within a wizard step Thanks for the example. It makes perfect sense now that I see it. I can even run the sample as its own project and see it working. Now, I took your example and put it into my project's codebase and the submit button in the modal panel does not cause the form to be submitted. Obviously I have something wrong with my code. Any ideas on why the submit button does not cause any code to fire. The ajax debugger is showing that my button is not returning any data. In the Ajax Debugger for my app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:2:irf:form:view:modalWindow:content:modifyPerson:save ::IActivePageBehaviorListener:0:1wicket:ignoreIfNotActive=truerandom=0 .6665615341811421 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (69 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response INFO: Response parsed. Now invoking steps... In the Ajax Debugger for the sample app I see: INFO: Initiating Ajax POST request on ?wicket:interface=:0:wizard:form:view:modalWindow:content:form:submit::I ActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truerandom=0.3 515502192017532 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (1985 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket -event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js /script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket -ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript src=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Modal Window/res/modal.js/script link rel=stylesheet type=text/css href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.Moda lWindow/res/modal.css / /head]]/header-contributioncomponent id=view3 ![CDATA[div class=wicketExtensionsWizardViewInner id=view3 name: labelt/labelbr / description: labelt/labelbr / span id=modalWindow4 style=display:none div id=content5 style=display:none/div /spanbr / a id=showModal6 href=# onclick=var wcall=wicketAjaxGet('?wicket:interface=:0:wizard:form:view:showModal::IB ehaviorListener:0:-1',null,null, function() {return Wicket.$('showModal6') != null;}.bind(this));return !wcall;show modal/a /div]]/componentevaluate![CDATA[var win; try { win = window.parent.Wicket.Window; } catch (ignore) { } if (typeof(win) == undefined || typeof(win.current) == undefined) { try { win = window.Wicket.Window; } catch (ignore) { } } if (typeof(win) != undefined typeof(win.current) != undefined) { var close = function(w) { w.setTimeout(function() { win.current.close(); }, 0); } try { close(window.parent); } catch (ignore) { close(window); }; }]]/evaluate/ajax-response INFO: Response parsed. Now invoking steps... From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Friday, October 09, 2009 1:15 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? It is just an wish for javadoc improvements, not the solution. Sending an example attached On Fri, Oct 9, 2009 at 1:49 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Sorry - typo on that step. The intent was that you use new Model(model.getObject()) to pull an object out of any potential loadable / detachable model that may be passed
RE: Showing Modal window within a wizard step
I figured it out. I needed to have the feedback panel added back in the onError of the AjaxButton. Jeff From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Friday, October 09, 2009 1:15 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? It is just an wish for javadoc improvements, not the solution. Sending an example attached On Fri, Oct 9, 2009 at 1:49 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Sorry - typo on that step. The intent was that you use new Model(model.getObject()) to pull an object out of any potential loadable / detachable model that may be passed in. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Oct 9, 2009 at 9:09 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Thank Jeremy. The LDM was causing the problem. It does make sense given your explanation. What do you intend with this code? public MyWizard(IModelFoo model) { super(new Model(model.getObject())); } The Wizard can only accept an IWizardModel and not the model I am going to back it with. Unless I am completely twisted up. Did you intend this to be the WizardStep? How then can I get my modal popup to store the values entered into it when the user presses a save button and discard them and keep the values from the model in the WizardStep if the user presses cancel. Thanks. Jeff -Original Message- From: Jeremy Thomerson [mailto:jer...@wickettraining.com] Sent: Thursday, October 08, 2009 11:03 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step Jeff, Sorry I have not had time to read the entire post and that you have not found better documentation on this issue. However, your problem on this is almost certainly caused by the LoadableDetachableModel that is backing your CompoundPropertyModel in your wizard. Since a wizard is a multi-page process, you can not really use an LDM to back it unless you persist changes after every step. With an LDM (and not persisting changes at every step), you end up with something like this flow: WizardPageOne - load model from LDM (presumably DB) - display page with form - submit page - load model from LDM (presumably DB) - stick values onto model object - redirect to page two WizardPageTwo - load model from LDM (presumably DB) This is where the problem is - because those changes weren't persisted, the model was detached, and when page two was rendered, reloaded. The changes were lost. So, in your situation, substitute the modal window for page two - the changes weren't making it into the model object that was used in the modal. So, in any multi-page process, you either need to persist the changes back down to wherever the LDM is loading from, or simply remove the LDM when the wizard (or other multi-page process) is started, OR pass the model object directly onto the other steps. I find it easiest to do something similar to this: public MyWizard(IModelFoo model) { super(new Model(model.getObject())); } Since the model holds on to the actual object between requests, your changes stay on the model object without persisting to your data store between each request. This goes against the standard use of models where you want something to detach after every request, so it is counter-intuitive, but it is actually very similar in thought to most any framework - where you will need to hold a transient object in session during a multi-page process or persist a partially-completed model object to the data store on every request. Hope this helps! -- Jeremy Thomerson http://www.wickettraining.com On Thu, Oct 8, 2009 at 3:43 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? To find out how to do something who would think to look in the issue tracking system which contains bugs and enhancement requests. Anyhow, I resolved my loading of the modal with data by ditching the LoadableDetachableModel for the time being and using a CompoundPropertyModel. I know it is not correct but it works for now. Now I am attempting to get the data back into the form that the modal is called from. You would think this is easy. But again I am stuck. Wizard WizardStep == data show is read only with a modify link which brings the modal up. Modal == shows the data as editable. Allows user to press submit button which closes window and updates the data in the WizardStep Please, any help with a simple real example will be appreciated. Pointing someone to a past post which may touch
RE: Showing Modal window within a wizard step
Ok. How do I use the same model? The model I have on step 1 if I pass it into the modal window I get no data in the model. This was my original thought on how to do it but something isn't right. And yes I know the wiki example refers to a chooserPanel and in my case it is an editorPanel. I didn't expect the wiki to be the exact code that I needed but a starting example. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 7:03 AM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step Hi Jeffrey, the wiki example refers to an chooserPanel, that is not the case of your editorPanel. Simple use the same model on step 1 on your Modal window. On Wed, Oct 7, 2009 at 5:19 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am trying to show a modal window within a wizard step showing the same data the wizard step shows but as input text fields for editing. I have found some references to showing a wizard in a modal window and showing a wizard within a wizard but not what I am looking to do. I have the wizard steps appearing with the data and I have a modal popup being launched from the step via an AjaxLink. I can't figure out how to get the data from the wizard step and make it appear in the modal as well [so the user can edit the information]. I have a MyWizard object which in the constructor sets the default model to a CompoundPropertyModel of a LoadableDetachableModel of my data object. I then call a method in the constructor to set all the data of the model that I can from the database [which works]. The first step of the wizard shows any data that has been set in the model. How do I get my Modal window to show the same data from the model used to display data in step 1? I then will need to take the values entered in the modal and push them back into the wizard model. I am assuming this can be done via an entry in the wiki [1]. Thanks. [1] http://cwiki.apache.org/WICKET/pass-form-input-from-modal-window-back-to -the-caller-page.htmlhttp://cwiki.apache.org/WICKET/pass-form-input-fro m-modal-window-back-to%0A-the-caller-page.html -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
right. And yes I know the wiki example refers to a chooserPanel and in my case it is an editorPanel. I didn't expect the wiki to be the exact code that I needed but a starting example. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 7:03 AM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step Hi Jeffrey, the wiki example refers to an chooserPanel, that is not the case of your editorPanel. Simple use the same model on step 1 on your Modal window. On Wed, Oct 7, 2009 at 5:19 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I am trying to show a modal window within a wizard step showing the same data the wizard step shows but as input text fields for editing. I have found some references to showing a wizard in a modal window and showing a wizard within a wizard but not what I am looking to do. I have the wizard steps appearing with the data and I have a modal popup being launched from the step via an AjaxLink. I can't figure out how to get the data from the wizard step and make it appear in the modal as well [so the user can edit the information]. I have a MyWizard object which in the constructor sets the default model to a CompoundPropertyModel of a LoadableDetachableModel of my data object. I then call a method in the constructor to set all the data of the model that I can from the database [which works]. The first step of the wizard shows any data that has been set in the model. How do I get my Modal window to show the same data from the model used to display data in step 1? I then will need to take the values entered in the modal and push them back into the wizard model. I am assuming this can be done via an entry in the wiki [1]. Thanks. [1] http://cwiki.apache.org/WICKET/pass-form-input-from-modal-window-back-to -the-caller-page.htmlhttp://cwiki.apache.org/WICKET/pass-form-input-fro m-modal-window-back-to%0A-the-caller-page.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
We are using wicket to have clean html void of jsp tags. Because they cause maintenance problems as the sites evolve over time. Wicket was suggested as a possible solution for this. Which it is but the lack of decent documentation/examples of real world issues is getting to be an issue. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 12:38 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I have built multiple large sites with jsp/servlets/javascript/ajax that are 1000x more complex than what I am trying to do with less headaches. so why you are using wicket? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Showing Modal window within a wizard step
I am completely lost. I have no idea what this means. How can the resolution to my problem be a JIRA issue that was created earlier today? To find out how to do something who would think to look in the issue tracking system which contains bugs and enhancement requests. Anyhow, I resolved my loading of the modal with data by ditching the LoadableDetachableModel for the time being and using a CompoundPropertyModel. I know it is not correct but it works for now. Now I am attempting to get the data back into the form that the modal is called from. You would think this is easy. But again I am stuck. Wizard WizardStep == data show is read only with a modify link which brings the modal up. Modal == shows the data as editable. Allows user to press submit button which closes window and updates the data in the WizardStep Please, any help with a simple real example will be appreciated. Pointing someone to a past post which may touch on the topic in the context of another question is not help. I am sure someone knows how to solve my issue. Thanks. PS: I need to stick with Wicket because I am at the point of no return on this project. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 4:01 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I disagree, at the moment a got this trouble, few minutes was necessary to I understand what was happening... any way: https://issues.apache.org/jira/browse/WICKET-2515 On Thu, Oct 8, 2009 at 2:32 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: We are using wicket to have clean html void of jsp tags. Because they cause maintenance problems as the sites evolve over time. Wicket was suggested as a possible solution for this. Which it is but the lack of decent documentation/examples of real world issues is getting to be an issue. -Original Message- From: Pedro Santos [mailto:pedros...@gmail.com] Sent: Thursday, October 08, 2009 12:38 PM To: users@wicket.apache.org Subject: Re: Showing Modal window within a wizard step I have built multiple large sites with jsp/servlets/javascript/ajax that are 1000x more complex than what I am trying to do with less headaches. so why you are using wicket? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Storing entity object in session - how to do it?
Looking through the archives I saw some posts that said you should not store entity objects [for example object coming from hibernate] in the session. This makes sense to me as I just hit the problem. The archives gave lots of advice but everything seemed to contradict and no one posted a working solution. Current architecture: My wicket application is implementing Guice and Warp-Persist. I have a MySession object which extends WebSession. Inside MySession I wanted to store the entity object called Account [which has a bunch of lazy load properties from hibernate]. Obviously this isn't going to work. I have a MyUnauthorizedListener which implements IUnauthorizedComponentInstatiationListener so that I can send the user to a 'change password' page based on properties in their Account [flag for changing password or a time limit since last password change] or to a 'login' page if the password doesn't need to be changed. I also have a MyUserRolesAuthorizer which implements IRoleCheckingStrategy so that I can see if the account has the proper roles to view certain pages. Solution Tried: I thought of just storing the id of the account in the session. Then when I need the actual Account object I can just pull it from the db. This works fine on Pages but I can't inject the DAO into MyUnauthorizedListener and MyUserRolesAuthorizer since Guice only injects into components [correct?] Do I need to pass the Dao to MyUnauthorizedListener and MyUserRolesAuthorizer via the WebApplication [assuming this is a component]? Any ideas? Solutions? Or have I architected this incorrectly? Thanks.
Showing Modal window within a wizard step
I am trying to show a modal window within a wizard step showing the same data the wizard step shows but as input text fields for editing. I have found some references to showing a wizard in a modal window and showing a wizard within a wizard but not what I am looking to do. I have the wizard steps appearing with the data and I have a modal popup being launched from the step via an AjaxLink. I can't figure out how to get the data from the wizard step and make it appear in the modal as well [so the user can edit the information]. I have a MyWizard object which in the constructor sets the default model to a CompoundPropertyModel of a LoadableDetachableModel of my data object. I then call a method in the constructor to set all the data of the model that I can from the database [which works]. The first step of the wizard shows any data that has been set in the model. How do I get my Modal window to show the same data from the model used to display data in step 1? I then will need to take the values entered in the modal and push them back into the wizard model. I am assuming this can be done via an entry in the wiki [1]. Thanks. [1] http://cwiki.apache.org/WICKET/pass-form-input-from-modal-window-back-to -the-caller-page.html