Re: Login page hangs after custom page-expired error page
My apologies. I am reposting this without the distracting formatting. I created my own PageExpiredErrorPage with a button that says Return to home page and goes to the home page. Since we're using authorization the user first goes to the login page so they can log in before going to the home page. (That is how the button on the default page-expired error page works.) When the user first opens the web site, whether with the default or the custom page-expired page, they see a log in page with URL http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1. Here is how the default PageExpiredErrorPage works: After there is a page timeout and the default page-expired error page opens, the Return to home page button on the default page expired error page reports URL http://mydomain.com/rems/wicket/. When the user selects that button they go to the login page with address http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 and it goes to the home page as expected/desired when the user logs in. Here is how my custom page-expired error page works: After there is a page timeout and the custom page-expired error page opens, the Return to home page button on the default page expired error page reports URL http://mydomain.com/rems/wicket/ When the user selects that button they go to the login page with address http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. and it hangs when the user logs in. My custom page-expired error page HTML body h3Page Expired/h3 pThe page you requested has expired./p pa wicket:id=homeLinkReturn to home page/a/p /body Java: public class MyPageExpiredPage extends WebPage { public MyPageExpiredPage() { super(); // link for home page btn // WebPage#homePageLink returns a BookmarkablePageLink add( homePageLink(homeLink)); } } On 8/28/2011 6:58 AM, Martin Grigorov wrote: I can't really understand the question/problem The formatting is distracting and I miss the point :-/ On Fri, Aug 26, 2011 at 11:40 PM, Bruno Borgesbruno.bor...@gmail.com wrote: But still, why isn't Scott's case working? *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Fri, Aug 26, 2011 at 5:12 PM, Martin Grigorovmgrigo...@apache.orgwrote: for 1.6 - yes, I think. unless we find it useful for something On Fri, Aug 26, 2011 at 6:54 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: can we remove it then? -igor On Fri, Aug 26, 2011 at 8:19 AM, Martin Grigorovmgrigo...@apache.org wrote: actually #isErrorPage() is not used in current 1.5, so WIA is correct On Fri, Aug 26, 2011 at 6:15 PM, Scott Reedsr...@avacoda.com wrote: Thanks, Bruno. I added isErrorPage() just in case. The docs just say This can help the framework prevent infinite failure loops. That's also not mentioned in Wicket in Action which says creating an error page is no different than creating a normal page. Scott On 8/26/2011 9:15 AM, Bruno Borges wrote: I think you must set your page as error page. Make that change and try again. *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com wrote: A created my own PageExpiredErrorPage. There is a button that is supposed to take the user to the login page so they can log in (similar to the button on the default page-expired error page). / / When the user first opens the web site, they see a log in page with URL /http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.SignInPage?1/ http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/ . http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.** SignInPage?1 http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1 *Default PageExpiredErrorPage behavior* After there is a page timeout and the /default /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / http://mydomain.com/rems/**wicket// http://mydomain.com/rems/wicket// . When the user selects that button they go to the login page with address / http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.SignInPage?0 http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 /*and it goes to the home page as expected/desired when the user logs in.*/ /*My custom page-expired error page behavior*/ /After there is a page timeout and the /custom /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / //http://mydomain.com/rems/**wicket// http://mydomain.com/rems/wicket// When the user selects that button they go to the login page with address /http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.REMSPageExpiredPage#..**/
Re: Login page hangs after custom page-expired error page
Sorry for the problems with flow. I have a very poor model for how it all works and I'm not sure what's important and what isn't, so it probably appears to everyone else just as muddled as it is for me. Please continue to ask clarifying questions. My replies below. On 8/28/2011 11:17 AM, Martin Grigorov wrote: Again the page flow is not very clear, but I'll try. On Sun, Aug 28, 2011 at 5:55 PM, Scott Reedsr...@avacoda.com wrote: My apologies. I am reposting this without the distracting formatting. I created my own PageExpiredErrorPage with a button that says Return to home page and goes to the home page. Since we're using authorization the user first goes to the login page so they can log in before going to the home page. (That is how the button on the default page-expired error page works.) When the user first opens the web site, whether with the default or the custom page-expired page, they see a log in page with URL http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1. Here is how the default PageExpiredErrorPage works: After there is a page timeout and the default page-expired error page opens, the Return to home page button on the default page expired error page reports URL http://mydomain.com/rems/wicket/. When the user selects that button they go to the login page with address http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 and it goes to the home page as expected/desired when the user logs in. Here is how my custom page-expired error page works: After there is a page timeout and the custom page-expired error page opens, the Return to home page button on the default page expired error page reports URL http://mydomain.com/rems/wicket/ When the user selects that button they go to the login page with address http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. I expect here the Url to be /wicket/bookmarkable/com.mni.SignInPage Yes, why isn't it the same as the default? and it hangs when the user logs in. What do you mean by it hangs after log in ? Sorry. By hang I mean that the home page displays but none of the links work. And why the url ends with #../..? I'd like to know this also. My custom page-expired error page HTML body h3Page Expired/h3 pThe page you requested has expired./p pa wicket:id=homeLinkReturn to home page/a/p /body Java: public class MyPageExpiredPage extends WebPage { public MyPageExpiredPage() { super(); // link for home page btn // WebPage#homePageLink returns a BookmarkablePageLink add( homePageLink(homeLink)); } } Custom PageExpiredErrorPage is just application.getApplicationSettings.setPageExpiredErrorPage(MyPage.class), nothing more. Since you have authentication enabled you have to make that page reachable without authentication, just like SignInPage is reachable Page expiration is not always the same as Session expiration. I see that PageExpiredException javadoc is outdated in 1.5 and it doesn't explain what is all about. I'll update it soon. On 8/28/2011 6:58 AM, Martin Grigorov wrote: I can't really understand the question/problem The formatting is distracting and I miss the point :-/ On Fri, Aug 26, 2011 at 11:40 PM, Bruno Borgesbruno.bor...@gmail.com wrote: But still, why isn't Scott's case working? *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Fri, Aug 26, 2011 at 5:12 PM, Martin Grigorovmgrigo...@apache.orgwrote: for 1.6 - yes, I think. unless we find it useful for something On Fri, Aug 26, 2011 at 6:54 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: can we remove it then? -igor On Fri, Aug 26, 2011 at 8:19 AM, Martin Grigorovmgrigo...@apache.org wrote: actually #isErrorPage() is not used in current 1.5, so WIA is correct On Fri, Aug 26, 2011 at 6:15 PM, Scott Reedsr...@avacoda.comwrote: Thanks, Bruno. I added isErrorPage() just in case. The docs just say This can help the framework prevent infinite failure loops. That's also not mentioned in Wicket in Action which says creating an error page is no different than creating a normal page. Scott On 8/26/2011 9:15 AM, Bruno Borges wrote: I think you must set your page as error page. Make that change and try again. *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com wrote: A created my own PageExpiredErrorPage. There is a button that is supposed to take the user to the login page so they can log in (similar to the button on the default page-expired error page). / / When the user first opens the web site, they see a log in page with URL /http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.SignInPage?1/ http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/ . http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.** SignInPage?1
Cannot go to homepage from custom page expired error page
My apologies. I am reposting this without the distracting pseudo-formatting. I created my own PageExpiredErrorPage. There is a button that is supposed to take the user to the login page so they can log in (just like the button on the default page-expired error page). / / When the user first opens the web site, they see a log in page with URL /http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/. http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1. Default PageExpiredErrorPage behavior After there is a page timeout and the /default /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / http://mydomain.com/rems/wicket//. When the user selects that button they go to the login page with address / http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 /and it goes to the home page as expected/desired when the user logs in./ /My custom page-expired error page behavior/ /After there is a page timeout and the /custom /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / //http://mydomain.com/rems/wicket// When the user selects that button they go to the login page with address /http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. /and it hangs when the user logs in/./ custom page-expired error page HTML body h3Page Expired/h3 pThe page you requested has expired./p pa wicket:id=homeLinkReturn to home page/a/p /body Java: public class MyPageExpiredPage extends WebPage { public MyPageExpiredPage() { super(); // link for home page btn // WebPage#homePageLink returns a BookmarkablePageLink add( homePageLink(homeLink)); } }
Re: Login page hangs after custom page-expired error page
Thanks, Bruno. I added isErrorPage() just in case. The docs just say This can help the framework prevent infinite failure loops. That's also not mentioned in Wicket in Action which says creating an error page is no different than creating a normal page. Scott On 8/26/2011 9:15 AM, Bruno Borges wrote: I think you must set your page as error page. Make that change and try again. *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com wrote: A created my own PageExpiredErrorPage. There is a button that is supposed to take the user to the login page so they can log in (similar to the button on the default page-expired error page). / / When the user first opens the web site, they see a log in page with URL /http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/. http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.** SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1 *Default PageExpiredErrorPage behavior* After there is a page timeout and the /default /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket// . When the user selects that button they go to the login page with address / http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 /*and it goes to the home page as expected/desired when the user logs in.*/ /*My custom page-expired error page behavior*/ /After there is a page timeout and the /custom /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / //http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket// When the user selects that button they go to the login page with address /http://mydomain.com/rems/**wicket/wicket/bookmarkable/** com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. /*and it hangs when the user logs in*/./ *custom page-expired error page HTML * body pThe page you requested has expired./p pa wicket:id=homeLinkReturn to home page/a/p /body * Java: * public class MyPageExpiredPage extends WebPage { public MyPageExpiredPage() { super(); // link for home page btn // WebPage#homePageLink returns a BookmarkablePageLink add( homePageLink(homeLink)); } } I would very much appreciate any assistance with this. Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Possible fix for linking to home page from page-expired page?
I found that replacing add(linkHomePage( homeLink )) with my code below works. Can anyone explain? Thanks, Scorr void addHomeBtn( String id, MarkupContainer parent, final WebPage page ) { final AbstractDefaultAjaxBehavior homeBehavior = new AbstractDefaultAjaxBehavior() { private static final long serialVersionUID = 1L; public void respond( AjaxRequestTarget target ) { // go home page.setResponsePage( page.getApplication().getHomePage() ); } }; parent.add( homeBehavior ); // home button final WebMarkupContainer homeBtn = new WebMarkupContainer( id ) { private static final long serialVersionUID = 1L; @Override public void onComponentTag(ComponentTag tag) { tag.put(onclick, wicketAjaxGet('+homeBehavior.getCallbackUrl()+')); } }; parent.add( homeBtn ); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Login page hangs after custom page-expired error page
A created my own PageExpiredErrorPage. There is a button that is supposed to take the user to the login page so they can log in (similar to the button on the default page-expired error page). / / When the user first opens the web site, they see a log in page with URL /http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/. http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1 *Default PageExpiredErrorPage behavior* After there is a page timeout and the /default /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / http://mydomain.com/rems/wicket//. When the user selects that button they go to the login page with address / http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0 /*and it goes to the home page as expected/desired when the user logs in.*/ /*My custom page-expired error page behavior*/ /After there is a page timeout and the /custom /page-expired error page opens, the Return to home page button on the default page expired error page reports URL / //http://mydomain.com/rems/wicket// When the user selects that button they go to the login page with address / http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. /*and it hangs when the user logs in*/./ *custom page-expired error page HTML * body pThe page you requested has expired./p pa wicket:id=homeLinkReturn to home page/a/p /body * Java: * public class MyPageExpiredPage extends WebPage { public MyPageExpiredPage() { super(); // link for home page btn // WebPage#homePageLink returns a BookmarkablePageLink add( homePageLink(homeLink)); } } I would very much appreciate any assistance with this. Scott
Re: Controlling head element order with renderHead(IHeaderResponse)
That works quite well, Martin. I can add my on-the-fly contributions at the top of the head. I would like to know how to pin-point the location better so my additions come after the hard-coded HTML meta content-type and title elements. Is there some documentation that might explain more about the whole process of rendering the head? Thanks, Scott On 7/18/2011 3:42 AM, Martin Grigorov wrote: With org.apache.wicket.Application.setHeaderResponseDecorator(IHeaderResponseDecorator) you can setup custom org.apache.wicket.markup.html.IHeaderResponseDecorator. Wicket will call its org.apache.wicket.markup.html.IHeaderResponseDecorator.decorate(IHeaderResponse) when creating IHeaderResponse for each web response. Here you can re-order the header contributions as you wish. See for example org.apache.wicket.resource.filtering.HeaderResponseContainerFilteringHeaderResponse and its specializations. On Fri, Jul 15, 2011 at 10:25 PM, Scott Reedsr...@avacoda.com wrote: Looking at that code some more I realize I have no idea what it's doing and I'm finding the javadocs and comments pretty opaque. Is there anything you can refer me to that will give me the background to understand this? I have both Wicket in Action and the Cookbook. On 7/15/2011 2:07 PM, Martin Grigorov wrote: You'll need to setup custom response decorator. See http://www.wicket-library.com/wicket-examples/resourceaggregation On Fri, Jul 15, 2011 at 9:01 PM, Scott Reedsr...@avacoda.comwrote: I am adding script and css references on the fly using renderHead(IHeaderResponse). However this adds the head elements after the Wicket scripts and that interferes with how my scripts and css work. When I hardcode my elements before the Wicket elements everything works as we need. How can I add my head elements on the fly so they are located before the Wicket elements? Thanks, Scott - 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: Controlling head element order with renderHead(IHeaderResponse)
By hardcoded I mean my HTML file starts with the following head: head !-- hardcoded HTML lines -- meta http-equiv=Content-type content=text/html;charset=UTF-8 / titleSign In/title /head After I load the page with Ajax it has: head !-- lines I'm adding with decorator -- link rel=stylesheet type=text/css href=../../../stylesheets/jquery.mobile-1.0b1/jquery.mobile-1.0b1.css / script type=text/javascript src=../../../stylesheets/jquery-1.6.1/jquery-1.6.1.js/script script type=text/javascript src=../../../stylesheets/jquery.mobile-1.0b1/jquery.mobile-1.0b1.js/script !-- hardcoded HTML lines -- meta http-equiv=Content-type content=text/html;charset=UTF-8 / titleSign In/title script type=text/javascript src=../resource/org.apache.wicket.markup.html.WicketEventReference/wicket-event-ts130624791.js/script script type=text/javascript src=../resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ts130624791.js/script script type=text/javascript src=../resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug-ts130624791.js/script script type=text/javascript id=wicket-ajax-debug-enable /*![CDATA[*/ wicketAjaxDebugEnable=true; /*]]*/ /script script type=text/javascript id=wicket-ajax-base-url /*![CDATA[*/ Wicket.Ajax.baseUrl=wicket/bookmarkable/com.mni.SignInPage?0; /*]]*/ /script /head I'd rather have !-- hardcoded HTML lines -- meta http-equiv=Content-type content=text/html;charset=UTF-8 / titleSign In/title be the first thing after head followed by the lines I'm adding with decorator. On 7/18/2011 2:10 PM, Martin Grigorov wrote: What exactly is hardcoded ? I'm not aware of such documentation but it sounds like a good todo for me. On Mon, Jul 18, 2011 at 7:35 PM, Scott Reedsr...@avacoda.com wrote: That works quite well, Martin. I can add my on-the-fly contributions at the top of the head. I would like to know how to pin-point the location better so my additions come after the hard-coded HTML meta content-type and title elements. Is there some documentation that might explain more about the whole process of rendering the head? Thanks, Scott
Controlling head element order with renderHead(IHeaderResponse)
I am adding script and css references on the fly using renderHead(IHeaderResponse). However this adds the head elements after the Wicket scripts and that interferes with how my scripts and css work. When I hardcode my elements before the Wicket elements everything works as we need. How can I add my head elements on the fly so they are located before the Wicket elements? Thanks, Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Controlling head element order with renderHead(IHeaderResponse)
Thanks, Martin. That example is about the Wicket header. Will that also work somehow for the HTML head? If so, how? Scott On 7/15/2011 2:07 PM, Martin Grigorov wrote: You'll need to setup custom response decorator. See http://www.wicket-library.com/wicket-examples/resourceaggregation On Fri, Jul 15, 2011 at 9:01 PM, Scott Reedsr...@avacoda.com wrote: I am adding script and css references on the fly using renderHead(IHeaderResponse). However this adds the head elements after the Wicket scripts and that interferes with how my scripts and css work. When I hardcode my elements before the Wicket elements everything works as we need. How can I add my head elements on the fly so they are located before the Wicket elements? Thanks, Scott - 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: Controlling head element order with renderHead(IHeaderResponse)
Looking at that code some more I realize I have no idea what it's doing and I'm finding the javadocs and comments pretty opaque. Is there anything you can refer me to that will give me the background to understand this? I have both Wicket in Action and the Cookbook. On 7/15/2011 2:07 PM, Martin Grigorov wrote: You'll need to setup custom response decorator. See http://www.wicket-library.com/wicket-examples/resourceaggregation On Fri, Jul 15, 2011 at 9:01 PM, Scott Reedsr...@avacoda.com wrote: I am adding script and css references on the fly using renderHead(IHeaderResponse). However this adds the head elements after the Wicket scripts and that interferes with how my scripts and css work. When I hardcode my elements before the Wicket elements everything works as we need. How can I add my head elements on the fly so they are located before the Wicket elements? Thanks, Scott - 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: Unwanted authentication persistence
I figured out that the sign-in panel was storing the authentication data in a cookie from when we had first tried it before we turned off the remember-me option and now it's getting it back from there even though we have turned off that option. Was a simple tweak to fix it. On 6/28/2011 3:15 PM, sreed wrote: We are using Jetty which has no session persistence by default. Is it possible that Wicket is persisting sessions somehow? What else might be causing this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Unwanted-authentication-persistence-tp3631027p3631188.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: Dynamic AJAX text in WebMarkupContainer
Thank you, Benoît. I am not familiar enough with the inner workings of Wicket to know how to rewrite the tag changes. I looked at the source code and can see that it's not that simple. Can you (or anyone else here) point me to some examples or explanatory documentation that might help me. I'm also not clear why I need to create a Form based on text (Label?) when all I want is a version of Label that does not override the jQM styling. Scott On 6/11/2011 3:29 PM, Benoît de Biolley wrote: Hi Scott, you can write your own FormComponent based on the textComponent, just rewrite the methods that changes the tags. I did it with a panel, so I tooks the code from wicket panel. Benoît de Biolley Date: Sat, 11 Jun 2011 00:03:36 -0400 From: sr...@avacoda.com To: users@wicket.apache.org Subject: Dynamic AJAX text in WebMarkupContainer I am using Wicket with jQuery Mobile. I cannot use Wicket Label because it interferes with (eliminates) the jQM styling. I am using WebMarkupContainer for most components but I need to have dynamic AJAX text and would appreciate help on how to do it with WebMarkupContainer or any other ideas on how to resolve this issue. Thanks, Scott - 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
Dynamic AJAX text in WebMarkupContainer
I am using Wicket with jQuery Mobile. I cannot use Wicket Label because it interferes with (eliminates) the jQM styling. I am using WebMarkupContainer for most components but I need to have dynamic AJAX text and would appreciate help on how to do it with WebMarkupContainer or any other ideas on how to resolve this issue. Thanks, Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Original page cloned after popup dialog closes
Hi, Let's work with the example I sent you last night since it's complete and there's nothing to explain. Thanks, Scott On 5/28/2011 3:49 AM, andrea del bene wrote: Hi, sorry but I don't understand where is the model you are trying to modify. Are you sharing a model instance between modal window and RadioListFilterDialog? What does refreshRadioListAreaResponse method do? Andre, Line 41 opens the dialog. The object ID of the page is the same there, on line 6 where the dialog is constructed as well as in the dialog once it opens. When the dialog closes and we get to line 11, the ID has changed and the component model does not have the changes that were made in the dialog. The request target at line 11 has the new page object ID as well. Thanks for looking at this, Scott - 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: Original page cloned after popup dialog closes
Wicket creates a new version of the page after a popup Modal Window closes. This means any changes made to the original page from the popup are lost once the popup is closed. I suppose I could store the data for the change in the session and change the new page version after the popup closes but that is inelegant. Is there a way to prevent the extra version from being created (and why is it being created anyway?) or is there some more elegant approach I could try? Thanks, Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Original page cloned after popup dialog closes
Yes. I pass the original page and the model is accessed by a getter. When the modal window closes and the onClose() callback is called, the page and the model have been replaced by clones. On 5/28/2011 2:03 PM, andrea del bene wrote: Store data and sharing them across pages/components should be Wicket model's purpose. In your code you create a RadioListFilterDialog as modal window content. Do you pass it the original model of RadioListPage? Wicket creates a new version of the page after a popup Modal Window closes. This means any changes made to the original page from the popup are lost once the popup is closed. I suppose I could store the data for the change in the session and change the new page version after the popup closes but that is inelegant. Is there a way to prevent the extra version from being created (and why is it being created anyway?) or is there some more elegant approach I could try? Thanks, Scott - 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: Original page cloned after popup dialog closes
Andre, Line 41 opens the dialog. The object ID of the page is the same there, on line 6 where the dialog is constructed as well as in the dialog once it opens. When the dialog closes and we get to line 11, the ID has changed and the component model does not have the changes that were made in the dialog. The request target at line 11 has the new page object ID as well. Thanks for looking at this, Scott 1. private void addFilterBtn( final WebMarkupContainer radioListArea ) { 2. final ModalWindow modalFilterDialog = new ModalWindow( filterDialog ); 3. add( modalFilterDialog ); 4. modalFilterDialog.setPageCreator(new ModalWindow.PageCreator(){ 5. public Page createPage(){ 6. _*return new RadioListFilterDialog( RadioListPage.this.getPageReference(), modalFilterDialog);*_ 7. } 8. }); 9. modalFilterDialog.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){ 10. public void onClose(AjaxRequestTarget target){ 11. *_refreshRadioListAreaResponse( target );_* 12. **} 13. }); 14. modalFilterDialog.setCloseButtonCallback(new ModalWindow.CloseButtonCallback(){ 15. public boolean onCloseButtonClicked(AjaxRequestTarget target) 16. { 17.refreshRadioListAreaResponse( target ); 18.return true; 19. } 20. }); 21. 22. // filter button in header 23. final WebMarkupContainer filterBtn = new WebMarkupContainer( filterbtn ){ 24.private static final long serialVersionUID = 1L; 25.@Override 26.public void onComponentTag(ComponentTag tag) { 27. // add onclick attribute to the button with this AJAX call to Wicket 28. // passing the URL of the click event behavior 29. tag.put(onclick, wicketAjaxGet('+filterDialogBehavior.getCallbackUrl()+')); 30.} 31. }; 32. // expose AJAX assigned ID for filter button component 33. // so we can update it in back behavior below 34. filterBtn.setOutputMarkupId( true ); 35. add( filterBtn ); 36. 37. filterDialogBehavior = new AbstractDefaultAjaxBehavior(){ 38.private static final long serialVersionUID = 1L; 39.public void respond( AjaxRequestTarget target ) { 40. // open filter dialog 41. *_modalFilterDialog.show(target);_* 42.} 43. }; 44. add( filterDialogBehavior ); 45.} On 5/27/2011 4:17 AM, Andrea Del Bene wrote: Hi Scott, attach onClose() callback code, the problem should be there. Out app has a WebPage that opens a ModalWindow dialog passing in the page. The dialog allows the user to modify the model of one of the page's components. When the dialog closes and the onClose() callback in the page is called, the object ID of the page has changed and the component model does not have the changes from the dialog. This is very likely a common Wicket newbie error but I can't find anything about it anywhere. Please help. Let me know if I need to build a simple example to demonstrate this. 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
Original page cloned after popup dialog closes
Out app has a WebPage that opens a ModalWindow dialog passing in the page. The dialog allows the user to modify the model of one of the page's components. When the dialog closes and the onClose() callback in the page is called, the object ID of the page has changed and the component model does not have the changes from the dialog. This is very likely a common Wicket newbie error but I can't find anything about it anywhere. Please help. Let me know if I need to build a simple example to demonstrate this. Thanks, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom event: fire and handle
I was not able to get the custom onpagebeforeshow event handling to work. I have fallen back to using the standard onclick event handling. I see the update code being executed in the ajax event handler but the changes do not show up on the subpage. Below is the core of my most recent approach. The RefreshingView is the element I am trying to update on the subpage. detailSubpage is a WebMarkupContainer for the subpage that contains the RefreshingView table. If it would help I can supply all the code (total 200 lines). !-- Detail page used when subpage item is selected from the subpages list -- div data-role='page' wicket:id=detailSubpage id=detailSubpage div data-role='content' wicket:id=detailContent style='height: 100%' table wicket:id=detailTable id=detailTable tr tdName/td tdnbsp;/td td wicket:id=name style='font-weight: bold;'.../td /tr tr tdStatus/td tdnbsp;/td td wicket:id=status style='font-weight: bold;'.../td /tr /table /div /div private class FooList extends RefreshingViewFoo { FooDetailContainer detailSubpage; public FooList( String id, FooListModel model, FooDetailContainer detailSubpage ) { super( id, model ); this.detailSubpage = detailSubpage; } @Override protected void populateItem( ItemFoo item ) { final Foo foo = item.getModelObject(); addFooItem( item, foo ); } private void addFooItem( ItemFoo item, final Foo foo ) { Label fooNameLabel = new Label( subpageName, foo.getName()); item.add( fooNameLabel ); item.add( new FooClickBehavior( onclick, foo )); } /** * records most recently selected foo */ private class FooClickBehavior extends AjaxEventBehavior { Foo foo; public FooClickBehavior( String event, Foo foo ) { super( event ); this.foo = foo; } public void onEvent( AjaxRequestTarget target ) { //populate foo detail page detailSubpage.getNameLabel().setDefaultModelObject( foo.getName() ); detailSubpage.getStatusLabel().setDefaultModelObject( foo.getStatus() ); detailSubpage.getStatusLabel().add( new AttributeModifier( style, true, new Model( font-weight:bold; ))); // commented due to error: // Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: cannot call methods on listview prior to initialization; attempted to call method 'refresh' //// refresh detail page table //String js = $('#detailTable').listview('refresh'); //target.appendJavascript( js ); } } @Override protected IteratorIModelFoo getItemModels() { return new FooListModel().load().iterator(); } } On 5/4/2011 7:20 PM, Igor Vaynberg wrote: something like this may help you. AbstractDefaultAjaxBehavior b=new AbstractDefaultAjaxBehavior() { respond(target) { // handle ajax callback } }; div.add(b); String script=b.getCallbackScript(); what you have in the script variable is a javascript fragment which will invoke the server-side callback. you can now write that out into the head yourself using IHeaderContributor and wire it into jquery's callback. -igor On Wed, May 4, 2011 at 3:56 PM, Scott Reedsr...@avacoda.com wrote: I tried doing this using the onclick event of the list item but there were a couple of problems. The biggest problem is that there may be hundreds of items in the list and inserting an ajax call in each item increases the page size too much for a mobile app. Another problem is that the id of the detail page component is modified by Wicket when I add ajax behaviors to it so the href in the item link is incorrect. I figured out how to handle this by changing the href using getMarkupId() but that kind of maintenance nightmare hacking turned me off to the whole approach. Finally I couldn't figure out how to get it to go to the detail page after I updated it - it just went back to the home page. I tried adding an AjaxEventBehavior to the target div but the server-side event handler is never called. I don't understand how a custom event can be caught by the ajax engine unless there is js to tell it to do so and I don't see that Wicket has added any js in the page source to do that. If I knew how to tell the ajax engine to look for the custom javascript event then that approach would probably work. On 5/4/2011 6:35 PM, Igor Vaynberg wrote: can you not do it the other way around? have the link that goes to detail be a wicket ajax link which then repaints the content div and tells jquery that it did so? otherwise what you can do is add an ajaxeventbehavior for that even to the content div or whatever div receives it, or wire it in directly to window, and repaint the content div inside the behavior's handler. -igor On Wed, May 4, 2011 at 3:27 PM, Scott Reedsr...@avacoda.comwrote: I want to update the models for the component's children and refresh it. This app has a list on the home page.
Re: Custom event: fire and handle
I attached a quickstart here but I'm not sure attachments work on this list. Let me know how to send the file if that fails. Scott On 5/6/2011 12:17 PM, Igor Vaynberg wrote: having a working quickstart project would help. -igor On Fri, May 6, 2011 at 9:13 AM, Scott Reedsr...@avacoda.com wrote: I was not able to get the custom onpagebeforeshow event handling to work. I have fallen back to using the standard onclick event handling. I see the update code being executed in the ajax event handler but the changes do not show up on the subpage. Below is the core of my most recent approach. The RefreshingView is the element I am trying to update on the subpage. detailSubpage is a WebMarkupContainer for the subpage that contains the RefreshingView table. If it would help I can supply all the code (total 200 lines). !-- Detail page used when subpage item is selected from the subpages list -- div data-role='page' wicket:id=detailSubpage id=detailSubpage div data-role='content' wicket:id=detailContent style='height: 100%' table wicket:id=detailTable id=detailTable tr tdName/td tdnbsp;/td td wicket:id=name style='font-weight: bold;'.../td /tr tr tdStatus/td tdnbsp;/td td wicket:id=status style='font-weight: bold;'.../td /tr /table /div /div private class FooList extends RefreshingViewFoo { FooDetailContainer detailSubpage; public FooList( String id, FooListModel model, FooDetailContainer detailSubpage ) { super( id, model ); this.detailSubpage = detailSubpage; } @Override protected void populateItem( ItemFoo item ) { final Foo foo = item.getModelObject(); addFooItem( item, foo ); } private void addFooItem( ItemFoo item, final Foo foo ) { Label fooNameLabel = new Label( subpageName, foo.getName()); item.add( fooNameLabel ); item.add( new FooClickBehavior( onclick, foo )); } /** * records most recently selected foo */ private class FooClickBehavior extends AjaxEventBehavior { Foo foo; public FooClickBehavior( String event, Foo foo ) { super( event ); this.foo = foo; } public void onEvent( AjaxRequestTarget target ) { //populate foo detail page detailSubpage.getNameLabel().setDefaultModelObject( foo.getName() ); detailSubpage.getStatusLabel().setDefaultModelObject( foo.getStatus() ); detailSubpage.getStatusLabel().add( new AttributeModifier( style, true, new Model( font-weight:bold; ))); // commented due to error: // Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: cannot call methods on listview prior to initialization; attempted to call method 'refresh' //// refresh detail page table //String js = $('#detailTable').listview('refresh'); //target.appendJavascript( js ); } } @Override protected IteratorIModelFoo getItemModels() { return new FooListModel().load().iterator(); } } On 5/4/2011 7:20 PM, Igor Vaynberg wrote: something like this may help you. AbstractDefaultAjaxBehavior b=new AbstractDefaultAjaxBehavior() { respond(target) { // handle ajax callback } }; div.add(b); String script=b.getCallbackScript(); what you have in the script variable is a javascript fragment which will invoke the server-side callback. you can now write that out into the head yourself using IHeaderContributor and wire it into jquery's callback. -igor On Wed, May 4, 2011 at 3:56 PM, Scott Reedsr...@avacoda.comwrote: I tried doing this using the onclick event of the list item but there were a couple of problems. The biggest problem is that there may be hundreds of items in the list and inserting an ajax call in each item increases the page size too much for a mobile app. Another problem is that the id of the detail page component is modified by Wicket when I add ajax behaviors to it so the href in the item link is incorrect. I figured out how to handle this by changing the href using getMarkupId() but that kind of maintenance nightmare hacking turned me off to the whole approach. Finally I couldn't figure out how to get it to go to the detail page after I updated it - it just went back to the home page. I tried adding an AjaxEventBehavior to the target div but the server-side event handler is never called. I don't understand how a custom event can be caught by the ajax engine unless there is js to tell it to do so and I don't see that Wicket has added any js in the page source to do that. If I knew how to tell the ajax engine to look for the custom javascript event then that approach would probably work. On 5/4/2011 6:35 PM, Igor Vaynberg wrote: can you not do it the other way around? have the link that goes to detail be a wicket ajax link which then repaints the content div and tells jquery that it did so? otherwise what you can do is add an ajaxeventbehavior for that even to the content div or whatever div receives it,
Re: Custom event: fire and handle
Thanks! See https://issues.apache.org/jira/browse/WICKET-3677 On 5/6/2011 1:13 PM, Igor Vaynberg wrote: attach it to a jira ticket. -igor On Fri, May 6, 2011 at 10:02 AM, Scott Reedsr...@avacoda.com wrote: I attached a quickstart here but I'm not sure attachments work on this list. Let me know how to send the file if that fails. Scott On 5/6/2011 12:17 PM, Igor Vaynberg wrote: having a working quickstart project would help. -igor On Fri, May 6, 2011 at 9:13 AM, Scott Reedsr...@avacoda.comwrote: I was not able to get the custom onpagebeforeshow event handling to work. I have fallen back to using the standard onclick event handling. I see the update code being executed in the ajax event handler but the changes do not show up on the subpage. Below is the core of my most recent approach. The RefreshingView is the element I am trying to update on the subpage. detailSubpage is a WebMarkupContainer for the subpage that contains the RefreshingView table. If it would help I can supply all the code (total 200 lines). !-- Detail page used when subpage item is selected from the subpages list -- div data-role='page' wicket:id=detailSubpage id=detailSubpage div data-role='content' wicket:id=detailContent style='height: 100%' table wicket:id=detailTable id=detailTable tr tdName/td tdnbsp;/td td wicket:id=name style='font-weight: bold;'.../td /tr tr tdStatus/td tdnbsp;/td td wicket:id=status style='font-weight: bold;'.../td /tr /table /div /div private class FooList extends RefreshingViewFoo { FooDetailContainer detailSubpage; public FooList( String id, FooListModel model, FooDetailContainer detailSubpage ) { super( id, model ); this.detailSubpage = detailSubpage; } @Override protected void populateItem( ItemFooitem ) { final Foo foo = item.getModelObject(); addFooItem( item, foo ); } private void addFooItem( ItemFooitem, final Foo foo ) { Label fooNameLabel = new Label( subpageName, foo.getName()); item.add( fooNameLabel ); item.add( new FooClickBehavior( onclick, foo )); } /** * records most recently selected foo */ private class FooClickBehavior extends AjaxEventBehavior { Foo foo; public FooClickBehavior( String event, Foo foo ) { super( event ); this.foo = foo; } public void onEvent( AjaxRequestTarget target ) { //populate foo detail page detailSubpage.getNameLabel().setDefaultModelObject( foo.getName() ); detailSubpage.getStatusLabel().setDefaultModelObject( foo.getStatus() ); detailSubpage.getStatusLabel().add( new AttributeModifier( style, true, new Model( font-weight:bold; ))); // commented due to error: // Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: cannot call methods on listview prior to initialization; attempted to call method 'refresh' //// refresh detail page table //String js = $('#detailTable').listview('refresh'); //target.appendJavascript( js ); } } @Override protected IteratorIModelFoogetItemModels() { return new FooListModel().load().iterator(); } } On 5/4/2011 7:20 PM, Igor Vaynberg wrote: something like this may help you. AbstractDefaultAjaxBehavior b=new AbstractDefaultAjaxBehavior() { respond(target) { // handle ajax callback } }; div.add(b); String script=b.getCallbackScript(); what you have in the script variable is a javascript fragment which will invoke the server-side callback. you can now write that out into the head yourself using IHeaderContributor and wire it into jquery's callback. -igor On Wed, May 4, 2011 at 3:56 PM, Scott Reedsr...@avacoda.com wrote: I tried doing this using the onclick event of the list item but there were a couple of problems. The biggest problem is that there may be hundreds of items in the list and inserting an ajax call in each item increases the page size too much for a mobile app. Another problem is that the id of the detail page component is modified by Wicket when I add ajax behaviors to it so the href in the item link is incorrect. I figured out how to handle this by changing the href using getMarkupId() but that kind of maintenance nightmare hacking turned me off to the whole approach. Finally I couldn't figure out how to get it to go to the detail page after I updated it - it just went back to the home page. I tried adding an AjaxEventBehavior to the target div but the server-side event handler is never called. I don't understand how a custom event can be caught by the ajax engine unless there is js to tell it to do so and I don't see that Wicket has added any js in the page source to do that. If I knew how to tell the ajax engine to look for the custom javascript event then that approach would probably work. On 5/4/2011 6:35 PM, Igor Vaynberg wrote: can you not do it the other way around? have the link that
Custom event: fire and handle
Certain jQuery Mobile components can trigger a custom javascript event, pagebeforeshow, which I want to handle on the server. I am new to this list and to Wicket and have not been able to find any documentation or examples that show how this could be done.|I would appreciate any help in figuring this out. Thanks, Scott |
Re: Custom event: fire and handle
I want to update the models for the component's children and refresh it. This app has a list on the home page. Selecting one of the list items causes a transition to the detail page. During that transition the pagebeforeshow event fires and then the page is displayed. When the pagebeforeshow event fires, I want to update the page content elements with details of the selected item. (As you may know, in jQuery Mobile these pages are divs with data-roll=page.) On 5/4/2011 6:13 PM, Igor Vaynberg wrote: can you explain a bit more of what you want to happen when this javascript event is fired? -igor On Wed, May 4, 2011 at 3:05 PM, Scott Reedsr...@avacoda.com wrote: Certain jQuery Mobile components can trigger a custom javascript event, pagebeforeshow, which I want to handle on the server. I am new to this list and to Wicket and have not been able to find any documentation or examples that show how this could be done.|I would appreciate any help in figuring this out. Thanks, Scott | - 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: Custom event: fire and handle
I tried doing this using the onclick event of the list item but there were a couple of problems. The biggest problem is that there may be hundreds of items in the list and inserting an ajax call in each item increases the page size too much for a mobile app. Another problem is that the id of the detail page component is modified by Wicket when I add ajax behaviors to it so the href in the item link is incorrect. I figured out how to handle this by changing the href using getMarkupId() but that kind of maintenance nightmare hacking turned me off to the whole approach. Finally I couldn't figure out how to get it to go to the detail page after I updated it - it just went back to the home page. I tried adding an AjaxEventBehavior to the target div but the server-side event handler is never called. I don't understand how a custom event can be caught by the ajax engine unless there is js to tell it to do so and I don't see that Wicket has added any js in the page source to do that. If I knew how to tell the ajax engine to look for the custom javascript event then that approach would probably work. On 5/4/2011 6:35 PM, Igor Vaynberg wrote: can you not do it the other way around? have the link that goes to detail be a wicket ajax link which then repaints the content div and tells jquery that it did so? otherwise what you can do is add an ajaxeventbehavior for that even to the content div or whatever div receives it, or wire it in directly to window, and repaint the content div inside the behavior's handler. -igor On Wed, May 4, 2011 at 3:27 PM, Scott Reedsr...@avacoda.com wrote: I want to update the models for the component's children and refresh it. This app has a list on the home page. Selecting one of the list items causes a transition to the detail page. During that transition the pagebeforeshow event fires and then the page is displayed. When the pagebeforeshow event fires, I want to update the page content elements with details of the selected item. (As you may know, in jQuery Mobile these pages are divs with data-roll=page.) On 5/4/2011 6:13 PM, Igor Vaynberg wrote: can you explain a bit more of what you want to happen when this javascript event is fired? -igor On Wed, May 4, 2011 at 3:05 PM, Scott Reedsr...@avacoda.comwrote: Certain jQuery Mobile components can trigger a custom javascript event, pagebeforeshow, which I want to handle on the server. I am new to this list and to Wicket and have not been able to find any documentation or examples that show how this could be done.|I would appreciate any help in figuring this out. Thanks, Scott | - 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