Re: Best practice for returning to calling page after submitting a form page
You can pass PageReference to the page with the form and use it in Form#onSubmit(). Page1.java: setResponsePage(new FormPage(getPageReference())); FormPage.java: public FormPage(final PageReference pr) { add(new Form() { onSubmit() { setResponsePage(pr.getPage()); } }); } On Thu, Jan 19, 2012 at 2:39 AM, Chris Colman chr...@stepaheadsoftware.comwrote: ** ** I often use modal forms/dialogs so this issue is not a problem: In a modal scenario when the user submits a modal the page they called the modal form from is just sitting there behind the form when it closes – no need for redirection to the ‘calling page’ as it’s redundant. ** ** In scenarios where some customers prefer not to have modal forms the forms have to be pages in their own right and involve the ‘browser page change’ dance. ** ** Is there a best practice in Wicket for making reusable page forms that remember which page called them and return to that page after submit or cancel? Or is there a Wicket class that manages this? ** ** Example scenario for Reusable Address form ** ** Scenario 1 ** ** Page A shows supplier’s data with a panel displaying their address which includes a ‘Change’ button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page A. ** ** Scenario 2 ** ** Page B shows customer’s data with a panel display their address which includes a ‘Change’ button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page B. ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Doing an action on press of key in a form
i get below error on using AjaxFormComponentUpdatingBehavior WicketMessage: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponentRoot cause:org.apache.wicket.WicketRuntimeException: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponent - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Doing an action on press of key in a form
AjaxFormComponentUpdatingBehavior must be used on a FormComponent (sub)class. Best Regards, Michal Wegrzyn -Original Message- From: Krishna Mohan [mailto:k.krishnamoha...@gmail.com] Sent: Thursday, January 19, 2012 9:32 To: users@wicket.apache.org Subject: Re: Doing an action on press of key in a form i get below error on using AjaxFormComponentUpdatingBehavior WicketMessage: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponentRoot cause:org.apache.wicket.WicketRuntimeException: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponent - 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
Download Link doesn't work on 1.5.x
In Wicket 1.4.x I used Link link = new Link(download){ @Override public void onClick() { *IResourceStream stream = new FileResourceStream(new File(path + fileName)); getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream) .setFileName(fileName));* } }; * After migration on 1.5.x what code should I use?* I'm trying with: *getRequestCycle().scheduleRequestHandlerAfterCurrent(new ResourceStreamRequestHandler(stream) .setFileName(fileName));* ... but doesn't work tnk -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309507.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Doing an action on press of key in a form
Yes i understood that, but how to solve my original problem Regards Krishna - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
See the source code of DownloadLink On Thu, Jan 19, 2012 at 10:06 AM, ricmancio ricman...@gmail.com wrote: In Wicket 1.4.x I used Link link = new Link(download){ @Override public void onClick() { *IResourceStream stream = new FileResourceStream(new File(path + fileName)); getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream) .setFileName(fileName));* } }; * After migration on 1.5.x what code should I use?* I'm trying with: *getRequestCycle().scheduleRequestHandlerAfterCurrent(new ResourceStreamRequestHandler(stream) .setFileName(fileName));* ... but doesn't work tnk -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309507.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket appl architecture
When he wrote wtf he probably mean ftw (for the win), to indicate it's a solid combination ;-) Op 19-1-2012 2:19, schreef nazeem: Russell Pitre wrote Separate front-end sounds fine. Use a REST architecture with JSON as the data exchange format. I'm pretty Spring MVC supports this through the use Jackson JSON library. Its something to add to your list of possible options. Wicket is component based and differs from Spring MVC. So do you mean you are using component based hierarchy for the user interface and spring mvc for the REST services exposed for external communication ? Is it possible ? Arjun Dhar wrote JSON Library + CXF wtf! Arjun, thank you for the input. Will try CXF, I haven't used it so far. Going thru the doc it looks promising with wide support. By the what do you mean by wtf! ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-appl-architecture-tp4305917p4308822.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Doing an action on press of key in a form
I'm not sure what Igor meant with this suggestion. I think .setDefaultButton() should do what you need. Here is another suggestion from me: Add a non-Ajax behavior to the text field which adds 'keyup' event handler. When the user types something in the field then check the keyCode from the event and if it is 13 then call 'document.getElementById(submitButtonId).click()'. On Thu, Jan 19, 2012 at 10:07 AM, Krishna Mohan k.krishnamoha...@gmail.com wrote: Yes i understood that, but how to solve my original problem Regards Krishna - 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
Re: Controlling URL of static cacheable resources
And I'm not sure why you think String#startsWith is faster than String#endsWith. They do the same ... With the IResourceCachingStrategy you can append .static to all resources you want and later use that to check in your filter. On Wed, Jan 18, 2012 at 11:34 PM, Peter Ertl pe...@gmx.org wrote: I you are really pedantic you put a a caching front-end proxy before your actual application server. By default wicket package resources (css/js/images) are delivered with a cache expiry of one year. By using fingerprinted filenames (through IResourceCachingStrategy) this will work flawlessly when resources are outdated. This is the default behavior and will also work in a cluster. Your front end proxy should be setup to cache these resources (I personally recommend nginx). Your java app server will not even be hit when requesting resources like .css and .js once they got loaded into the cache. Servers like nginx are by far more efficient in serving these kind of resources than any java app server. Unless you want to host facebook.com this setup should be more than sufficient. No need to twiddle around with filenames and 'static/' Cheers Peter Am 17.01.2012 um 14:52 schrieb Chris Colman: Maybe I am getting pedantic as I was thinking in terms of speed of operation for a server that's getting hammered with thousands of hits per hour. It's quicker to test the first few chars of a URL string for a match with 'startsWith' than it is to iterate through to almost the end of each URL string to see if it 'contains' a substring. Any URL will fail to match on comparison of the first character if they don't have a 'w' at the beginning which makes startsWith a 'fast fail' test for most URLs it processes. I think that's probably why the Servlet Spec chooses to do filter and servlet path matching via a 'starts with' strategy without support for wildcards except at the very end of a pattern. Many of the URLs requested are very long and I try to avoid string parsing of lots of thousands of long strings wherever I can - there's already enough of that going on without adding to the work load. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, 17 January 2012 7:08 PM To: users@wicket.apache.org Subject: Re: Controlling URL of static cacheable resources Hi Chris, With IResourceCachingStrategy you can pre/suf-fix the resource name with my.namespace.static, for example. This way your filter will be able to recognize it. It is the same as adding the /static/ segment. Just at different place. On Mon, Jan 16, 2012 at 10:49 PM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** I'm trying to make static resources have a distinguishable part of their URL near the beginning of the URL to enable easy configuration of third party filters that need to ignore requests for static resources and just proceed along the filter chain. ** ** I've looked up the operation of org.apache.wicket.request.resource.caching.IResourceCachingStrategy#dec orat eUrl but it appears that it only has the ability to make changes near the end of the resource URL after all the major segments of the URL have already been set ie., after this part ** ** /wicket/resource/org.apache.wicket rest of pathname.ClassName ** ** What I am trying to do is get all static resources to end up with a distinguishable URL that starts off something like: ** ** /wicket/resource/static/pathname.ClassName ** ** so I can configure a filter to ignore /wicket/resource/static/* ** ** In BasicResourceReferenceHandler.mapHandler() perhaps after adding the resource identifier segment: ** ** segments.add(getContext().getResourceIdentifier()); ** ** it could append an extra segment for static resources: ** ** final IResource resource = reference.getResource(); ** ** // if static resource if (resource instanceof IStaticCacheableResource) { segments.add(static); } ** ** And so end up with /wicket/resource/static/org.apache.wicket ... ** ** ** ** ** ** I also observed that Wicketstuff resources don't use the /wicket namespace prefix. They just start out at ** ** /resources/org.name.project.MyClass.script.js ** ** So they'd need a separate ignore entry in the filter. ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: wicket appl architecture
haha .. ur welcome. yes, I meant ftw = For the Win; ... well wtf is one for internet typo humor. Good luck ;) - 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/wicket-appl-architecture-tp4305917p4309535.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
thanks for the suggestion, but now it works also from the documentation: *https://cwiki.apache.org/WICKET/migration-to-wicket-15.html* *Redirect to non wicket or external page* suggests replacing old code : * getRequestCycle().setRequestTarget(new RedirectRequestTarget(/usage.html));* with: *getRequestCycle().scheduleRequestHandlerAfterCurrent(new RedirectRequestHandler(/usage.html));* -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309548.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
On Thu, Jan 19, 2012 at 10:33 AM, ricmancio ricman...@gmail.com wrote: thanks for the suggestion, but now it works That's good, no ? Is there a question below ? also from the documentation: *https://cwiki.apache.org/WICKET/migration-to-wicket-15.html* *Redirect to non wicket or external page* suggests replacing old code : * getRequestCycle().setRequestTarget(new RedirectRequestTarget(/usage.html));* with: *getRequestCycle().scheduleRequestHandlerAfterCurrent(new RedirectRequestHandler(/usage.html));* -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309548.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListView not refreshed after a new row is inserted with EJB3 as its backend data
Use a LoadableDetachableModelListUser in the ListView Constructor. Put all the load loading into the load method and see what happens. Cheers Per Am 19.01.2012 07:49, schrieb x.yang: Hello, Everyone, I am trying to build a web app with Wicket, EJB3, and MySQL. My IDE is Netbeans 6.9.1 and the server is Glassfish 3.1. I have created two entity beans 'Centre' and 'User', and one Centre has many User(s). I also created two Facades for them. The Wicket page used to list the Users is as below: class ListUsers extends WebPage { @EJB(name = UserFacade) private UserFacade userFacade; public ListUsers(Centre c) { ListUser users; if (c == null) { users = userFacade.findAll(); } else { users = new ArrayListUser(c.getUserCollection()); } final ListViewUser list = new ListViewUser(eachUser, users) { @Override protected void populateItem(ListItem item) { final User user = (User) item.getModelObject(); item.add(new Label(username, user.getUsername())); item.add(new Label(fullname, user.getFullname())); item.add(new Label(email, user.getEmail())); item.add(new Label(centreid, user.getCentre().getName())); } }; add(list); } } - The page to add a User is following: public AddUser(Centre c) { user = new User(); user.setCentre(c); FormAddUser form = new FormAddUser(AddUser) { @Override protected void onSubmit() { userFacade.create(user); } }; form.add(new TextFieldString(username, new PropertyModel(user, username)).setRequired(true)); PasswordTextField tf_password = new PasswordTextField(password, new PropertyModel(user, hashedPassword)); form.add(tf_password); form.add(new TextFieldString(fullname, new PropertyModel(user, fullname)).setRequired(true)); TextField tf_email = new TextFieldString(email, new PropertyModel(user, email)); form.add(tf_email); LoadableDetachableModel centres = new LoadableDetachableModel() { @Override protected Object load() { return centreFacade.findAll(); } }; DropDownChoiceCentre ddc = new DropDownChoiceCentre(centreid, new PropertyModelCentre(user, centre), centres, new ChoiceRendererCentre(name, name)); form.add(ddc.setRequired(true)); add(form); } } The problem is I can't see the newly added User in the list with getUserCollection() method of Centre, but I do see the new User if I use userFacade.findAll() method. Could you please help me and point me to the right direction? I am quite new to Wicket and EJB3. Any comments are welcom. Thanks a lot. Yang -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-not-refreshed-after-a-new-row-is-inserted-with-EJB3-as-its-backend-data-tp4309318p4309318.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: How do I write my first Apache Wicket program on NetBeans IDE?
The answer might depend in part upon which web server you want to use. NetBeans ships with Tomcat. There are others which one can use. I stopped using Tomcat and now use Google App Engine's (GAE's) development web server to run my Wicket application outside of NetBeans. If that is want you want to do, please let me know. Otherwise, other people's advice will be better. Have you visited https://cwiki.apache.org/WICKET/#Index-DevelopmentEnvironment yet? As regards class libraries for NetBeans, I have set up and use a NetBeans Wicket library which has the following files in the classpath: · wicket-core-1.5.3.jar · wicket-request-1.5.3.jar · wicket-util-1.5.3.jar · slf4j-jdk14-1.6.4.jar · slf4j-api-1.6.4.jar (my application uses Java's own logging class). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-do-i-write-my-first-apache-wicket-program-on-netbeans-IDE-tp4309226p4309582.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How do I write my first Apache Wicket program on NetBeans IDE?
If i were you i would learn how to create a project with maven first. Josh On Thu, Jan 19, 2012 at 12:53 PM, Ian Marshall ianmarshall...@gmail.comwrote: The answer might depend in part upon which web server you want to use. NetBeans ships with Tomcat. There are others which one can use. I stopped using Tomcat and now use Google App Engine's (GAE's) development web server to run my Wicket application outside of NetBeans. If that is want you want to do, please let me know. Otherwise, other people's advice will be better. Have you visited https://cwiki.apache.org/WICKET/#Index-DevelopmentEnvironment yet? As regards class libraries for NetBeans, I have set up and use a NetBeans Wicket library which has the following files in the classpath: · wicket-core-1.5.3.jar · wicket-request-1.5.3.jar · wicket-util-1.5.3.jar · slf4j-jdk14-1.6.4.jar · slf4j-api-1.6.4.jar (my application uses Java's own logging class). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-do-i-write-my-first-apache-wicket-program-on-netbeans-IDE-tp4309226p4309582.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
no question, *I replaced:* Link link = new Link(download){ @Override public void onClick() { IResourceStream stream = new FileResourceStream(new File(path + fileName)); getRequestCycle().scheduleRequestHandlerAfterCurrent(new ResourceStreamRequestHandler(stream).setFileName(fileName)); . *with* new DownloadLink(download, new File(path + fileName)) tnk -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309595.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How do I write my first Apache Wicket program on NetBeans IDE?
Don't forget to look at this: /http://netbeans.org/kb/68/web/quickstart-webapps-wicket.html./ If i were you i would learn how to create a project with maven first. Josh On Thu, Jan 19, 2012 at 12:53 PM, Ian Marshallianmarshall...@gmail.comwrote: The answer might depend in part upon which web server you want to use. NetBeans ships with Tomcat. There are others which one can use. I stopped using Tomcat and now use Google App Engine's (GAE's) development web server to run my Wicket application outside of NetBeans. If that is want you want to do, please let me know. Otherwise, other people's advice will be better. Have you visited https://cwiki.apache.org/WICKET/#Index-DevelopmentEnvironment yet? As regards class libraries for NetBeans, I have set up and use a NetBeans Wicket library which has the following files in the classpath: · wicket-core-1.5.3.jar · wicket-request-1.5.3.jar · wicket-util-1.5.3.jar · slf4j-jdk14-1.6.4.jar · slf4j-api-1.6.4.jar (my application uses Java's own logging class). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-do-i-write-my-first-apache-wicket-program-on-netbeans-IDE-tp4309226p4309582.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Doing an action on press of key in a form
Martin Grigorov mgrigorov at apache.org writes: I'm not sure what Igor meant with this suggestion. I think .setDefaultButton() should do what you need. Here is another suggestion from me: Add a non-Ajax behavior to the text field which adds 'keyup' event handler. When the user types something in the field then check the keyCode from the event and if it is 13 then call 'document.getElementById(submitButtonId).click()'. I describe my problem agin I have a form and few panels in it. In panel 'A' i have search button , panle 'A' consist of set of other panels 'B'. panel 'B' has few fields for example field 'F' Each panel is implemented in sepearate java class I have requirement wherein after entering text in the field 'F' on press of Enter button search should be performed with out click of search button. To achieve this i tried following snippet add(new AjaxEventBehavior(onkeypress) { @Override protected CharSequence getCallbackScript(boolean onlyTargetActivePage) { return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl(onlyTargetActivePage) + + KEYPRESS_PARAM + ='+wicketKeyCode(event)); } @Override protected void onEvent(AjaxRequestTarget target) { String paramValue = RequestCycle.get().getRequest().getParameter(KEYPRESS_PARAM); int key = Integer.parseInt(paramValue); if (key == 13) { submitSearchForm(); } } }); but using above the text in the field is cleared and get wrong search. but when i remove focus from the field and press Enter i get desired result. My question here is how to perform search, remaining in the field(with focus in the field) or their any other approach to get my requirement i also tried Form form = findParent(Form.class); if (form != null) { form.setDefaultButton(searchButton); } but form is always null for me i also tried Igor's idea i get below error on using AjaxFormComponentUpdatingBehavior WicketMessage: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponentRoot cause:org.apache.wicket.WicketRuntimeException: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponent Regards Krishna - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Hello all; TILT I learned how to access server session and context in Wicket 1.5
TILT I learned how to access server session and context in Wicket 1.5 Wicket 1.4 code HttpSession httpSession = ((WebRequest)getRequest()).getHttpServletRequest().getSession(); /code Wicket 1.5 code HttpServletRequest httpServletRequest = (HttpServletRequest)getRequest().getContainerRequest(); HttpSession httpSession = httpServletRequest.getSession(); ServletContext servletContext = httpSession.getServletContext(); /code That's my post here, hi to everybody Oscar Besga Arcauz
Re: Doing an action on press of key in a form
On Thu, Jan 19, 2012 at 1:31 PM, Krishna Mohan k.krishnamoha...@gmail.com wrote: Martin Grigorov mgrigorov at apache.org writes: I'm not sure what Igor meant with this suggestion. I think .setDefaultButton() should do what you need. Here is another suggestion from me: Add a non-Ajax behavior to the text field which adds 'keyup' event handler. When the user types something in the field then check the keyCode from the event and if it is 13 then call 'document.getElementById(submitButtonId).click()'. I describe my problem agin I have a form and few panels in it. In panel 'A' i have search button , panle 'A' consist of set of other panels 'B'. panel 'B' has few fields for example field 'F' Each panel is implemented in sepearate java class I have requirement wherein after entering text in the field 'F' on press of Enter button search should be performed with out click of search button. To achieve this i tried following snippet add(new AjaxEventBehavior(onkeypress) { @Override protected CharSequence getCallbackScript(boolean onlyTargetActivePage) { return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl(onlyTargetActivePage) + + KEYPRESS_PARAM + ='+wicketKeyCode(event)); } @Override protected void onEvent(AjaxRequestTarget target) { String paramValue = RequestCycle.get().getRequest().getParameter(KEYPRESS_PARAM); int key = Integer.parseInt(paramValue); if (key == 13) { submitSearchForm(); } } }); but using above the text in the field is cleared and get wrong search. but when i remove focus from the field and press Enter i get desired result. My question here is how to perform search, remaining in the field(with focus in the field) or their any other approach to get my requirement i also tried Form form = findParent(Form.class); if (form != null) { form.setDefaultButton(searchButton); } Put this code in PanelWithTheButton#onInitialize() but form is always null for me i also tried Igor's idea i get below error on using AjaxFormComponentUpdatingBehavior WicketMessage: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponentRoot cause:org.apache.wicket.WicketRuntimeException: Behavior nl.planon.hera.filters.quicksearch.PnWebAdvancedSearchPanel$3 can only be added to an instance of a FormComponent Regards Krishna - 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
Re: Hello all; TILT I learned how to access server session and context in Wicket 1.5
On Thu, Jan 19, 2012 at 1:39 PM, Oscar Besga obe...@gmail.com wrote: TILT I learned how to access server session and context in Wicket 1.5 Wicket 1.4 code HttpSession httpSession = ((WebRequest)getRequest()).getHttpServletRequest().getSession(); /code Wicket 1.5 code HttpServletRequest httpServletRequest = (HttpServletRequest)getRequest().getContainerRequest(); HttpSession httpSession = httpServletRequest.getSession(); ServletContext servletContext = httpSession.getServletContext(); /code That's my post here, hi to everybody hi :-) Oscar Besga Arcauz -- 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
Re: Doing an action on press of key in a form
Put this code in PanelWithTheButton#onInitialize() i did the same but it did not work - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Doing an action on press of key in a form
On Thu, Jan 19, 2012 at 1:56 PM, Krishna Mohan k.krishnamoha...@gmail.com wrote: Put this code in PanelWithTheButton#onInitialize() i did the same but it did not work the form should be reachable in #onInitialize(). try again - 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
Re: How to clear PageMap in Wicket 1.5?
hi dear wicket authors, I must say that the functionallity Matt is describing is a very important feature. We use Matt's hack in all our wicket applications using wicket 1.4. Please (please please) add this as an official feature to 1.5. thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-clear-PageMap-in-Wicket-1-5-tp3971976p4310158.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket appl architecture
well but then you need to rewrite some logic you already have in wicket's components, right? pozdrawiam Paweł Kamiński kami...@gmail.com pkaminski@gmail.com __ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
regarding sort property
Hi, I am using a check box panel to build a column of check box in data table using abstract column. How do i impose sort on it.On click of sort the selected checkboxes should appear on top and rest at the bottom. Do i need to use sortableComparator class..It would be a big help if some1 can provide a sample code. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/regarding-sort-property-tp4310532p4310532.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: regarding sort property
Hi there ; I think the simplest option would be to put a boolean field on the entity that you are sorting. Then add the column as usual (e.g using AbstractColumn the checkbox) . Then sorting will be done just as in the other fields. Josh. On Thu, Jan 19, 2012 at 7:31 PM, ridaa ridaa...@yahoo.com wrote: Hi, I am using a check box panel to build a column of check box in data table using abstract column. How do i impose sort on it.On click of sort the selected checkboxes should appear on top and rest at the bottom. Do i need to use sortableComparator class..It would be a big help if some1 can provide a sample code. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/regarding-sort-property-tp4310532p4310532.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
Wicket webshere 7
Hi, I have a big problem with websphere and wicket because of several ajax behavior that does not work when it is configured in webphere. Someone has gone through some configuration problem with websphere wicket that could help me? Being that we've set the property called com.ibm.ws.webcontainer.invokefilterscompatibility and dont work. thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-webshere-7-tp4310810p4310810.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Best practice for returning to calling page after submitting a form page
You can pass PageReference to the page with the form and use it in Form#onSubmit(). Page1.java: setResponsePage(new FormPage(getPageReference())); FormPage.java: public FormPage(final PageReference pr) { add(new Form() { onSubmit() { setResponsePage(pr.getPage()); } }); } PageReference looks nice. I hadn't noticed that class before. So it's a reference to a page instance in a page store? Will this just return the existing 'instance' of the page exactly the way it was before the user went to the form or will it use the page URL to perform a re-render and show any model updates that submitting the form may have caused? On Thu, Jan 19, 2012 at 2:39 AM, Chris Colman chr...@stepaheadsoftware.comwrote: ** ** I often use modal forms/dialogs so this issue is not a problem: In a modal scenario when the user submits a modal the page they called the modal form from is just sitting there behind the form when it closes - no need for redirection to the 'calling page' as it's redundant. ** ** In scenarios where some customers prefer not to have modal forms the forms have to be pages in their own right and involve the 'browser page change' dance. ** ** Is there a best practice in Wicket for making reusable page forms that remember which page called them and return to that page after submit or cancel? Or is there a Wicket class that manages this? ** ** Example scenario for Reusable Address form ** ** Scenario 1 ** ** Page A shows supplier's data with a panel displaying their address which includes a 'Change' button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page A. ** ** Scenario 2 ** ** Page B shows customer's data with a panel display their address which includes a 'Change' button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page B. ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Best practice for returning to calling page after submitting a form page
On Thu, Jan 19, 2012 at 6:54 PM, Chris Colman chr...@stepaheadsoftware.com wrote: You can pass PageReference to the page with the form and use it in Form#onSubmit(). Page1.java: setResponsePage(new FormPage(getPageReference())); FormPage.java: public FormPage(final PageReference pr) { add(new Form() { onSubmit() { setResponsePage(pr.getPage()); } }); } PageReference looks nice. I hadn't noticed that class before. So it's a reference to a page instance in a page store? Will this just return the existing 'instance' of the page exactly the way it was before the user went to the form or will it use the page URL to perform a re-render and show any model updates that submitting the form may have caused? It will get the previous (instance of the) page by id and show it. If this page uses dynamic models the you are fine. On Thu, Jan 19, 2012 at 2:39 AM, Chris Colman chr...@stepaheadsoftware.comwrote: ** ** I often use modal forms/dialogs so this issue is not a problem: In a modal scenario when the user submits a modal the page they called the modal form from is just sitting there behind the form when it closes - no need for redirection to the 'calling page' as it's redundant. ** ** In scenarios where some customers prefer not to have modal forms the forms have to be pages in their own right and involve the 'browser page change' dance. ** ** Is there a best practice in Wicket for making reusable page forms that remember which page called them and return to that page after submit or cancel? Or is there a Wicket class that manages this? ** ** Example scenario for Reusable Address form ** ** Scenario 1 ** ** Page A shows supplier's data with a panel displaying their address which includes a 'Change' button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page A. ** ** Scenario 2 ** ** Page B shows customer's data with a panel display their address which includes a 'Change' button. ** ** User clicks change and is taken to Address form page. ** ** User makes changes and hits ok. The browser returns to page B. ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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
Error detaching RequestHandler
Running 1.5.2, we occasionally see this error message in our logs, usually many times in a row: 2012-01-19 10:03:09,284 ERROR [org.apache.wicket.request.RequestHandlerStack] Error detaching RequestHandler org.apache.wicket.RestartResponseAtInterceptPageException No other details are provided. Any idea what this means? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Java class and javascript
Hello. I'm working into a wicket (1.4) project that now is in production, but we have decided to move it from Wicket 1.4 to Wicket 1.5 - and correct/add some features. I've some problems with the migration, I can't find how to translate some code from one version to another. My greatest problem is: I've a component with javascript code attached. The javascrit code is in a file named equal as the class, f. ex. MyComponent.java MyComponent.js; in the same package. In Wicket 1.4 ; I simply use one line int he onRenderHead method code @Override public void renderHead(IHeaderResponse response) { response.renderJavascriptReference(new ResourceReference(HistoricoBehavior.class, MyComponent.js)); super.renderHead(response); } /code I've tried with PackcageResource, a custom resource, etc. but I haven't found a working way... Have someone any ideas ? -- Oscar Besga Arcauz
Re: Java class and javascript
response.renderJavascriptReference(new *PackageResourceReference*(HistoricoBehavior.class, MyComponent.js)); On Fri, Jan 20, 2012 at 12:43 AM, Oscar Besga obe...@gmail.com wrote: Hello. I'm working into a wicket (1.4) project that now is in production, but we have decided to move it from Wicket 1.4 to Wicket 1.5 - and correct/add some features. I've some problems with the migration, I can't find how to translate some code from one version to another. My greatest problem is: I've a component with javascript code attached. The javascrit code is in a file named equal as the class, f. ex. MyComponent.java MyComponent.js; in the same package. In Wicket 1.4 ; I simply use one line int he onRenderHead method code @Override public void renderHead(IHeaderResponse response) { response.renderJavascriptReference(new ResourceReference(HistoricoBehavior.class, MyComponent.js)); super.renderHead(response); } /code I've tried with PackcageResource, a custom resource, etc. but I haven't found a working way... Have someone any ideas ? -- Oscar Besga Arcauz -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Error detaching RequestHandler
Hi, This error means that somewhere in your component hierarchy you throw RestartResponseAtInterceptPageException in #detach() method. I just did a quick search in Wicket's code and I didn't find such occurrence. Check your code and the libraries you use. On Thu, Jan 19, 2012 at 7:31 PM, Allen Gilbert allen.gilb...@doane.edu wrote: Running 1.5.2, we occasionally see this error message in our logs, usually many times in a row: 2012-01-19 10:03:09,284 ERROR [org.apache.wicket.request.RequestHandlerStack] Error detaching RequestHandler org.apache.wicket.RestartResponseAtInterceptPageException No other details are provided. Any idea what this means? - 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
Re: Get Wicket to ignore wicket parameters
On Jan 17, 2012, at 9:31 PM, Jeremy Thomerson wrote: I'm sure it can be handled in Wicket, but even then I'd default to mod_rewrite for something as simple as always remove parameter X from query string for pages A, B, C. To me dealing with old URLs is better done at that level rather than cluttering the application with it. Yeah, this is true. Also, by using mod_rewrite, one can tell the search engines that it's a permanent change so hopefully over time, most of the old links fade away. Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket webshere 7
Am I right to assume you're running with Wicket Filter ? On Thu, Jan 19, 2012 at 12:51 PM, matteus matteu...@hotmail.com wrote: Hi, I have a big problem with websphere and wicket because of several ajax behavior that does not work when it is configured in webphere. Someone has gone through some configuration problem with websphere wicket that could help me? Being that we've set the property called com.ibm.ws.webcontainer.invokefilterscompatibility and dont work. thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-webshere-7-tp4310810p4310810.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 -- Sent by Eric Hamel
Nested Modal Window Problem - IE8 - 404 Error
Since I upgraded from wicket version 1.4 to wicket version 1.5.3 I get a Http status 404 error in IE8 when I open a modal window within a modal window - this is not a problem I had with the 1.4 versions of wicket. I tried using the 1.5.4 version that is about to be released and I still have this problem. Can someone tell me if this is a known bug or if there is a way to solve the problem - it is really frustrating me? Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Modal-Window-Problem-IE8-404-Error-tp4311638p4311638.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket spring security sample app
James, I cloned the repository. $ git clone https://github.com/jwcarman/Wicketopia.git $ cd Wicketopia $ mvn eclipse:eclipse a few errors including the below error. [ERROR] Failed to execute goal on project wicketopia-persistence: Could not resolve dependencies for project org.wicketopia:wicketopia-persistence:jar:1.0-SNAPSHOT: Could not find artifact org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) - [Help 1] [ERROR] Imported it into Eclipse. Which test case do I run? I tried changing into the example directory and doing a mvn eclipse:eclipse too, but it gave the below error. [ERROR] Failed to execute goal on project wicketopia-example: Could not resolve dependencies for project org.wicketopia:wicketopia-example:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.wicketopia:wicketopia:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-joda:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-cdi-weld:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-spring-security:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-hibernate:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia:jar:tests:1.0-SNAPSHOT: Failure to find org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced - [Help 1] brian On Wed, Jan 18, 2012 at 06:58:08AM -0500, James Carman wrote: Either way, you can open it in your IDE and run the jetty test server that's included. That's how I run it usually so that I can easily debug and play around. On Wed, Jan 18, 2012 at 6:57 AM, James Carman ja...@carmanconsulting.com wrote: I don't know if the plugin is turned on for the example application. But, you'd need to make sure you are in the example module before you try. On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender br...@brie.com wrote: On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote: See https://github.com/jwcarman/Wicketopia Maybe I missed something, but I wasn't able to do a mvn jetty:run or did the war package run after generating a war file. brian -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture - 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 -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Still trying to get the Spring security with auth-roles
Can someone add the Spring Security for me? I have this simple web app from the Wicket examples (slightly modified) that uses Wicket-auth-roles and I just can't seem to wire in the spring security. Right now, authman has the users and hard coded in com.foobar.MyAuthenticatedWebSession. I would like to have it so it is using Spring Security so that I can use either hard coded or switch it to an LDAP storage. Is there someone who can do it so I can see? http://brie.com/brian/wicket/authman.zip I tried following the page at https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html and I still have yet to succeed. :-( Thanks, brian -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Doing an action on press of key in a form
the form should be reachable in #onInitialize(). try again No it is not reachable - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org