RE: TextTemplateResourceReference problem
Per you're instructions I've opened a ticket in JIRA. WICKET-4487 -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, April 04, 2012 11:48 AM To: users@wicket.apache.org Subject: Re: TextTemplateResourceReference problem Hi Tom, Is ArrowModel and the TTRR recreated for for every page ? I guess the answer is YES but I need to ask. Please create a quickstart and attach it to Jira so we can take a look. On Wed, Apr 4, 2012 at 9:18 PM, Burton, Tom F (DOR) wrote: > Hello, > > I have a component(It displays a menu common across the pages of my > application.) > > All the WebPages in my application inherit from BasePage which > includes the menu. > > > > BasePage includes a component MainMenu, which creates a List of > Lists(that contain page links) > > The Lists of lists are then wrapped inside of jQuerySlideMenu. > > > > jQuerySlideMenu has the following method defined > > renderHead(IHeaderResponse response) > > { > > super.renderHead(response); > > response > > .renderCSSReference(new > PackageResourceReference(AppBasePage.class, > > > "includes/css/jqueryslidemenu.css")); > > response > > .renderCSSReference(new > PackageResourceReference(AppBasePage.class, > > > "includes/css/printjqueryslidemenu.css"), "print"); > > > > Map arrows = new HashMap(2); > > > > /* > > * TODO: look into Meta-inf staticing the resources (faster) > > * uses MetaInfStaticResourceReference > > * requires the files to be mounted under > > * /META-INF/resources in the final jar > > */ > > //TODO: look at finding a way to make sure it gets redone for every > page > > PackageResourceReference down = > > new PackageResourceReference(AppBasePage.class, > > "includes/menu_down.gif"); > > PackageResourceReference right = > > new PackageResourceReference(AppBasePage.class, > > "includes/menu_right.gif"); > > > > arrows.put("menu_down", urlFor(down, null)); > > arrows.put("menu_right", urlFor(right, null)); > > > > /* this works > > String prefix = getRequest().getContextPath() + "/"; > > arrows.put("menu_down", prefix + urlFor(down, null)); > > arrows.put("menu_right", prefix + urlFor(right, null)); > > */ > > > > //arrow model just implements IModel to pass arrows for getObject() > > arrowModel model = new arrowModel(arrows); > > response.renderJavaScriptReference( > > new TextTemplateResourceReference(AppBasePage.class, > > > "includes/javascript/jqueryslidemenu.js", model)); > > } > > > > When I initially login it works great for /home, or other > /mountedPageName pages, but if I follow a link to > /wicket/bookmarkable/full.class.name/?stuffhere the images will not > display. > > > > It works if I prefix contextPath/ infront of the url. But some of my > sites are behind a proxy, and I would like this to work there as well. > > > > Thank you for any help, > > Tom Burton > > > > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com
RE: TextTemplateResourceReference problem
I'm not doing anything special to renderHead so it's getting called whatever the default is. (I thought every page, now I'm not so sure.) arrowModel is just a private class on the Panel that looks like this: private class arrowModel implements IModel> { private Map map; arrowModel(Map map) { this.map = map; } /** * Gets the model object. * * @return The model object */ public Map getObject() { return map; } /** Sets the model object. * @param object The model object */ public void setObject(Map object) { } /** * Detaches model after use. This is generally used to null out transient * references that can be * re-attached later. */ public void detach() { } } I should probably mention I'm using Wicket 1.5.5 Thanks, Tom Burton -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, April 04, 2012 11:48 AM To: users@wicket.apache.org Subject: Re: TextTemplateResourceReference problem Hi Tom, Is ArrowModel and the TTRR recreated for for every page ? I guess the answer is YES but I need to ask. Please create a quickstart and attach it to Jira so we can take a look. On Wed, Apr 4, 2012 at 9:18 PM, Burton, Tom F (DOR) wrote: > Hello, > > I have a component(It displays a menu common across the pages of my > application.) > > All the WebPages in my application inherit from BasePage which > includes the menu. > > > > BasePage includes a component MainMenu, which creates a List of > Lists(that contain page links) > > The Lists of lists are then wrapped inside of jQuerySlideMenu. > > > > jQuerySlideMenu has the following method defined > > renderHead(IHeaderResponse response) > > { > > super.renderHead(response); > > response > > .renderCSSReference(new > PackageResourceReference(AppBasePage.class, > > > "includes/css/jqueryslidemenu.css")); > > response > > .renderCSSReference(new > PackageResourceReference(AppBasePage.class, > > > "includes/css/printjqueryslidemenu.css"), "print"); > > > > Map arrows = new HashMap(2); > > > > /* > > * TODO: look into Meta-inf staticing the resources (faster) > > * uses MetaInfStaticResourceReference > > * requires the files to be mounted under > > * /META-INF/resources in the final jar > > */ > > //TODO: look at finding a way to make sure it gets redone for every > page > > PackageResourceReference down = > > new PackageResourceReference(AppBasePage.class, > > "includes/menu_down.gif"); > > PackageResourceReference right = > > new PackageResourceReference(AppBasePage.class, > > "includes/menu_right.gif"); > > > > arrows.put("menu_down", urlFor(down, null)); > > arrows.put("menu_right", urlFor(right, null)); > > > > /* this works > > String prefix = getRequest().getContextPath() + "/"; > > arrows.put("menu_down", prefix + urlFor(down, null)); > > arrows.put("menu_right", prefix + urlFor(right, null)); > > */ > > > > //arrow model just implements IModel to pass arrows for getObject() > > arrowModel model = new arrowModel(arrows); > > response.renderJavaScriptReference( > > new TextTemplateResourceReference(AppBasePage.class, > > > "includes/javascript/jqueryslidemenu.js", model)); > > } > > > > When I initially login it works great for /home, or other > /mountedPageName pages, but if I follow a link to > /wicket/bookmarkable/full.class.name/?stuffhere the images will not > display. > > > > It works if I prefix contextPath/ infront of the url. But some of my > sites are behind a proxy, and I would like this to work there as well. > > > > Thank you for any help, > > Tom Burton > > > > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com
TextTemplateResourceReference problem
Hello, I have a component(It displays a menu common across the pages of my application.) All the WebPages in my application inherit from BasePage which includes the menu. BasePage includes a component MainMenu, which creates a List of Lists(that contain page links) The Lists of lists are then wrapped inside of jQuerySlideMenu. jQuerySlideMenu has the following method defined renderHead(IHeaderResponse response) { super.renderHead(response); response .renderCSSReference(new PackageResourceReference(AppBasePage.class, "includes/css/jqueryslidemenu.css")); response .renderCSSReference(new PackageResourceReference(AppBasePage.class, "includes/css/printjqueryslidemenu.css"), "print"); Map arrows = new HashMap(2); /* * TODO: look into Meta-inf staticing the resources (faster) * uses MetaInfStaticResourceReference * requires the files to be mounted under * /META-INF/resources in the final jar */ //TODO: look at finding a way to make sure it gets redone for every page PackageResourceReference down = new PackageResourceReference(AppBasePage.class, "includes/menu_down.gif"); PackageResourceReference right = new PackageResourceReference(AppBasePage.class, "includes/menu_right.gif"); arrows.put("menu_down", urlFor(down, null)); arrows.put("menu_right", urlFor(right, null)); /* this works String prefix = getRequest().getContextPath() + "/"; arrows.put("menu_down", prefix + urlFor(down, null)); arrows.put("menu_right", prefix + urlFor(right, null)); */ //arrow model just implements IModel to pass arrows for getObject() arrowModel model = new arrowModel(arrows); response.renderJavaScriptReference( new TextTemplateResourceReference(AppBasePage.class, "includes/javascript/jqueryslidemenu.js", model)); } When I initially login it works great for /home, or other /mountedPageName pages, but if I follow a link to /wicket/bookmarkable/full.class.name/?stuffhere the images will not display. It works if I prefix contextPath/ infront of the url. But some of my sites are behind a proxy, and I would like this to work there as well. Thank you for any help, Tom Burton
wicket 1.2.6 - multi-site reusable components
Hello, I have a pair of wicket 1.2.6 sites, I'm about to build a third. They all share look/feel/auth source. Before making #3 I decided to put AppBasePage and my Auth routines into their own maven projects. The QuickStartSession, QuickStartApplication, and user objects are different though. I'm looking for a good write up on my problem. My current working assumption is that I'll have to re-write the QuickStartSession, QuickStartApplication, and User objects, to include in my new "Application Base" and then subclass each of those classes inside of the sites to add the customized functionality that each site requires. I'm not sure how to handle the UserDAO/UserDLO (Data Access Object / Data List Object) they are all 3 separate objects but seem somewhat linked and seeing as DAO is going to be very site specific I'm not sure how to abstract that. Thank you very much for any help, Tom Burton Confidentiality Notice: This e-mail message including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
RE: wicket 1.2.7 login error checking and reporting
Thank you very much for the help. I'm now using onError() like I should be I've also got the requisite error messages setup in the appropriate .properties file. Thanks again for the assistance, Tom -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Friday, August 07, 2009 11:03 AM To: Burton, Tom F (DOR) Subject: Re: wicket 1.2.7 login error checking and reporting that code is pretty horrible, you should be using wicket's built in validation instead of all that garbage. anyways, it fails because passwordtextfield is required by default. what this means is that if you leave it empty it will cause a form validation error. onsubmit will not be called, instead button's onerror will be called, where you should add the feedbackpanel to the target to see the errors. you can also try passwordfield.setrequired(false) and it might revert to working like other textfields. -igor On Fri, Aug 7, 2009 at 11:47 AM, Burton, Tom F (DOR) wrote: > It works for Login Failures, and blank usernames. It just doesn't > work for blank passwords or blank username and password. > > Why would the error() function work for user==null but not password==null? > My embarrassing log.debug line doesn't even fire, when there is no password. > Which is why I'm not sure whatever code the server runs once I hit submit > doesn't get as far is this code without a password to verify. > > Here is a code snippet: > > form.add(new IndicatingAjaxSubmitButton("login", form) > { > private static final long serialVersionUID = 1L; > public void onSubmit(AjaxRequestTarget target, Form form) > { > //set user as a non myalaska user so it will log out to this > page... > ((QuickStartSession)getSession()).setMyAkUser(false); > User userLoggingIn = null; > > target.addComponent(feedbackpanel); > target.addComponent(form); > > String user_error = "'User Name' is a requied field"; > String passwd_error = "'Password' is a required field"; > > //TODO: Delete this line once blank/empty passwd format > verified > log.debug("Login AS: " + user + " : " + password); > > if ( user == null && ( password == null || > password.trim().equals("") ) ) > { > error( user_error + "\n" + passwd_error ); > } > > else if (user == null) > { > //log.error("'User Name' is a requied field"); > error( user_error ); > //return; > } > > else if (password == null || password.trim().equals("") ) > { > log.error("'Passwd' is a requied field"); > error( passwd_error ); > //return; > } > //else { log.info("username and password entered."); } > //end the if else if block; > > //end processing if username or password errors > if ( user == null || password == null > || password.trim().equals("") ) > { return; } > > > Thanks for the help and patience, > Tom B. > > -Original Message- > From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > Sent: Friday, August 07, 2009 10:23 AM > To: Burton, Tom F (DOR) > Subject: Re: wicket 1.2.7 login error checking and reporting > > right, there is no wicketfilter in 1.2.x, only wicketservlet. > > if you get empty back then maybe you are forgetting to > update the feedback panel using ajaxrequesttarget. > > -igor > > On Fri, Aug 7, 2009 at 11:08 AM, Burton, Tom F > (DOR) wrote: >> I found wicketSessionFilter but not wicketFilter. How would using >> A regular submit button make a difference. I know submit request goes to the >> "server" I just get an empty pair of tags back from the >> server. (Firebug is really usefull, and I'm able to look at the post request >> I send thanks to TamperData). >> >> Thanks Again, >> Tom >> >> -Original Message- >> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] >> Sent: Thursday, August 06, 2009 11:57 AM >> To: users@wicket.apache.org >> Subject: Re: wicket 1.2.7 login error checking and reporting >> >> set a breakpoint in wicketfilter and see what its doing. does it work >> properly when using a regular submit button? >> >> -igor >> >> On Th
RE: wicket 1.2.7 login error checking and reporting
I found wicketSessionFilter but not wicketFilter. How would using A regular submit button make a difference. I know submit request goes to the "server" I just get an empty pair of tags back from the server. (Firebug is really usefull, and I'm able to look at the post request I send thanks to TamperData). Thanks Again, Tom -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Thursday, August 06, 2009 11:57 AM To: users@wicket.apache.org Subject: Re: wicket 1.2.7 login error checking and reporting set a breakpoint in wicketfilter and see what its doing. does it work properly when using a regular submit button? -igor On Thu, Aug 6, 2009 at 12:49 PM, Burton, Tom F (DOR) wrote: > Hello, > > I realize 1.2.7 is no longer "officially" supported. > However, I'm hoping someone will help me anyway. Here goes nothing.. > > > > > I have a login page that is supposed to make sure a username > and password were actually entered before validating against the auth > source. > > If the name and/or password aren't entered it's supposed to spit out an > error message to the user. It works when a password is entered but no > username. > > If I enter a username and no password, or don't enter anything at all, > nothing seems to happen. The spinning indicator next to the > IndicatingAjaxSubmitButton > > goes by so fast I can't see it, if it goes by at all. My error log > statements that tell me where its at in the execution don't seem to > write out either. I've tested this > > in both Firefox and IE. I also tested by entering a password in the form > and then using the Tamper Data extension for Firefox to remove the > password. Still no joy. > > It seems that it's somewhere in the server side code that's terminating > the request early but for the life of me I can't figure out where. > > > > Thanks for any help/assistance in this matter, > > Tom Burton > > > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket 1.2.7 login error checking and reporting
Hello, I realize 1.2.7 is no longer "officially" supported. However, I'm hoping someone will help me anyway. Here goes nothing.. I have a login page that is supposed to make sure a username and password were actually entered before validating against the auth source. If the name and/or password aren't entered it's supposed to spit out an error message to the user. It works when a password is entered but no username. If I enter a username and no password, or don't enter anything at all, nothing seems to happen. The spinning indicator next to the IndicatingAjaxSubmitButton goes by so fast I can't see it, if it goes by at all. My error log statements that tell me where its at in the execution don't seem to write out either. I've tested this in both Firefox and IE. I also tested by entering a password in the form and then using the Tamper Data extension for Firefox to remove the password. Still no joy. It seems that it's somewhere in the server side code that's terminating the request early but for the life of me I can't figure out where. Thanks for any help/assistance in this matter, Tom Burton