Re: How to change the properties file location in Wicket
Hi Tom, my usecase is: I wan't wicket to search for the key=value in particular order, i.e: let's say i have those propertis files: 1. ...\java\com\mycompany*\external\*WicketApplication_en.properties 2. ...\java\com\mycompany\WicketApplication_en.properties 3. ...\java\com\mycompany*\external\*WicketApplication.properties 4. ...\java\com\mycompany\WicketApplication.properties so i want Wicket to load the wicket:messag in the following order: wicket:message key=eee / --should be load from ...\java\com\mycompany\WicketApplication_en.properties wicket:message key=ccc / --should be load from ...\java\com\mycompany*\external\*WicketApplication_en.properties wicket:message key=jjj / --should be load from ...\java\com\mycompany\WicketApplication.properties wicket:message key=kkk / --should be load from ...\java\com\mycompany\WicketApplication_en.properties any idea? Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-change-the-properties-file-location-in-Wicket-tp4642901p4649606.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 to change the properties file location in Wicket
Please change the sentence so i want Wicket to load the wicket:messag in the following order: to so i want Wicket to load the wicket:messag from the following files: Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-change-the-properties-file-location-in-Wicket-tp4642901p4649607.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: Loop.populateItem() while migrating from Wicket 1.4 to 1.5
Could you please provide a quickstart? -Tom On 31.05.2012, 00:32 paulstar wrote: in Wicket 1.4, this works fine: this.form.add(new Loop(ccformfields, ccformfields.size()) { @Override protected void populateItem(LoopItem item) { int index = item.getIteration(); final CcFormPanel.FormField frag = ccformfields.get(index); item.add(new TableRow(frag)); } }); Now I am upgrading to Wicket 1.5 as such: this.form.add(new Loop(ccformfields, ccformfields.size()) { @Override protected void populateItem(LoopItem item) { int index = item.getIndex(); final CcFormPanel.FormField frag = ccformfields.get(index); item.add(new TableRow(frag)); } }); Here are the exception: Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.RangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at com.xxx.cc.components.CcFormPanel$1.populateItem(CcFormPanel.java:202) at org.apache.wicket.markup.html.list.Loop.onPopulate(Loop.java:100) at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:119) at org.apache.wicket.Component.internalBeforeRender(Component.java:993) at org.apache.wicket.Component.beforeRender(Component.java:1027) at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1743) ... 49 more -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Loop-populateItem-while-migrating-from-Wicket-1-4-to-1-5-tp4649598.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: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
What about using Javascript? e.g. jQuery: $('input:radio').attr('checked', false); or $('input[name=myRadio]:radio').attr('checked', false); -Tom On 31.05.2012 at 08:20 Chris Colman wrote: We have a button that, when clicked, should deselect ALL radio buttons in a separate radio group. Can this be done in Wicket? Yours sincerely, Chris Colman
Re: handling user agent
Hi, By using custom root request mapper this should be easy to achieve. On Wed, May 30, 2012 at 7:23 PM, wicket user samd...@live.com wrote: Question was how to handle user agent on the application level , i dont wanna write same code on each page to check the user agent then render the appropriate page -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/handling-user-agent-tp4649565p4649584.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: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
Hi, On Thu, May 31, 2012 at 10:04 AM, Thomas Götz t...@decoded.de wrote: What about using Javascript? e.g. jQuery: $('input:radio').attr('checked', false); or $('input[name=myRadio]:radio').attr('checked', false); I guess he will need to update the server state as well. @Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? -Tom On 31.05.2012 at 08:20 Chris Colman wrote: We have a button that, when clicked, should deselect ALL radio buttons in a separate radio group. Can this be done in Wicket? Yours sincerely, Chris Colman -- 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: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
@Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? That's what I tried first but it didn't work for some reason. -Tom On 31.05.2012 at 08:20 Chris Colman wrote: We have a button that, when clicked, should deselect ALL radio buttons in a separate radio group. Can this be done in Wicket? Yours sincerely, Chris Colman -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
@Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? Bingo! I got it working. I wasn't adding the radio button to the target in the event handler. This is what works: group2Choice1Radio.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { // there is no radio button for o1None so choosing this // deselects all radio buttons setGroup1Option(new Integer(MyModel.o1None)); target.add(group1Choice1Radio); target.add(group1Choice2Radio); } }); Using this option I need to target.add() for each individual radio button in the group I want to have deselected. I tried using the RadioGroup object as the component added to the target like: target.add(option1Group); but got: Last cause: Ajax render cannot be called on component that has setRenderBodyOnly enabled. Component: [RadioGroup [Component id = option1Group]] Which makes sense because the RadioGroup component's tags disappear when the markup is rendered. Regards, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access to Page from LoadableDetachableModel
Hi, I added the panel in the onInitialize method to keep the way you did and because I don't know the rest of the code. But, for the specific part of code we exchanged, the panel could be added in the constructor (or best, in an init() method called by the constructor to be clean). There is also no problem to have the LDM as a nested class; for the quick start, the LDM was in the MyPanel.java (not nested then, but there is no huge difference strictly java speaking). Regards, Sebastien. On Thu, May 31, 2012 at 1:41 AM, gmparker2000 greg.par...@brovada.comwrote: Thank you so much Sebastien and Sven! Sebastien I altered my actual code to put the panel on the LDM and it didn't work on the initial try. The problem with the illegal state exception I was having seems to happen if you construct your components in the panel constructor instead of the onInitialize method. Once I made sure everything was using the onInitialize method the panel.getPage() method started working presumably because the onInitialize of the panel triggers the LDM load after the panel is officially added to the page. Next I'm going to try to phase out the panel member variable on the LDM by using MyPanel.this.getPage() instead. This should work and then I can be sure that I'm not serializing the panel with the LDM.
Re: wicket ajax push
If you are looking for examples, wicketstuff has a push module ( https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/push-parent), atmosphere examples also contain a wicket example ( https://github.com/Atmosphere/atmosphere/tree/master/samples) and the just released wicket 6 beta2 comes with a wicket-atmosphere module ( http://wicket.apache.org/2012/05/29/wicket-6.0.0-beta2-released.html) 2012/5/30 Douglas Ferguson the...@gmail.com Anybody doing any ajax push stuff using wicket? Douglas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
Doh! That approach fails when I target.add a second radio button. I needed to create a new MarkupContainer to wrap the group in and then I target.add() that div and deselection of all items works well. So it looks like this: span wicket:id=radioGroup1 div wicket:id=radioGroup1Div input id=choice1 name=option1 type=radio value=01 wicket:id=choice1 input id=choice2 name=option1 type=radio value=02 wicket:id=choice2 /div /span @Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? Bingo! I got it working. I wasn't adding the radio button to the target in the event handler. This is what works: group2Choice1Radio.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { // there is no radio button for o1None so choosing this // deselects all radio buttons setGroup1Option(new Integer(MyModel.o1None)); target.add(group1Choice1Radio); target.add(group1Choice2Radio); } }); Using this option I need to target.add() for each individual radio button in the group I want to have deselected. I tried using the RadioGroup object as the component added to the target like: target.add(option1Group); but got: Last cause: Ajax render cannot be called on component that has setRenderBodyOnly enabled. Component: [RadioGroup [Component id = option1Group]] Which makes sense because the RadioGroup component's tags disappear when the markup is rendered. Regards, Chris - 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
Apache Wicket 6.0.0-beta2 has been released
The Wicket team is proud to announce the second beta release of the Wicket 6.x series. This release brings over many improvements over the 1.5.x series. There are no more planned API breaks but if you find something that can be made better now it the time to discuss it! We will try to avoid making any API changes in the Release Candidates that will follow this beta release. Any feedback about the new features, their implementation and their documentation is very welcome! New and Noteworthy == Wicket Atmosphere - The Beta 2 contains a new experimental module Wicket Atmosphere, which brings serverside push to Wicket and provides a great way to render serverside markup and send it to the browsers of your users. Check out the atmosphere example in our Examples project to see it in action. In your application’s init method you need to register the push event bus: new EventBus(this); Somewhere where you want to push your changes to the client, you need to publish your event to the push EventBus: EventBus.get().post(input.getModelObject()); And finally you need to subscribe your page (or component) to the EventBus’s events with @Subscribe, taking in the typed parameter you post to the EventBus (in this case a String): @Subscribe public void receiveMessage(AjaxRequestTarget target, String message) { label.setDefaultModelObject(message); target.add(label); } To be able to use Wicket Atmosphere you need to include the following dependency: dependency groupIdorg.apache.wicket/groupId artifactIdwicket-atmosphere/artifactId version0.1/version /dependency Please note that this is still experimental. This release * Check the roadmap with a list of the major goals: https://cwiki.apache.org/WICKET/wicket-60-roadmap.html * And the migration guide with all major and some minor changes between 1.5.x and 6.x series: https://cwiki.apache.org/WICKET/migration-to-wicket-60.html * The Jira changelog of all closed ticket at Jira: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12320343 To use it in Maven: dependency groupIdorg.apache.wicket/groupId artifactIdwicket-core/artifactId version6.0.0-beta2/version /dependency If you don’t use a dependencies management build tool then you can download the full distribution (including source). Have fun, The Wicket team! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
On Thu, May 31, 2012 at 11:48 AM, Chris Colman chr...@stepaheadsoftware.com wrote: Doh! That approach fails when I target.add a second radio button. I needed to create a new MarkupContainer to wrap the group in and then I target.add() that div and deselection of all items works well. So it looks like this: span wicket:id=radioGroup1 div wicket:id=radioGroup1Div input id=choice1 name=option1 type=radio value=01 wicket:id=choice1 input id=choice2 name=option1 type=radio value=02 wicket:id=choice2 /div /span div inside span is invalid HTML. I know that one of those is not rendered at all because it is attached to the RadioGroup but ... can't you do radioGroup.setRenderBodyOnly(false) and remove the extra component ? @Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? Bingo! I got it working. I wasn't adding the radio button to the target in the event handler. This is what works: group2Choice1Radio.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { // there is no radio button for o1None so choosing this // deselects all radio buttons setGroup1Option(new Integer(MyModel.o1None)); target.add(group1Choice1Radio); target.add(group1Choice2Radio); } }); Using this option I need to target.add() for each individual radio button in the group I want to have deselected. I tried using the RadioGroup object as the component added to the target like: target.add(option1Group); but got: Last cause: Ajax render cannot be called on component that has setRenderBodyOnly enabled. Component: [RadioGroup [Component id = option1Group]] Which makes sense because the RadioGroup component's tags disappear when the markup is rendered. Regards, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Filtercolumn and bigdecimal formatter
Hi, I spent hours and hours but can't find any solution: I have a datatable with a filter. I want to filter on a BigDecimal field. However the output is presented as is. For example euro 1 instead of 1,00 euro. I always want to show the amount with two decimals. Who can help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649623.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
Filtercolumn and bigdecimal formatter
Hi, I spent hours and hours but can't find any solution: I have a datatable with a filter. I want to filter on a BigDecimal field. However the output is presented as is. For example euro 1 instead of 1,00 euro. I always want to show the amount with two decimals. Who can help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624.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: Filtercolumn and bigdecimal formatter
Shouldnt the filtering be done when querying the database? On Thu, May 31, 2012 at 3:32 PM, lang delan...@telfort.nl wrote: Hi, I spent hours and hours but can't find any solution: I have a datatable with a filter. I want to filter on a BigDecimal field. However the output is presented as is. For example euro 1 instead of 1,00 euro. I always want to show the amount with two decimals. Who can help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624.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: Filtercolumn and bigdecimal formatter
Hi, FilteredAbstractColumn implements ICellPopulator, which provides #populateItem() Did you already tried something like: public void populateItem(ItemICellPopulatorT item, String componentId, IModelT rowModel) { IModelBigInteger model = (IModelBigInteger) super.createLabelModel(rowModel); item.add(new MyBigIntegerLabel(componentId, model)); // MyBigIntegerLabel should format your model object as string (using String.format?) properly here } Regards, Sebastien. On Thu, May 31, 2012 at 2:50 PM, Josh Kamau joshnet2...@gmail.com wrote: Shouldnt the filtering be done when querying the database? On Thu, May 31, 2012 at 3:32 PM, lang delan...@telfort.nl wrote: Hi, I spent hours and hours but can't find any solution: I have a datatable with a filter. I want to filter on a BigDecimal field. However the output is presented as is. For example euro 1 instead of 1,00 euro. I always want to show the amount with two decimals. Who can help? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Filtercolumn-and-bigdecimal-formatter-tp4649624.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: Is there a quick way to deselect all radio buttons in a group via an AJAX event?
span wicket:id=radioGroup1 div wicket:id=radioGroup1Div input id=choice1 name=option1 type=radio value=01 wicket:id=choice1 input id=choice2 name=option1 type=radio value=02 wicket:id=choice2 /div /span div inside span is invalid HTML. I know that one of those is not rendered at all because it is attached to the RadioGroup but ... can't you do radioGroup.setRenderBodyOnly(false) and remove the extra component ? Hmmm, probably could do it that way. @Chris: Can't you reset the RadioGroup's model so that none of the Radios models match and re-render the whole group ? Bingo! I got it working. I wasn't adding the radio button to the target in the event handler. This is what works: group2Choice1Radio.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { // there is no radio button for o1None so choosing this // deselects all radio buttons setGroup1Option(new Integer(MyModel.o1None)); target.add(group1Choice1Radio); target.add(group1Choice2Radio); } }); Using this option I need to target.add() for each individual radio button in the group I want to have deselected. I tried using the RadioGroup object as the component added to the target like: target.add(option1Group); but got: Last cause: Ajax render cannot be called on component that has setRenderBodyOnly enabled. Component: [RadioGroup [Component id = option1Group]] Which makes sense because the RadioGroup component's tags disappear when the markup is rendered. Regards, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: handling user agent
just wondering how to implement it , i tried the following code not sure am i doing correct, public class MyMapper implements IRequestMapper { private final IRequestMapper delegate; public MyMapper(IRequestMapper delegate) { this.delegate = delegate; } public IRequestHandler mapRequest(Request request) { Url url = request.getUrl(); String user = WebSession.get().getClientInfo().getUserAgent(); //System.out.println(user); return delegate.mapRequest(request.cloneWithUrl(url)); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/handling-user-agent-tp4649565p4649628.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: Getting more stale page exception in wicket 1.5.6
Hello Martin I think I found why I see the warning WARN: org.apache.wicket.request.handler.request.WebPageRenderer - The Buffered response should be handled by BufferedResponseRequestHandler. I am having a code like, setResponsePage(ProblemIndexPage.class); inside an Panel (last line). This is a hidden widget. Whenever I call this widget, it will perform some task and redirect to the home page. When I call this panel first time, it shows the warning. Then if I try to call it once again, then it says ComponentNotFoundException. Is there a better way to redirect rather than setResponsePage ? In my application I have already mounted the home page, mountPage(/main, ProblemIndexPage.class); Thanks, Suresh -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-more-stale-page-exception-in-wicket-1-5-6-tp4649492p4649629.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: Specified expiration page not being shown
After more investigation it seems that wicket 1.4.20 is not always displaying the expired page if session expires on a form and the form button link resolves to a url mounted using QueryStringUrlCodingStrategy mount(new QueryStringUrlCodingStrategy(test,HomePage.class)); the relevant bit of code in WebRequestCycleProcessor is below, requestCodingStrategy will return a target if path is not null, even if session is dead. // NOTE we are doing the mount check as the last item, so that it will // only be executed when everything else fails. This enables URLs like // /foo/bar/?wicket:bookmarkablePage=my.Page to be resolved, where // is either a valid mount or a non-valid mount. I (Eelco) am not // absolutely sure this is a great way to go, but it seems to have been // established as the default way of doing things. If we ever want to // tighten the algorithm up, it should be combined by going back to // unmounted paths so that requests with Wicket parameters like // 'bookmarkablePage' are always created and resolved in the same // fashion. There is a test for this in UrlMountingTest. if (target == null) { // still null? check for a mount target = requestCodingStrategy.targetForRequest(requestParameters); if (target == null requestParameters.getComponentPath() != null) { // If the target is still null and there was a component path // then the Page could not be located in the session throw new PageExpiredException( Cannot find the rendered page in session [pagemap= + requestParameters.getPageMapName() + ,componentPath= + requestParameters.getComponentPath() + ,versionNumber= + requestParameters.getVersionNumber() + ]); } } -Original Message- From: Dale Ogilvie [mailto:dale_ogil...@trimble.com] Sent: Wednesday, 30 May 2012 9:52 a.m. To: users@wicket.apache.org Subject: Specified expiration page not being shown Hi, This is for wicket 1.4.20. In our WebApplication subclass we have used: getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class); However after session has expired on one of our pages, if I submit the (fairly complex) form, the form error message is shown. By this I mean that page component validation fires and validation of an object from session (now defunct) fails and the page is redrawn with an error message in the feedback panel. The expired page IS displayed if an ajax backed combo is used on the same form, only form submission avoids the expiry page. Why might it be that our MyExpiredPage is not being shown in the form submission case? We want our expired page to be displayed consistently. Thanks for any suggestions as to where to look for the issue. Dale - 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