Re: Internationalized error() from Page constructor
Well if you have a Component you can use one of the getString methods. It's just that the above also works if you do not have a component to work with. Maurice On Mon, Apr 21, 2008 at 10:27 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > Maurice Marrink wrote: > > > String errorMessage > > =Application.get().getResourceSettings().getLocalizer().getString(key, > > someComponentOrNull,defaultMsg); > > > > Is this the correct way of doing it? I think it would be really nice if > Session#error, info etc could take a resourceKey instead.. > > -- Edvin > > > > > > > > Maurice > > > > On Mon, Apr 21, 2008 at 9:46 PM, Enrique Rodriguez <[EMAIL PROTECTED]> > wrote: > > > > > I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows > > > the use of StringResourceModel with Component#info. However, when I > > > tried that once, I simply got the Object#toString()-style output in my > > > FeedbackPanel! > > > > > > Enrique > > > > > > > > > > > > > > > On Mon, Apr 21, 2008 at 12:40 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > > > > Ryan Gravener wrote: > > > > > I think you can do error((String)(new > > > > ResourceModel("page.error").getObject())) > > > > > > > > > > > > > Nah.. besides beeing incredibly nasty, you just instantiate and > unwrap it > > > > right away. Can't see how that will help? :) > > > > > > > > > > > > > > > > > > > > > > On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> > wrote: > > > > > > > > > > > Sometimes, I want to redirect to another page with an error > message > > > > because > > > > > > of something I discover when the constructor runs. I would like > to do: > > > > > > > > > > > > if(some_condition) { > > > > > >Session.get().error("errmsg"); > > > > > >setResponsePage(PageClass.class); > > > > > >return; > > > > > > } > > > > > > > > > > > > The problem is that Session#error() doesn't take a resource-key, > only > > > > the > > > > > > final text. In the constructor it might be too early to determine > the > > > > > > language etc. What's the Wicket way around this one? :) > > > > > > > > > > > > -- Edvin > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Removing the jsessionid for SEO
Hello, I still didn't find the time to make a blog post about this. So I just put the code on pastebin: http://pastebin.org/31242 I'm looking forward to your feedback :) I tested this filter on Jetty and Tomcat (with Firefox' user agent switcher) where it worked fine. However, as stated in the code, some app servers might behave a little different, so YMMV. greetings, Rüdiger Am Montag, den 14.04.2008, 16:37 +0200 schrieb Korbinian Bachl - privat: > Yeah, its quite a shame that google doesnt open source their logic ;) > > would be nice if you could give us the code however, so we could have a > look at it :) > > Rüdiger Schulz schrieb: > > Hm, SEO is really a little bit like black science sometimes *g* > > > > This (german) article states, that SID cloaking would be ok for google: > > http://www.trafficmaxx.de/blog/google/gutes-cloaking-schlechtes-cloaking > > > > Some more googling, and here someone seems to confirm this: > > http://www.webmasterworld.com/cloaking/3201743.htm > > " I was actually at SMX West and Matt Cutts specifically sa*id* that this is > > OK" > > > > All I can say in our case is that I added this filter several months ago, > > and I can't see any negative effects so far. > > > > > > greetings, > > > > Rüdiger > > > > > > 2008/4/14, Korbinian Bachl - privat <[EMAIL PROTECTED]>: > >> Hi Rüdiger, > >> > >> AFAIK this could lead to some punishment by google, as he browses the site > >> multiple times using different agents and origin IPs and in case he sees > >> different behaviours he thinks about cloaking/ prepared content and will > >> act > >> accordingly to it; > >> > >> This is usually noticed after the regular google index refreshes that > >> happen some times a year - you should keep an eye onto this; > >> > >> Best, > >> > >> Korbinian > >> > >> Rüdiger Schulz schrieb: > >> > >>> Hello everybody, > >>> > >>> I just want to add my 2 cents to this discussion. > >>> > >>> At IndyPhone we too wanted to get rid of jesessionid-URLs in google's > >>> index. > >>> Yeah, it would be nice if the google bot would be as clever as the one > >>> from > >>> yahoo, and just remove them himself. But he doesn't. > >>> > >>> So I implemented a Servlet-Filter which checks the user agent header for > >>> google bot, and skips the url rewriting just for those clients. As this > >>> will > >>> generate lots of new sessions, the filter invalidates the session right > >>> after the request. Also, if a crawler is doing a request containing a > >>> jsessionid (which he stored before the filter was implemented), he > >>> redirects > >>> the crawler to the same URL, just without the jsessionid parameter. That > >>> way, the index will be updated for those old URLs. > >>> > >>> Now we have almost none of those URLs in google's index. > >>> > >>> If anyone is interested in the code, I'd be willing to publish this. As > >>> it > >>> is not wicket specific, I could share it with some generic servlet tools > >>> OS > >>> project - is there something like that on apache or elsewhere? > >>> > >>> But maybe Google is smarter by now, and it is not required anymore? > >>> > >>> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible() with surrounding Markup and LoadableDetachableModel
strange. if you create a quickstart i can take a closer look. -igor On Mon, Apr 21, 2008 at 9:33 PM, Warren <[EMAIL PROTECTED]> wrote: > Well the Ajax Debug window just keeps scrolling with each new request and > shows the previous requests. If it was a standard request, a new debug > window would be created with the new page, wouldn't it. The form I am > testing has a standard html submit button that is not linked to a component. > I am using AjaxFormSubmitBehavior("onkeypress") added to a text field with a > Decorator that returns false and only sends a request if the enter key is > pressed. > > > testTextField.add(new > AjaxFormSubmitBehavior("onkeypress") > { > protected void onSubmit(AjaxRequestTarget > target) > { > target.addComponent(LoadForm.this); > } > protected void onError(AjaxRequestTarget > target) > { > } > protected IAjaxCallDecorator > getAjaxCallDecorator() > { > return new AjaxCallDecorator() > { > public CharSequence > decorateScript(CharSequence script) > { > return > "if(window.event.keyCode == 13){" + script + "};return > false;"; > } > }; > } > }); > > > > -Original Message- > > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > > > Sent: Monday, April 21, 2008 9:17 PM > > To: users@wicket.apache.org > > Subject: Re: isVisible() with surrounding Markup and > > LoadableDetachableModel > > > > > > > > are you really sure this is all one request, because it looks like > > once detach is called from a page request target, and once from ajax > > request target, which would indicate a normal request followed by an > > ajax one... > > > > -igor > > > > > > On Mon, Apr 21, 2008 at 9:07 PM, Warren > > <[EMAIL PROTECTED]> wrote: > > > Stack trace in load() and onDetach() > > > > > > > > > java.lang.Exception > > > at load.Load$1.load(Load.java:26) > > > at > > > > > org.apache.wicket.model.LoadableDetachableModel.getObject(Loadable > > Detachable > > > Model.java:114) > > > at > > > > > org.apache.wicket.model.CompoundPropertyModel.getObject(CompoundPr > > opertyMode > > > l.java:60) > > > at > > > > > org.apache.wicket.model.AbstractPropertyModel.getTarget(AbstractPr > > opertyMode > > > l.java:187) > > > at > > > > > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPr > > opertyMode > > > l.java:110) > > > at > > org.apache.wicket.Component.getModelObject(Component.java:1539) > > > at > > org.apache.wicket.Component.getModelObjectAsString(Component.java:1561) > > > at load.Load$LoadForm$1.isVisible(Load.java:54) > > > > > > > > > at > > org.apache.wicket.Component.internalBeforeRender(Component.java:990) > > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > > at > > > > > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupCon > > tainer.jav > > > a:1513) > > > at > > org.apache.wicket.Component.onBeforeRender(Component.java:3657) > > > at > > org.apache.wicket.Component.internalBeforeRender(Component.java:995) > > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > > at > > org.apache.wicket.Component.prepareForRender(Component.java:2139) > > > at > > > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequ > > estTarget. > > > java:698) > > > at > > > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxReq > > uestTarget > > > .java:605) > > > at > > > > > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget > > .java:520) > > > at > > > > > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(Ab > > stractRequ > > > estCycleProcessor.java:103) > > > at > > > > > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycl > > e.java:117 > > > 2) > > > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > > > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > > > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > > > at > > > > > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) >
RE: isVisible() with surrounding Markup and LoadableDetachableModel
Well the Ajax Debug window just keeps scrolling with each new request and shows the previous requests. If it was a standard request, a new debug window would be created with the new page, wouldn't it. The form I am testing has a standard html submit button that is not linked to a component. I am using AjaxFormSubmitBehavior("onkeypress") added to a text field with a Decorator that returns false and only sends a request if the enter key is pressed. testTextField.add(new AjaxFormSubmitBehavior("onkeypress") { protected void onSubmit(AjaxRequestTarget target) { target.addComponent(LoadForm.this); } protected void onError(AjaxRequestTarget target) { } protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { public CharSequence decorateScript(CharSequence script) { return "if(window.event.keyCode == 13){" + script + "};return false;"; } }; } }); > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 9:17 PM > To: users@wicket.apache.org > Subject: Re: isVisible() with surrounding Markup and > LoadableDetachableModel > > > are you really sure this is all one request, because it looks like > once detach is called from a page request target, and once from ajax > request target, which would indicate a normal request followed by an > ajax one... > > -igor > > > On Mon, Apr 21, 2008 at 9:07 PM, Warren > <[EMAIL PROTECTED]> wrote: > > Stack trace in load() and onDetach() > > > > > > java.lang.Exception > > at load.Load$1.load(Load.java:26) > > at > > > org.apache.wicket.model.LoadableDetachableModel.getObject(Loadable > Detachable > > Model.java:114) > > at > > > org.apache.wicket.model.CompoundPropertyModel.getObject(CompoundPr > opertyMode > > l.java:60) > > at > > > org.apache.wicket.model.AbstractPropertyModel.getTarget(AbstractPr > opertyMode > > l.java:187) > > at > > > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPr > opertyMode > > l.java:110) > > at > org.apache.wicket.Component.getModelObject(Component.java:1539) > > at > org.apache.wicket.Component.getModelObjectAsString(Component.java:1561) > > at load.Load$LoadForm$1.isVisible(Load.java:54) > > > > > > at > org.apache.wicket.Component.internalBeforeRender(Component.java:990) > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > at > > > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupCon > tainer.jav > > a:1513) > > at > org.apache.wicket.Component.onBeforeRender(Component.java:3657) > > at > org.apache.wicket.Component.internalBeforeRender(Component.java:995) > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > at > org.apache.wicket.Component.prepareForRender(Component.java:2139) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequ > estTarget. > > java:698) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxReq > uestTarget > > .java:605) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget > .java:520) > > at > > > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(Ab > stractRequ > > estCycleProcessor.java:103) > > at > > > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycl > e.java:117 > > 2) > > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > > at > > > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > > at > > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter > .java:194) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A > pplication > > FilterChain.java:186) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati > onFilterCh > > ain.java:157) > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp > erValve.ja > > va:214) > > at > > > org.apache.catalina.core.St
Re: isVisible() with surrounding Markup and LoadableDetachableModel
are you really sure this is all one request, because it looks like once detach is called from a page request target, and once from ajax request target, which would indicate a normal request followed by an ajax one... -igor On Mon, Apr 21, 2008 at 9:07 PM, Warren <[EMAIL PROTECTED]> wrote: > Stack trace in load() and onDetach() > > > java.lang.Exception > at load.Load$1.load(Load.java:26) > at > org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachable > Model.java:114) > at > org.apache.wicket.model.CompoundPropertyModel.getObject(CompoundPropertyMode > l.java:60) > at > org.apache.wicket.model.AbstractPropertyModel.getTarget(AbstractPropertyMode > l.java:187) > at > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyMode > l.java:110) > at org.apache.wicket.Component.getModelObject(Component.java:1539) > at > org.apache.wicket.Component.getModelObjectAsString(Component.java:1561) > at load.Load$LoadForm$1.isVisible(Load.java:54) > > > at > org.apache.wicket.Component.internalBeforeRender(Component.java:990) > at org.apache.wicket.Component.beforeRender(Component.java:1027) > at > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.jav > a:1513) > at org.apache.wicket.Component.onBeforeRender(Component.java:3657) > at > org.apache.wicket.Component.internalBeforeRender(Component.java:995) > at org.apache.wicket.Component.beforeRender(Component.java:1027) > at org.apache.wicket.Component.prepareForRender(Component.java:2139) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. > java:698) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget > .java:605) > at > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ > estCycleProcessor.java:103) > at > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 > 2) > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > at > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application > FilterChain.java:186) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh > ain.java:157) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja > va:214) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja > va:178) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 > ) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 > ) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > :107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne > ction(Http11Protocol.java:731) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav > a:524) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo > rkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > a:684) > at java.lang.Thread.run(Thread.java:595) > # load() called=3 > java.lang.Exception > at load.Load$1.onDetach(Load.java:35) > at > org.apache.wicket.model.LoadableDetachableModel.detach(LoadableDetachableMod > el.java:102) > at > org.apache.wicket.model.CompoundPropertyModel.detach(CompoundPropertyModel.j > ava:107) > at org.apache.wicket.Component.detachModel(Component.java:3342) > at org.apache.wicket.Component.detachModels(Component.java:1142) > at org.apache.wicket.Component.detach(Component.java:1088) > at > org.apache.wicket.MarkupContainer.detachChildren(MarkupContainer.java:1454) > at org.apache.wicket.Component.detach(Component.java:1092) > at > org.apache.wicket.request.target.component.PageRequestTarget.detach(PageRequ > estTarget.java:80) > > > at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1046) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1334) > at org.apache.wicket.RequestCycle.re
RE: isVisible() with surrounding Markup and LoadableDetachableModel
Stack trace in load() and onDetach() java.lang.Exception at load.Load$1.load(Load.java:26) at org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachable Model.java:114) at org.apache.wicket.model.CompoundPropertyModel.getObject(CompoundPropertyMode l.java:60) at org.apache.wicket.model.AbstractPropertyModel.getTarget(AbstractPropertyMode l.java:187) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyMode l.java:110) at org.apache.wicket.Component.getModelObject(Component.java:1539) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1561) at load.Load$LoadForm$1.isVisible(Load.java:54) at org.apache.wicket.Component.internalBeforeRender(Component.java:990) at org.apache.wicket.Component.beforeRender(Component.java:1027) at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.jav a:1513) at org.apache.wicket.Component.onBeforeRender(Component.java:3657) at org.apache.wicket.Component.internalBeforeRender(Component.java:995) at org.apache.wicket.Component.beforeRender(Component.java:1027) at org.apache.wicket.Component.prepareForRender(Component.java:2139) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. java:698) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget .java:605) at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ estCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 2) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:731) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:524) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:595) # load() called=3 java.lang.Exception at load.Load$1.onDetach(Load.java:35) at org.apache.wicket.model.LoadableDetachableModel.detach(LoadableDetachableMod el.java:102) at org.apache.wicket.model.CompoundPropertyModel.detach(CompoundPropertyModel.j ava:107) at org.apache.wicket.Component.detachModel(Component.java:3342) at org.apache.wicket.Component.detachModels(Component.java:1142) at org.apache.wicket.Component.detach(Component.java:1088) at org.apache.wicket.MarkupContainer.detachChildren(MarkupContainer.java:1454) at org.apache.wicket.Component.detach(Component.java:1092) at org.apache.wicket.request.target.component.PageRequestTarget.detach(PageRequ estTarget.java:80) at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1046) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1334) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardContextValve.invoke(Standa
Re: isVisible() with surrounding Markup and LoadableDetachableModel
oh, and cut off all the catalina* frames please, they make it a bit too noisy for email reading -igor On Mon, Apr 21, 2008 at 8:58 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > ok, can you move newexception().printstacktrace() into load() itself, > also override ondetach() and put the same there with a call to > super.ondetach(). lets see where the model detaches... > > -igor > > > > > On Mon, Apr 21, 2008 at 8:50 PM, Warren <[EMAIL PROTECTED]> wrote: > > I created a one page app trying to isolate this problem. Here are the stack > > traces from new Exception().printStackTrace(). This is one Ajax request > from > > a AjaxFormSubmitBehavior("onkeypress"). The code for the class Load is at > > the bottom. > > > > java.lang.Exception > > at load.Load$LoadForm$1.isVisible(Load.java:46) > > at > org.apache.wicket.Component.internalBeforeRender(Component.java:990) > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > at > > > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.jav > > a:1513) > > at org.apache.wicket.Component.onBeforeRender(Component.java:3657) > > at > org.apache.wicket.Component.internalBeforeRender(Component.java:995) > > at org.apache.wicket.Component.beforeRender(Component.java:1027) > > at > org.apache.wicket.Component.prepareForRender(Component.java:2139) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. > > java:698) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget > > .java:605) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) > > at > > > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ > > estCycleProcessor.java:103) > > at > > > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 > > 2) > > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > > at > > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > > at > > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application > > FilterChain.java:186) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh > > ain.java:157) > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja > > va:214) > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja > > va:178) > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 > > ) > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 > > ) > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > > :107) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > > at > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) > > at > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne > > ction(Http11Protocol.java:731) > > at > > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav > > a:524) > > at > > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo > > rkerThread.java:80) > > at > > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > > a:684) > > at java.lang.Thread.run(Thread.java:595) > > > > > > # load() was first called here > > > > > > java.lang.Exception > > at load.Load$LoadForm$1.isVisible(Load.java:46) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget$3.component(AjaxRequestTarget.java: > > 937) > > at > > org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821) > > at > > org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondHeaderContribution(AjaxReque > > stTarget.java:933) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. > > java:701) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget > > .java:605) > > at > > > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) > > at > > > org.apache.wicket.request.AbstractReque
Re: isVisible() with surrounding Markup and LoadableDetachableModel
ok, can you move newexception().printstacktrace() into load() itself, also override ondetach() and put the same there with a call to super.ondetach(). lets see where the model detaches... -igor On Mon, Apr 21, 2008 at 8:50 PM, Warren <[EMAIL PROTECTED]> wrote: > I created a one page app trying to isolate this problem. Here are the stack > traces from new Exception().printStackTrace(). This is one Ajax request from > a AjaxFormSubmitBehavior("onkeypress"). The code for the class Load is at > the bottom. > > java.lang.Exception > at load.Load$LoadForm$1.isVisible(Load.java:46) > at > org.apache.wicket.Component.internalBeforeRender(Component.java:990) > at org.apache.wicket.Component.beforeRender(Component.java:1027) > at > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.jav > a:1513) > at org.apache.wicket.Component.onBeforeRender(Component.java:3657) > at > org.apache.wicket.Component.internalBeforeRender(Component.java:995) > at org.apache.wicket.Component.beforeRender(Component.java:1027) > at org.apache.wicket.Component.prepareForRender(Component.java:2139) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. > java:698) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget > .java:605) > at > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ > estCycleProcessor.java:103) > at > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 > 2) > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > at > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application > FilterChain.java:186) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh > ain.java:157) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja > va:214) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja > va:178) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 > ) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 > ) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > :107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne > ction(Http11Protocol.java:731) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav > a:524) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo > rkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > a:684) > at java.lang.Thread.run(Thread.java:595) > > > # load() was first called here > > > java.lang.Exception > at load.Load$LoadForm$1.isVisible(Load.java:46) > at > org.apache.wicket.ajax.AjaxRequestTarget$3.component(AjaxRequestTarget.java: > 937) > at > org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821) > at > org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondHeaderContribution(AjaxReque > stTarget.java:933) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. > java:701) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget > .java:605) > at > org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ > estCycleProcessor.java:103) > at > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 > 2) > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > at > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) > at >
RE: isVisible() with surrounding Markup and LoadableDetachableModel
I created a one page app trying to isolate this problem. Here are the stack traces from new Exception().printStackTrace(). This is one Ajax request from a AjaxFormSubmitBehavior("onkeypress"). The code for the class Load is at the bottom. java.lang.Exception at load.Load$LoadForm$1.isVisible(Load.java:46) at org.apache.wicket.Component.internalBeforeRender(Component.java:990) at org.apache.wicket.Component.beforeRender(Component.java:1027) at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.jav a:1513) at org.apache.wicket.Component.onBeforeRender(Component.java:3657) at org.apache.wicket.Component.internalBeforeRender(Component.java:995) at org.apache.wicket.Component.beforeRender(Component.java:1027) at org.apache.wicket.Component.prepareForRender(Component.java:2139) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. java:698) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget .java:605) at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ estCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 2) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:731) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:524) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:595) # load() was first called here java.lang.Exception at load.Load$LoadForm$1.isVisible(Load.java:46) at org.apache.wicket.ajax.AjaxRequestTarget$3.component(AjaxRequestTarget.java: 937) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861) at org.apache.wicket.ajax.AjaxRequestTarget.respondHeaderContribution(AjaxReque stTarget.java:933) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget. java:701) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget .java:605) at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequ estCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:117 2) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
Re: isVisible() with surrounding Markup and LoadableDetachableModel
are you sure it is the same request and there is no redirect in between? do new Exception().printStackTrace() inside your isvisible to see where it is being called from -igor On Mon, Apr 21, 2008 at 7:15 PM, Warren <[EMAIL PROTECTED]> wrote: > I did this in isVisible() and load was called twice. > > public boolean isVisible() > { > return !super.getModelObjectAsString().equals(""); > > > } > > > -Original Message- > > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 21, 2008 7:08 PM > > To: users@wicket.apache.org > > Subject: Re: isVisible() with surrounding Markup and > > LoadableDetachableModel > > > > > > loadable detachable model caches the value for the request, so even > > though getobject() is called multiple times, load() is only called > > once. > > > > -igor > > > > > > On Mon, Apr 21, 2008 at 6:59 PM, Warren > > <[EMAIL PROTECTED]> wrote: > > > I have a form that has a lot of labels with surrounding markup > > that needs to > > > be visible based on whether their is a value or empty string. > > The form uses > > > a CompoundPropertyModel based on a LoadableDetachableModel. > > How do I check > > > the model value of a Label in isVisible() without having load() of > > > LoadableDetachableModel being called twice. > > > > > > > > > > > > Dept: > > wicket:id="lineItem.item.department.departmentName">Supplements > > > > > > > > > > > > Label departmentName = new > > Label("lineItem.item.department.departmentName") > > > { > > > public boolean isVisible() > > > { > > > // How do I check value without load() being > > called again > > > } > > > }; > > > > > > > > > Thanks, > > > > > > Warren Bell > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Migration to new version 1.3.3
Hello, Finally I decided to migrate the project I have been working for the last year from 1.2.6 to 1.3.3 Wicket version. Some of the errors I got before are solved, like the AutoComplete field (which is great, by the way), but I have two issues that I have to solve or I will go back to 1.2.6 for continuing with the development (we are really in a rush and must go live this summer). The issues are: - The application is in more than 20 languages, so UTF8 is mandatory. This was working fine, people types their name in Japanese and that goes to database smoothly. Now, every "non-english" character gets corrupted. The database and tomcat server configuration has not been touch, and not the code except for the migration issues... - Suddenly I got stackoverflow exceptions all the time (I have never seen that with 1.2.6) I'm using spring-wicket application with ibatis and postgresql running in Tomcat 6 with JDK 1.6 I have been researching about both in the mailing lists, but I still can't figure out why this is happening to me... As always, thank you very very much for your time and support, Oskar -- View this message in context: http://www.nabble.com/Migration-to-new-version-1.3.3-tp16820098p16820098.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: isVisible() with surrounding Markup and LoadableDetachableModel
I did this in isVisible() and load was called twice. public boolean isVisible() { return !super.getModelObjectAsString().equals(""); } > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 7:08 PM > To: users@wicket.apache.org > Subject: Re: isVisible() with surrounding Markup and > LoadableDetachableModel > > > loadable detachable model caches the value for the request, so even > though getobject() is called multiple times, load() is only called > once. > > -igor > > > On Mon, Apr 21, 2008 at 6:59 PM, Warren > <[EMAIL PROTECTED]> wrote: > > I have a form that has a lot of labels with surrounding markup > that needs to > > be visible based on whether their is a value or empty string. > The form uses > > a CompoundPropertyModel based on a LoadableDetachableModel. > How do I check > > the model value of a Label in isVisible() without having load() of > > LoadableDetachableModel being called twice. > > > > > > > > Dept: > wicket:id="lineItem.item.department.departmentName">Supplements > > > > > > > > Label departmentName = new > Label("lineItem.item.department.departmentName") > > { > > public boolean isVisible() > > { > > // How do I check value without load() being > called again > > } > > }; > > > > > > Thanks, > > > > Warren Bell > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible() with surrounding Markup and LoadableDetachableModel
loadable detachable model caches the value for the request, so even though getobject() is called multiple times, load() is only called once. -igor On Mon, Apr 21, 2008 at 6:59 PM, Warren <[EMAIL PROTECTED]> wrote: > I have a form that has a lot of labels with surrounding markup that needs to > be visible based on whether their is a value or empty string. The form uses > a CompoundPropertyModel based on a LoadableDetachableModel. How do I check > the model value of a Label in isVisible() without having load() of > LoadableDetachableModel being called twice. > > > > Dept: wicket:id="lineItem.item.department.departmentName">Supplements > > > > Label departmentName = new Label("lineItem.item.department.departmentName") > { > public boolean isVisible() > { > // How do I check value without load() being called again > } > }; > > > Thanks, > > Warren Bell > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
isVisible() with surrounding Markup and LoadableDetachableModel
I have a form that has a lot of labels with surrounding markup that needs to be visible based on whether their is a value or empty string. The form uses a CompoundPropertyModel based on a LoadableDetachableModel. How do I check the model value of a Label in isVisible() without having load() of LoadableDetachableModel being called twice. Dept: Supplements Label departmentName = new Label("lineItem.item.department.departmentName") { public boolean isVisible() { // How do I check value without load() being called again } }; Thanks, Warren Bell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: interesting scriptaculous usage conundrum
On Mon, Apr 21, 2008 at 02:11:01PM -0700, Doug Donohoe wrote: > > Hi John, > > Thanks for the suggestion, but that did not work. I suspect it didn't work > for the same reason that my attempt to use setEnabled(true/false) on the > AttributeModifier didn't work. > > It has to be with how wicket cache's pages. I still don't quite grok how it > decides to re-render stuff... > > My code: > > public CurrentProfile(String id) > { > > > displayModel = new DisplayModel(); > loginPanel.add(new AttributeModifier("style", true, displayModel)); > > > > Link link = new AjaxFallbackLink("loginLink", new Model(loginText)) > { > @Override > public void onClick(final AjaxRequestTarget target) > { > loginPanel.setVisible(!loginPanel.isVisible()); I suspect your problem is in that last line. Once you've rendered a page with an element that's invisible, you can't make it visible again via AJAX unless you originally called setOutputMarkupPlaceholderTag(true) on it, or you refresh a parent element that was always visible. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UploadProgressBar overrides the form's onsubmit script
add a feature request into jira -igor On Mon, Apr 21, 2008 at 6:00 PM, achu18 <[EMAIL PROTECTED]> wrote: > > hi all, > > I would like to hide a div when i submit my form. The script is provided by > the Form.onComponentTag() method. all works well, till i use the > uploadprogressbar. Noticed that the progress bar adds some js to the form in > the html as > >enctype="multipart/form-data" > action="?wicket:interface=:0:ajax-simpleUpload::IFormSubmitListener::"> > > which overrides the script provided by my Form.onComponentTag(). any > suggestions on retaining my js? > > Cheers > > > -- > View this message in context: > http://www.nabble.com/UploadProgressBar-overrides-the-form%27s-onsubmit-script-tp16819670p16819670.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dropdown list onselectionchanged sending to a new page
pasting the stacktrace usually helps us figure out what is wrong... -igor On Mon, Apr 21, 2008 at 5:57 PM, Ritz123 <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a usage scenario where I need to send users to a different page when > they select an item from the dropdownchoice. I tried > wantOnSelectionChangedNotifications returning true and overriding > onselectionchanged(newobject) with setResponsePage(Page.class, > PageParameters) but got an error about incorrect model setting (or so, dont > remember the exact error). > > Is there an example somewhere which shows how to send the user to a > different page based on the selection? Also is it possible to achieve this > behavior without embedding dropdownlist in the form? as I have only 1 > element - which is this drop down element and seems like wasteful thing to > do creating a form just for 1 element. > -- > View this message in context: > http://www.nabble.com/Dropdown-list-onselectionchanged-sending-to-a-new-page-tp16819667p16819667.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Panel problem
panels dont wrap, they replace. if you want to wrap something use a Border -igor On Mon, Apr 21, 2008 at 5:22 PM, neo anderson <[EMAIL PROTECTED]> wrote: > > Does it mean that one can insert a panel between two tags? But if I have > already defined a panel (e.g., accordion menu) Then wrapping the orginal > panel (accordion menu) directly by a new one (menu) is disallowed? Because > I found out if I have a panel (Menu) at the top level, which contains the > Accordion Menu (also extends panel), then the Markup Exception thrown. > However, if changing the Menu to extends WebMarkupContainer, then the web > page (after loaded to the web caontainer) would go blank. > > The purpose of wrapping accordion menu by another panel is because I want to > divide the web page into several sections, including content, menu, banner, > etc. What is the better way to achieve it? > > Thank you very much. > > Thanks your reply. > > > > igor.vaynberg wrote: > > > > a panel can contain any other panel, but it has to be attached to > > empty tags since the whole point of the panel is to inject what goes > > between the tags. > > > > -igor > > > > > > On Sun, Apr 20, 2008 at 4:09 PM, neo anderson > > <[EMAIL PROTECTED]> wrote: > >> > >> Does this mean the Panel class itsself can not contain another Panel > >> component inside its own class? > >> For instance, > >> > >> A.html > >> > >> > >> > >> > >> A.class > >> > >> public class A extends Panel{ > >> public A(String id){ > >> super(id); > >> ... > >> AccordionPanel panel = new AccordionMenu("accordionMenu"); // > >> extends another panel > >> ... > >> } > >> } > >> > >> I encounter the same problem. Then I solve it by extending > >> WebMarkupContainer instead of Panel directly (i.e., class A exnteds > >> WebMarkupCintainer); as below: > >> > >> A.html > >> > >> > >> > >> > >> public class A extends WebMarkupContainer{ > >> public A(String id){ > >> super(id); > >> ... > >> AccordionPanel panel = new AccordionMenu("accordionMenu"); // > >> extends another panel > >> ... > >> } > >> } > >> > >> > >> > >> > >> However, I do not understand the reason why it has to do so. Hope > >> someone > >> can give me more detail explanation or point me where there has such > >> explain > >> because the java doc Panel > >> > >> > (http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/panel/Panel.html) > >> seemingly does not explain this. > >> > >> Thanks for help. > >> > >> > >> > >> > >> Timo Rantalaiho wrote: > >> > > >> > On Tue, 25 Mar 2008, Ryan O'Hara wrote: > >> >> WicketMessage: Markup of type 'html' for component > >> >> 'org.apache.wicket.markup.html.panel.Panel' not found. Enable debug > >> >> messages for org.apache.wicket.util.resource to get a list of all > >> >> filenames tried: > >> >> [MarkupContainer [Component id = hoverMenu, page = > >> >> edu.chop.bic.cnv.ui.Login, path = > >> >> 0:loginTabbedHeader:hoverMenu.Panel, isVisible = true, isVersioned = > >> >> true]] > >> > ... > >> >> public TabbedHeader(String panelId){ > >> >> super(panelId); > >> >> add(new Panel("hoverMenu")); > >> >> Link link = new Link("loginLink") { > >> >> public void onClick(){ > >> >> setResponsePage(Login.class); > >> >> } > >> >> }; > >> >> add(link); > >> >> link.add(new Label("login", "Login")); > >> >> } > >> > > >> > Put add(new WebMarkupContainer("hoverMenu")); instead of > >> > Panel. > >> > > >> > ...or better yet remove the whole hoverMenu component if it > >> > contains nothing? Or are you going to replace it with > >> > something with content? > >> > > >> > Best wishes, > >> > Timo > >> > > >> > -- > >> > Timo Rantalaiho > >> > Reaktor Innovations Oyhttp://www.ri.fi/ > > >> > > >> > - > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Panel-problem-tp16289023p16800071.html > >> Sent from the Wicket - User mailing list archive at Nabble.com. > >> > >> > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/Panel-problem-tp16289023p16819061.html >
Re: PropertyModel of textfield not being updated
you need to show us the code -igor On Mon, Apr 21, 2008 at 4:50 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Thanks for trying to help, but no, there's no LDM involved here. I > actually refactored the entire class and simplified things a bit. > However, the problem is still occurring, not sure what's going on... > > > > -Original Message- > From: Jeremy Thomerson [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 4:44 PM > To: users@wicket.apache.org; users@wicket.apache.org > Subject: RE: PropertyModel of textfield not being updated > > Yes - it may be that eventSchedule isn't initialized at the time you > create the PropertyModel, or that it's getting swapped out later, or > similar. If it is, then this will make it always read the latest > eventSchedule from your parent object, even if something else swapped it > out. > > I haven't read the whole thread, but is it possible that you have a > loadable detachable model that is swapping in a new object into your > form model on each request? That would cause the situation I described > above where your PropertyModel was initialized with one eventSchedule, > and the form is using another one on your next request. > > Jeremy Thomerson > -- sent from a wireless device > > -Original Message- > From: "Michael Mehrle" <[EMAIL PROTECTED]> > To: users@wicket.apache.org > Sent: 4/21/08 5:58 PM > Subject: RE: PropertyModel of textfield not being updated > > Sounds like a clever shortcut, but does it offer any benefit? > > Michael > > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 3:15 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > new PropertyModel(eventSchedule,"foo") > > where is eventschedule referenced, how is it loaded? > > i would make that a property of the page and do it like this: > > new PropertyModel(this, "eventSchedule.foo") > > -igor > > > On Mon, Apr 21, 2008 at 12:07 PM, Michael Mehrle > <[EMAIL PROTECTED]> wrote: > > I got a textfield: > > > > > > > > add(fooTextField = new TextField("foo", new > PropertyModel(eventSchedule, > > "foo"), Integer.class)); > > > > > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > > > > > For some reason it's never being updated, although the field picks it > up > > when I programmatically call eventSchedule.setFoo(). > > > > > > > > I'm using this with AJAX and have all my component ids set and the > > textfield added to the target. > > > > > > > > Any ideas? > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bookmarkable RSS feed with parameter using wicketstuff-rome
I'd need to see code to give actual suggestions, but i can tell you that the current API has worked great for all of my applications (bookmarkable urls and such). I'm also very open to suggestions if there are ways to improve it. The wicket Resource API is a bit confusing and probably could use some more explaining. specifically regarding how they work with resource references... On 4/21/08, Zach Cox <[EMAIL PROTECTED]> wrote: > > > Hi Ryan - that all worked great until I needed to create a link to the > feed > from my WebPage. That page has pagination so once I click off the 1st > page > I lose the ID in the URL so the getParameters().getLong("id"); line starts > failing. Although I'm not sure why using ResourceLink causes the SyndFeed > to be created... > > My solution to this whole problem involved these classes: > - MyFeedResource extends FeedResource and creates the SyndFeed using a > particular ID that gets passed in to the constructor > - MyFeedRequestTarget extends ResourceStreamRequestTarget and creates a > new > MyFeedResource using a particular ID, passing its IResourceStream to the > super constructor > - MyFeedRequestTargetUrlCodingStrategy gets mounted at a nice URL and > handles encoding & decoding a MyFeedRequestTarget and a particular ID > - MyFeedLink extends Link and creates a link to the feed for a > particular > ID (much like BookmarkablePageLink) > - MyFeedHeaderContributor extends HeaderContributor and creates the > auto-discovery link of the feed for a particular ID that goes in the > > section > > What I thought was going to be straightforward blew up into five separate > classes just to get feeds that take a parameter, can be accessed at nice > URLs, and always work in feed readers. Can you see any way I can simplify > this? > > I totally love Wicket and don't want to hate on it, it's made me orders of > magnitude more productive than any other framework has, but every time I > have to use the Resource API I want to put my head through a brick wall. > That is definitely an area that could use some simplification & refinement > in a future release. > > Thanks, > Zach > > > > > > Ryan Sonnek-2 wrote: > > > > see responses inline: > > > > On Mon, Apr 21, 2008 at 1:07 PM, Zach Cox <[EMAIL PROTECTED]> wrote: > > > >> I would like to have URLs for this feed something like this: > >> > >> http://site.com/feed/1234 > >> > >> > > This should be possible by mounting the feed resource with a "nice" url > > from > > within your WebApplication class: > > > > public class MyApplication extends WebApplication { > > public void init() { > > mountSharedResource("/view/rss", new ResourceReference("myFeed") { > > protected FeedResource newResource() { > > return new MyFeedResource(); > > } > > }.getSharedResourceKey()); > > } > > } > > > > > > > > > > > > > > > > > >> That way users can add that URL to their feed readers and always get > >> the latest info for object 1234. All of the wicketstuff-rome examples > >> I've seen seem to create the FeedResource instance once and then make > >> it a shared resource. I'm currently doing that but the feeds seem to > >> disappear and cannot be read in a feed reader after some time. > > > > > > This would be a question for the wicket folks and not a wicketstuff-rome > > issue. Is there any known limitation for feed resources? > > > > > > > >> Since wicketstuff-rome provides a Resource subclass (FeedResource) and > >> not a WebPage subclass I'm confused as to how to do the following: > >> - get bookmarkable URLs with a parameter for the feed > > > > > > You can grab request params by using the getParameters() method within > > your > > FeedResource > > > > public class MyFeedResource extends FeedResource { > > > > protected SyndFeed getFeed() { > > Long id = getParameters().getLong("id"); > > } > > > > } > > > > > > - have a new FeedResource created & returned when user accesses that > URL > > > > > > need to ask the wicket folks why this isn't happening... > > > > > > > -- > View this message in context: > http://www.nabble.com/Bookmarkable-RSS-feed-with-parameter-using-wicketstuff-rome-tp16816318p16819657.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
UploadProgressBar overrides the form's onsubmit script
hi all, I would like to hide a div when i submit my form. The script is provided by the Form.onComponentTag() method. all works well, till i use the uploadprogressbar. Noticed that the progress bar adds some js to the form in the html as which overrides the script provided by my Form.onComponentTag(). any suggestions on retaining my js? Cheers -- View this message in context: http://www.nabble.com/UploadProgressBar-overrides-the-form%27s-onsubmit-script-tp16819670p16819670.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dropdown list onselectionchanged sending to a new page
Hi, I have a usage scenario where I need to send users to a different page when they select an item from the dropdownchoice. I tried wantOnSelectionChangedNotifications returning true and overriding onselectionchanged(newobject) with setResponsePage(Page.class, PageParameters) but got an error about incorrect model setting (or so, dont remember the exact error). Is there an example somewhere which shows how to send the user to a different page based on the selection? Also is it possible to achieve this behavior without embedding dropdownlist in the form? as I have only 1 element - which is this drop down element and seems like wasteful thing to do creating a form just for 1 element. -- View this message in context: http://www.nabble.com/Dropdown-list-onselectionchanged-sending-to-a-new-page-tp16819667p16819667.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bookmarkable RSS feed with parameter using wicketstuff-rome
Hi Ryan - that all worked great until I needed to create a link to the feed from my WebPage. That page has pagination so once I click off the 1st page I lose the ID in the URL so the getParameters().getLong("id"); line starts failing. Although I'm not sure why using ResourceLink causes the SyndFeed to be created... My solution to this whole problem involved these classes: - MyFeedResource extends FeedResource and creates the SyndFeed using a particular ID that gets passed in to the constructor - MyFeedRequestTarget extends ResourceStreamRequestTarget and creates a new MyFeedResource using a particular ID, passing its IResourceStream to the super constructor - MyFeedRequestTargetUrlCodingStrategy gets mounted at a nice URL and handles encoding & decoding a MyFeedRequestTarget and a particular ID - MyFeedLink extends Link and creates a link to the feed for a particular ID (much like BookmarkablePageLink) - MyFeedHeaderContributor extends HeaderContributor and creates the auto-discovery link of the feed for a particular ID that goes in the section What I thought was going to be straightforward blew up into five separate classes just to get feeds that take a parameter, can be accessed at nice URLs, and always work in feed readers. Can you see any way I can simplify this? I totally love Wicket and don't want to hate on it, it's made me orders of magnitude more productive than any other framework has, but every time I have to use the Resource API I want to put my head through a brick wall. That is definitely an area that could use some simplification & refinement in a future release. Thanks, Zach Ryan Sonnek-2 wrote: > > see responses inline: > > On Mon, Apr 21, 2008 at 1:07 PM, Zach Cox <[EMAIL PROTECTED]> wrote: > >> I would like to have URLs for this feed something like this: >> >> http://site.com/feed/1234 >> >> > This should be possible by mounting the feed resource with a "nice" url > from > within your WebApplication class: > > public class MyApplication extends WebApplication { > public void init() { > mountSharedResource("/view/rss", new ResourceReference("myFeed") { > protected FeedResource newResource() { > return new MyFeedResource(); > } > }.getSharedResourceKey()); > } > } > > > > > > > > >> That way users can add that URL to their feed readers and always get >> the latest info for object 1234. All of the wicketstuff-rome examples >> I've seen seem to create the FeedResource instance once and then make >> it a shared resource. I'm currently doing that but the feeds seem to >> disappear and cannot be read in a feed reader after some time. > > > This would be a question for the wicket folks and not a wicketstuff-rome > issue. Is there any known limitation for feed resources? > > > >> Since wicketstuff-rome provides a Resource subclass (FeedResource) and >> not a WebPage subclass I'm confused as to how to do the following: >> - get bookmarkable URLs with a parameter for the feed > > > You can grab request params by using the getParameters() method within > your > FeedResource > > public class MyFeedResource extends FeedResource { > > protected SyndFeed getFeed() { > Long id = getParameters().getLong("id"); > } > > } > > > - have a new FeedResource created & returned when user accesses that URL > > > need to ask the wicket folks why this isn't happening... > > -- View this message in context: http://www.nabble.com/Bookmarkable-RSS-feed-with-parameter-using-wicketstuff-rome-tp16816318p16819657.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Panel problem
Does it mean that one can insert a panel between two tags? But if I have already defined a panel (e.g., accordion menu) Then wrapping the orginal panel (accordion menu) directly by a new one (menu) is disallowed? Because I found out if I have a panel (Menu) at the top level, which contains the Accordion Menu (also extends panel), then the Markup Exception thrown. However, if changing the Menu to extends WebMarkupContainer, then the web page (after loaded to the web caontainer) would go blank. The purpose of wrapping accordion menu by another panel is because I want to divide the web page into several sections, including content, menu, banner, etc. What is the better way to achieve it? Thank you very much. Thanks your reply. igor.vaynberg wrote: > > a panel can contain any other panel, but it has to be attached to > empty tags since the whole point of the panel is to inject what goes > between the tags. > > -igor > > > On Sun, Apr 20, 2008 at 4:09 PM, neo anderson > <[EMAIL PROTECTED]> wrote: >> >> Does this mean the Panel class itsself can not contain another Panel >> component inside its own class? >> For instance, >> >> A.html >> >> >> >> >> A.class >> >> public class A extends Panel{ >> public A(String id){ >> super(id); >> ... >> AccordionPanel panel = new AccordionMenu("accordionMenu"); // >> extends another panel >> ... >> } >> } >> >> I encounter the same problem. Then I solve it by extending >> WebMarkupContainer instead of Panel directly (i.e., class A exnteds >> WebMarkupCintainer); as below: >> >> A.html >> >> >> >> >> public class A extends WebMarkupContainer{ >> public A(String id){ >> super(id); >> ... >> AccordionPanel panel = new AccordionMenu("accordionMenu"); // >> extends another panel >> ... >> } >> } >> >> >> >> >> However, I do not understand the reason why it has to do so. Hope >> someone >> can give me more detail explanation or point me where there has such >> explain >> because the java doc Panel >> >> (http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/panel/Panel.html) >> seemingly does not explain this. >> >> Thanks for help. >> >> >> >> >> Timo Rantalaiho wrote: >> > >> > On Tue, 25 Mar 2008, Ryan O'Hara wrote: >> >> WicketMessage: Markup of type 'html' for component >> >> 'org.apache.wicket.markup.html.panel.Panel' not found. Enable debug >> >> messages for org.apache.wicket.util.resource to get a list of all >> >> filenames tried: >> >> [MarkupContainer [Component id = hoverMenu, page = >> >> edu.chop.bic.cnv.ui.Login, path = >> >> 0:loginTabbedHeader:hoverMenu.Panel, isVisible = true, isVersioned = >> >> true]] >> > ... >> >> public TabbedHeader(String panelId){ >> >> super(panelId); >> >> add(new Panel("hoverMenu")); >> >> Link link = new Link("loginLink") { >> >> public void onClick(){ >> >> setResponsePage(Login.class); >> >> } >> >> }; >> >> add(link); >> >> link.add(new Label("login", "Login")); >> >> } >> > >> > Put add(new WebMarkupContainer("hoverMenu")); instead of >> > Panel. >> > >> > ...or better yet remove the whole hoverMenu component if it >> > contains nothing? Or are you going to replace it with >> > something with content? >> > >> > Best wishes, >> > Timo >> > >> > -- >> > Timo Rantalaiho >> > Reaktor Innovations Oyhttp://www.ri.fi/ > >> > >> > - >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Panel-problem-tp16289023p16800071.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Panel-problem-tp16289023p16819061.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: If logic in wicket seems complicated
Doug, Take a look at Component's setRenderBodyOnly method if you sometimes need to render a link as plain text based on some condition (thanks Nilklas). This combined with Igor's tip could be one possible solution to the requirements you have mentioned, so far. On the http://jweekend.com/dev/LWUGReg/ London Wicket Event registration page we use something like this to show registrants' names as links only if they have entered a URL. Regards - Cemal http://jWeekend.co.uk http://jWeekend.co.uk Doug Donohoe wrote: > > Thanks igor for the suggestion. > > It's not quite that simple. If it is a valid alias, I actually want it to > be a link (with a label inside). So it isn't quite equivalent. > > I'll checkout fragments too! > > -Doug > > > igor.vaynberg wrote: >> >> right, use fragments for these small inline chunks, also because your >> usecase is so simple: just a string, you can simply do >> >> class aliasesmodel extends ldm { >> object load() { >> list aliases=getaliases(); >> if (aliases.isempty()) { aliases.add(new alias("none")); } >> } >> } >> >> then there is no need to toggle the none fragment to show up >> >> -igor >> >> >> On Mon, Apr 21, 2008 at 11:33 AM, Enrique Rodriguez <[EMAIL PROTECTED]> >> wrote: >>> On Mon, Apr 21, 2008 at 11:27 AM, Doug Donohoe <[EMAIL PROTECTED]> >>> wrote: >>> > ... >>> >>> > I may be having a mental block, but I'm finding it tedious to >>> implement 'if' >>> > behavior in Wicket. >>> >>> I use Wicket Fragments all over the place for this sort of thing. >>> >>> http://wicket.apache.org/examplefragments.html >>> >>> Enrique >>> >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/If-logic-in-wicket-seems-complicated-tp16808507p16819060.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: If logic in wicket seems complicated
Thanks igor for the suggestion. It's not quite that simple. If it is a valid alias, I actually want it to be a link (with a label inside). So it isn't quite equivalent. I'll checkout fragments too! -Doug igor.vaynberg wrote: > > right, use fragments for these small inline chunks, also because your > usecase is so simple: just a string, you can simply do > > class aliasesmodel extends ldm { > object load() { > list aliases=getaliases(); > if (aliases.isempty()) { aliases.add(new alias("none")); } > } > } > > then there is no need to toggle the none fragment to show up > > -igor > > > On Mon, Apr 21, 2008 at 11:33 AM, Enrique Rodriguez <[EMAIL PROTECTED]> > wrote: >> On Mon, Apr 21, 2008 at 11:27 AM, Doug Donohoe <[EMAIL PROTECTED]> wrote: >> > ... >> >> > I may be having a mental block, but I'm finding it tedious to implement >> 'if' >> > behavior in Wicket. >> >> I use Wicket Fragments all over the place for this sort of thing. >> >> http://wicket.apache.org/examplefragments.html >> >> Enrique >> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/If-logic-in-wicket-seems-complicated-tp16808507p16818460.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PropertyModel of textfield not being updated
Thanks for trying to help, but no, there's no LDM involved here. I actually refactored the entire class and simplified things a bit. However, the problem is still occurring, not sure what's going on... -Original Message- From: Jeremy Thomerson [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 4:44 PM To: users@wicket.apache.org; users@wicket.apache.org Subject: RE: PropertyModel of textfield not being updated Yes - it may be that eventSchedule isn't initialized at the time you create the PropertyModel, or that it's getting swapped out later, or similar. If it is, then this will make it always read the latest eventSchedule from your parent object, even if something else swapped it out. I haven't read the whole thread, but is it possible that you have a loadable detachable model that is swapping in a new object into your form model on each request? That would cause the situation I described above where your PropertyModel was initialized with one eventSchedule, and the form is using another one on your next request. Jeremy Thomerson -- sent from a wireless device -Original Message- From: "Michael Mehrle" <[EMAIL PROTECTED]> To: users@wicket.apache.org Sent: 4/21/08 5:58 PM Subject: RE: PropertyModel of textfield not being updated Sounds like a clever shortcut, but does it offer any benefit? Michael -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 3:15 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated new PropertyModel(eventSchedule,"foo") where is eventschedule referenced, how is it loaded? i would make that a property of the page and do it like this: new PropertyModel(this, "eventSchedule.foo") -igor On Mon, Apr 21, 2008 at 12:07 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I got a textfield: > > > > add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, > "foo"), Integer.class)); > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > For some reason it's never being updated, although the field picks it up > when I programmatically call eventSchedule.setFoo(). > > > > I'm using this with AJAX and have all my component ids set and the > textfield added to the target. > > > > Any ideas? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Strange AJAX error
I have attached a screen grab of the error and its context since the modal is locking up and I can't just copy/paste it. Sorry it's so dark, that's because of the modal and I don't have Photoshop on this system. Michael -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 4:38 PM To: users@wicket.apache.org Subject: Strange AJAX error This is in the context of my prior postings. When submitting my form which is part of a modal it just freezes up and I get the following error message in the AJAX debug window: ERROR: Exception evaluating javascript: TypeError: window.parent.setTimeout is not a function Anyone any idea what's going on here? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PropertyModel of textfield not being updated
Yes - it may be that eventSchedule isn't initialized at the time you create the PropertyModel, or that it's getting swapped out later, or similar. If it is, then this will make it always read the latest eventSchedule from your parent object, even if something else swapped it out. I haven't read the whole thread, but is it possible that you have a loadable detachable model that is swapping in a new object into your form model on each request? That would cause the situation I described above where your PropertyModel was initialized with one eventSchedule, and the form is using another one on your next request. Jeremy Thomerson -- sent from a wireless device -Original Message- From: "Michael Mehrle" <[EMAIL PROTECTED]> To: users@wicket.apache.org Sent: 4/21/08 5:58 PM Subject: RE: PropertyModel of textfield not being updated Sounds like a clever shortcut, but does it offer any benefit? Michael -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 3:15 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated new PropertyModel(eventSchedule,"foo") where is eventschedule referenced, how is it loaded? i would make that a property of the page and do it like this: new PropertyModel(this, "eventSchedule.foo") -igor On Mon, Apr 21, 2008 at 12:07 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I got a textfield: > > > > add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, > "foo"), Integer.class)); > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > For some reason it's never being updated, although the field picks it up > when I programmatically call eventSchedule.setFoo(). > > > > I'm using this with AJAX and have all my component ids set and the > textfield added to the target. > > > > Any ideas? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Strange AJAX error
This is in the context of my prior postings. When submitting my form which is part of a modal it just freezes up and I get the following error message in the AJAX debug window: ERROR: Exception evaluating javascript: TypeError: window.parent.setTimeout is not a function Anyone any idea what's going on here? Michael
RE: PropertyModel of textfield not being updated
Sounds like a clever shortcut, but does it offer any benefit? Michael -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 3:15 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated new PropertyModel(eventSchedule,"foo") where is eventschedule referenced, how is it loaded? i would make that a property of the page and do it like this: new PropertyModel(this, "eventSchedule.foo") -igor On Mon, Apr 21, 2008 at 12:07 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I got a textfield: > > > > add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, > "foo"), Integer.class)); > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > For some reason it's never being updated, although the field picks it up > when I programmatically call eventSchedule.setFoo(). > > > > I'm using this with AJAX and have all my component ids set and the > textfield added to the target. > > > > Any ideas? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PropertyModel of textfield not being updated
Thanks for all the input. - Yes, I did override wantOnSelectionChangedNotifications() and it's set to false - No other Ajax is being fired - if I cancel the modal it closes. Once I press the submit button I can't even cancel the modal anymore as it just completely locks up. Strange stuff happening, can't figure this one out. Michael -Original Message- From: Edvin Syse [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 2:30 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated > Strange, because it worked with updating the value of a radio that's > tied to a model in that same bean. Are you sure you didn't override wantOnSelectionChangedNotifications() and that the new value you saw came from the onSelectionChanged() method or something? Or maybe you got the value from the component's getInput() method? > I tried the AjaxFormSubmitBehavior but am getting the following AJAX > error: > > Channel busy - postponing If you look in the AJAX debug window, I think you should be able to see what other ajax-event fired and didn't return yet. Maybe that can give you a hint. Also, I see that you do: fooTextField.setOutputMarkupId(true); target.addComponent(fooTextField); in your onClose() method. The setOutputMarkupId(true) is redundant - as it has to have been set already some other place in your code, or there will be no way for Wicket to know what component to rerender in the markup, and you would have gotten an error. I mention it, because I think you might have misunderstood some parts of the process. -- Edvin > > This was the same error I was getting when using the AjaxButton's > default onSubmit() method. This is why I am using AjaxEventBehavior, > which seems to be the only one that actually triggers the event. Is > there another way to submit my form? > > So, I'm a bit in a bind here - btw, this happens both in Safari and > Firefox. > > Michael > > -Original Message- > From: Maurice Marrink [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 1:10 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > But if you don't send the new values using this button then how is > wicket supposed to know there is a new value? > > Try using an AjaxFormSubmitBehavior instead of AjaxEventBehavior, it > will submit the form for you. > > Maurice > > On Mon, Apr 21, 2008 at 9:58 PM, Michael Mehrle <[EMAIL PROTECTED]> > wrote: >> Edvin - this is the save button's behavior. I'm using that instead of >> 'onSubmit()' because I needed to throttle the AJAX calls down a bit. >> Does that make sense? The entire form is way too long and complex to >> post it here. >> >> >> Michael >> >> >> -Original Message- >> From: Edvin Syse [mailto:[EMAIL PROTECTED] >> >> >> Sent: Monday, April 21, 2008 12:43 PM >> To: users@wicket.apache.org >> Subject: Re: PropertyModel of textfield not being updated >> >> I don't see you post anything here that would indicate that you're >> updating the model with data from the view.. >> >> What about saveButton and the form, can you supply that code as well? >> >> -- Edvin >> >> Michael Mehrle skrev: >> > Sure: >> > >> > saveButton.add(ajaxSaveBehavior = new >> > AjaxEventBehavior(JavaScriptUtil.CLICK) { >> > @Override >> > protected void onEvent(AjaxRequestTarget target) { >> > >> > modalWindow.setWindowClosedCallback(new >> > ModalWindow.WindowClosedCallback() { >> > public void >> > onClose(AjaxRequestTarget target) { >> > ... >> > >> > fooTextField.setOutputMarkupId(true); >> > >> > target.addComponent(fooTextField); >> > >> > modalWindow.close(target); >> > } >> > }); >> > >> > When I step in there with my debugger it seems that the frequency >> field >> > in eventSchedule (which is the texfield's bean), still is set to > the >> > default value. Meaning, the textfield doesn't receive the input. >> > >> > When I just add 'eventSchedule.setFrequency(10)' for instance - the > 10 >> > does show up when I pop up the modal again. So, the link between > the >> > model and the textfield is clearly working, but the model is not > being >> > updated when typing into the textfield. >> > >> > Michael >> > >> > -Original Message- >> > From: Edvin Syse [mailto:[EMAIL PROTECTED] >> > Sent: Monday, April 21, 2008 12:14 PM >> > To: users@wicket.apache.org >> > Subject: Re: PropertyModel of textfield not being updated >> > >> > What exactly are you doing via Ajax? Can you show some code? :) >> > >> > -- Edvin >> > >> > Michael Mehrle skrev: >> >> I got a textfield: >> >> >> >> >> >> >> >> add(fooTextField = new TextField("foo", new >> > PropertyModel(eventSchedule, >> >> "foo"), Integer.class)); >> >> >> >> >> >> >> >> eventSched
Re: PropertyModel of textfield not being updated
new PropertyModel(eventSchedule,"foo") where is eventschedule referenced, how is it loaded? i would make that a property of the page and do it like this: new PropertyModel(this, "eventSchedule.foo") -igor On Mon, Apr 21, 2008 at 12:07 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I got a textfield: > > > > add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, > "foo"), Integer.class)); > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > For some reason it's never being updated, although the field picks it up > when I programmatically call eventSchedule.setFoo(). > > > > I'm using this with AJAX and have all my component ids set and the > textfield added to the target. > > > > Any ideas? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-minis release?
anyone with access to svn -igor On Mon, Apr 21, 2008 at 1:43 PM, Hoover, William <[EMAIL PROTECTED]> wrote: > Who can perform the release? > > > > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 1:45 PM > To: users@wicket.apache.org > Subject: Re: wicket-minis release? > > > minis doesnt have a project lead. it is meant as a community > repository for small reusable things. if there is a need for a release > someone can do it. > > -igor > > > On Mon, Apr 21, 2008 at 6:25 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > I think Igor is officially project lead for the mini's but i doubt he > > is planning a release anytime soon. > > Not that there are that many bugs open, it's just a matter of demand :) > > > > Maurice > > > > > > > > On Mon, Apr 21, 2008 at 2:45 PM, Hoover, William <[EMAIL PROTECTED]> > wrote: > > > Does anyone know how close we are to a release of wicket-minis? > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/ > shows 1.3.0-SNAPSHOT. > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PropertyModel of textfield not being updated
Strange, because it worked with updating the value of a radio that's tied to a model in that same bean. Are you sure you didn't override wantOnSelectionChangedNotifications() and that the new value you saw came from the onSelectionChanged() method or something? Or maybe you got the value from the component's getInput() method? I tried the AjaxFormSubmitBehavior but am getting the following AJAX error: Channel busy - postponing If you look in the AJAX debug window, I think you should be able to see what other ajax-event fired and didn't return yet. Maybe that can give you a hint. Also, I see that you do: fooTextField.setOutputMarkupId(true); target.addComponent(fooTextField); in your onClose() method. The setOutputMarkupId(true) is redundant - as it has to have been set already some other place in your code, or there will be no way for Wicket to know what component to rerender in the markup, and you would have gotten an error. I mention it, because I think you might have misunderstood some parts of the process. -- Edvin This was the same error I was getting when using the AjaxButton's default onSubmit() method. This is why I am using AjaxEventBehavior, which seems to be the only one that actually triggers the event. Is there another way to submit my form? So, I'm a bit in a bind here - btw, this happens both in Safari and Firefox. Michael -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 1:10 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated But if you don't send the new values using this button then how is wicket supposed to know there is a new value? Try using an AjaxFormSubmitBehavior instead of AjaxEventBehavior, it will submit the form for you. Maurice On Mon, Apr 21, 2008 at 9:58 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: Edvin - this is the save button's behavior. I'm using that instead of 'onSubmit()' because I needed to throttle the AJAX calls down a bit. Does that make sense? The entire form is way too long and complex to post it here. Michael -Original Message- From: Edvin Syse [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 12:43 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated I don't see you post anything here that would indicate that you're updating the model with data from the view.. What about saveButton and the form, can you supply that code as well? -- Edvin Michael Mehrle skrev: > Sure: > > saveButton.add(ajaxSaveBehavior = new > AjaxEventBehavior(JavaScriptUtil.CLICK) { > @Override > protected void onEvent(AjaxRequestTarget target) { > > modalWindow.setWindowClosedCallback(new > ModalWindow.WindowClosedCallback() { > public void > onClose(AjaxRequestTarget target) { > ... > > fooTextField.setOutputMarkupId(true); > > target.addComponent(fooTextField); > > modalWindow.close(target); > } > }); > > When I step in there with my debugger it seems that the frequency field > in eventSchedule (which is the texfield's bean), still is set to the > default value. Meaning, the textfield doesn't receive the input. > > When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 > does show up when I pop up the modal again. So, the link between the > model and the textfield is clearly working, but the model is not being > updated when typing into the textfield. > > Michael > > -Original Message- > From: Edvin Syse [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 12:14 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > What exactly are you doing via Ajax? Can you show some code? :) > > -- Edvin > > Michael Mehrle skrev: >> I got a textfield: >> >> >> >> add(fooTextField = new TextField("foo", new > PropertyModel(eventSchedule, >> "foo"), Integer.class)); >> >> >> >> eventSchedule is a bean that has a foo field which is an integer. >> >> >> >> For some reason it's never being updated, although the field picks it > up >> when I programmatically call eventSchedule.setFoo(). >> >> >> >> I'm using this with AJAX and have all my component ids set and the >> textfield added to the target. >> >> >> >> Any ideas? >> >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-m
Re: interesting scriptaculous usage conundrum
Hi John, Thanks for the suggestion, but that did not work. I suspect it didn't work for the same reason that my attempt to use setEnabled(true/false) on the AttributeModifier didn't work. It has to be with how wicket cache's pages. I still don't quite grok how it decides to re-render stuff... My code: public CurrentProfile(String id) { displayModel = new DisplayModel(); loginPanel.add(new AttributeModifier("style", true, displayModel)); Link link = new AjaxFallbackLink("loginLink", new Model(loginText)) { @Override public void onClick(final AjaxRequestTarget target) { loginPanel.setVisible(!loginPanel.isVisible()); loginLabel.setModelObject(loginPanel.isVisible() ? cancelText : loginText); if (target != null) { displayModel.setHidePanel(true); target.addComponent(loginPanel); target.addComponent(loginLabel); target.appendJavascript(new BlindDown(loginPanel).toJavascript()); } } }; } private class DisplayModel extends AbstractReadOnlyModel { boolean hidePanel = false; @Override public Object getObject() { return hidePanel ? "display: none" : ""; } private void setHidePanel(boolean b) { hidePanel = b; } } @Override protected void onAfterRender() { displayModel.setHidePanel(false); super.onAfterRender(); } -Doug John Krasnay wrote: > > On Mon, Apr 21, 2008 at 07:18:57AM -0700, Doug Donohoe wrote: >> >> So I added an attribute modifier to the loginPanel: >> >> new AttributeModifier("style", true, new Model("display: none") >> >> This corrected the 'flash' problem. But introduced another problem. >> Now, >> when the form is submitted with an error, when the page is redisplayed, >> the >> form is hidden (because the attribute modifier is still in effect). >> > > One of the great things about models is that they facilitate lazy > evaluation. Try this: > > new AttributeModifier("style", true, new AbstractReadOnlyModel() { > public Object getObject() { > return hidePanel ? "display: none" : ""; > } > }); > > You can then toggle whether "display:none" is rendered by toggling the > hidePanel field of your class. > > jk > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/interesting-scriptaculous-usage-conundrum-tp16807943p16813005.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PropertyModel of textfield not being updated
Strange, because it worked with updating the value of a radio that's tied to a model in that same bean. I tried the AjaxFormSubmitBehavior but am getting the following AJAX error: Channel busy - postponing This was the same error I was getting when using the AjaxButton's default onSubmit() method. This is why I am using AjaxEventBehavior, which seems to be the only one that actually triggers the event. Is there another way to submit my form? So, I'm a bit in a bind here - btw, this happens both in Safari and Firefox. Michael -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 1:10 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated But if you don't send the new values using this button then how is wicket supposed to know there is a new value? Try using an AjaxFormSubmitBehavior instead of AjaxEventBehavior, it will submit the form for you. Maurice On Mon, Apr 21, 2008 at 9:58 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Edvin - this is the save button's behavior. I'm using that instead of > 'onSubmit()' because I needed to throttle the AJAX calls down a bit. > Does that make sense? The entire form is way too long and complex to > post it here. > > > Michael > > > -Original Message- > From: Edvin Syse [mailto:[EMAIL PROTECTED] > > > Sent: Monday, April 21, 2008 12:43 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > I don't see you post anything here that would indicate that you're > updating the model with data from the view.. > > What about saveButton and the form, can you supply that code as well? > > -- Edvin > > Michael Mehrle skrev: > > Sure: > > > > saveButton.add(ajaxSaveBehavior = new > > AjaxEventBehavior(JavaScriptUtil.CLICK) { > > @Override > > protected void onEvent(AjaxRequestTarget target) { > > > > modalWindow.setWindowClosedCallback(new > > ModalWindow.WindowClosedCallback() { > > public void > > onClose(AjaxRequestTarget target) { > > ... > > > > fooTextField.setOutputMarkupId(true); > > > > target.addComponent(fooTextField); > > > > modalWindow.close(target); > > } > > }); > > > > When I step in there with my debugger it seems that the frequency > field > > in eventSchedule (which is the texfield's bean), still is set to the > > default value. Meaning, the textfield doesn't receive the input. > > > > When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 > > does show up when I pop up the modal again. So, the link between the > > model and the textfield is clearly working, but the model is not being > > updated when typing into the textfield. > > > > Michael > > > > -Original Message- > > From: Edvin Syse [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 21, 2008 12:14 PM > > To: users@wicket.apache.org > > Subject: Re: PropertyModel of textfield not being updated > > > > What exactly are you doing via Ajax? Can you show some code? :) > > > > -- Edvin > > > > Michael Mehrle skrev: > >> I got a textfield: > >> > >> > >> > >> add(fooTextField = new TextField("foo", new > > PropertyModel(eventSchedule, > >> "foo"), Integer.class)); > >> > >> > >> > >> eventSchedule is a bean that has a foo field which is an integer. > >> > >> > >> > >> For some reason it's never being updated, although the field picks it > > up > >> when I programmatically call eventSchedule.setFoo(). > >> > >> > >> > >> I'm using this with AJAX and have all my component ids set and the > >> textfield added to the target. > >> > >> > >> > >> Any ideas? > >> > >> > >> > >> > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wicket-minis release?
Who can perform the release? -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 1:45 PM To: users@wicket.apache.org Subject: Re: wicket-minis release? minis doesnt have a project lead. it is meant as a community repository for small reusable things. if there is a need for a release someone can do it. -igor On Mon, Apr 21, 2008 at 6:25 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > I think Igor is officially project lead for the mini's but i doubt he > is planning a release anytime soon. > Not that there are that many bugs open, it's just a matter of demand :) > > Maurice > > > > On Mon, Apr 21, 2008 at 2:45 PM, Hoover, William <[EMAIL PROTECTED]> wrote: > > Does anyone know how close we are to a release of wicket-minis? > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/ > shows 1.3.0-SNAPSHOT. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalized error() from Page constructor
Maurice Marrink wrote: String errorMessage =Application.get().getResourceSettings().getLocalizer().getString(key, someComponentOrNull,defaultMsg); Is this the correct way of doing it? I think it would be really nice if Session#error, info etc could take a resourceKey instead.. -- Edvin Maurice On Mon, Apr 21, 2008 at 9:46 PM, Enrique Rodriguez <[EMAIL PROTECTED]> wrote: I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows the use of StringResourceModel with Component#info. However, when I tried that once, I simply got the Object#toString()-style output in my FeedbackPanel! Enrique On Mon, Apr 21, 2008 at 12:40 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > Ryan Gravener wrote: > > I think you can do error((String)(new > ResourceModel("page.error").getObject())) > > > > Nah.. besides beeing incredibly nasty, you just instantiate and unwrap it > right away. Can't see how that will help? :) > > > > > > > On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > > > > > Sometimes, I want to redirect to another page with an error message > because > > > of something I discover when the constructor runs. I would like to do: > > > > > > if(some_condition) { > > >Session.get().error("errmsg"); > > >setResponsePage(PageClass.class); > > >return; > > > } > > > > > > The problem is that Session#error() doesn't take a resource-key, only > the > > > final text. In the constructor it might be too early to determine the > > > language etc. What's the Wicket way around this one? :) > > > > > > -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
Hi Lars, Thank you for the great explanation. I'll read up on Threading and get this one right :)) -- Edvin lars vonk skrev: The iteraton is called with synchronized(tlds) { ... } around, but maybe that's not enough? Should I wrap all calls to setXXX in TldChecker with a synchronized, or even put synchronized directly on the getters/setters of Tld? It is important that the read and write operation synchronize on the same lock. As I understand it the write of the "done" and "available" flag are in the TldChecker class which aren't locked by the same lock (the lock on tlds) you put around the iteration. This is because another thread is the executing of the code of the TldChecker (that is done via the Executor, if I understand your code correctly). So in order to make sure your write of the "done" and "available" flag are seen by other threads you can do two things: 1. Let the different Threads synchronize on the same lock. The simplest way is to make the setXXX and isXXX methods synchronized as you describe. 2. Declare the "done" and "available" properties as volatile. In my recollection this is the only way that, according to the JMM, guarantees visibility in other Threads. Another thing is that your populateItem method contains more probable concurrency issues: It can happen that during the populateItem method the current Tld is under process. That would cause some strange behavior: For instance: /* Link to show who owns the domain if it's taken */ item.add(new Link("taken") { public boolean isVisible() { return tld.getDone() && !tld.getAvailable() && !tld.getIllegal(); } If the above code executes while in another Thread the TldChecker is currently processing the same tl, then at this point it can happen that the tld.getDone() returns false, as the TldChecker is not done yet. But then when adding the CheckBox like below: /* Checkbox so it can be ordered */ item.add(new CheckBox("selected", new PropertyModel(tld, "selected")) { public boolean isVisible() { return (tld.getDone() && tld.getAvailable()); } }); The tld.getDone() can return true as it can happen that the TldChecker just finished up with the Tld. So there is an inconsistency between the CheckBox and the Link. I don't know the requirements of your application so I can't see if this is bad or not. A way to prevent this is to make sure that populateItem has the exclusive lock for the Tld it is currently processing, so synchronize on the tld that is in the item.getModelObject() AND make sure the TldChecker also synchronizes on the tld it is processing. The thing is that with these kind of Threading issues it can go right 100 times in a row and than it goes wrong for 10 times, or it may never go wrong. If you don't use correct locking you just don't get any guarantees from the JVM, only headaches :-). Lars On Mon, Apr 21, 2008 at 5:32 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: lars vonk wrote: Hi, How is the "done" and "available" flag set in the Tld class by the TldChecker? Since you are using a separate Thread that sets these flags : /* Iterate over the tlds and instantiate a TldChecker */ for(Tld tld : tlds) e.execute(new TldChecker(tld, query)); // Args could be for instance "com", and "mydomain" The iteraton is called with synchronized(tlds) { ... } around, but maybe that's not enough? Should I wrap all calls to setXXX in TldChecker with a synchronized, or even put synchronized directly on the getters/setters of Tld? Another thing is, (I am not sure about this) is that if the Checkbox.isVisible method returns false wouldn't Wicket always complain since there is HTML markup but no corresponding Java component? When you do setVisible(false) on a component, the corresponding markup will be hidden. That's the beauty of it. I know that getVisible() might be called multiple times during a page-render, so I'm beginning to think that maybe it returns false on the call that decides wether to include the markup, and then true later on, creating the mismatch in hiearachy. Does this sound plausible? -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form inside AJAX'd Page returns null values.
I'm having a problem in which a form which works fine when on a page normally, has only null values for its submitted fields when it's been AJAX'd in to another page. I have a panel including my form sitting on MyPage. I also have a MyPageAjax, which included the same panel with no chrome, i.e. no headers, navigation, almost nothing but that panel, in fact. On ParentPage, I have a link to MyPage, which I change on page load via Javascript to an AJAX-y in-page load of MyPageAjax. This works fine, and I've used this technique a few times before, but only with display content. This one includes a form, and that seems to cause problems. When I visit MyPage and submit the form, everything goes as expected. But when I'm on ParentPage and AJAX in the MyPageAjax, then submit, the form is finding null values for all its controls. They are going across the wire properly, according to the Firefox LiveHttpHeaders pluc-in, and the onSubmit() is being called. But the FormComponents all have models which report as null. Any ideas why? The trickiest thing I had to do here is in the Javascript. The ParentPage has a URL like: http://example.com:8080/myapp/ParentPage but MyPage and MyPageAjax have page parameters, such as http://example.com:8080/myapp/MyPage/id/16/ http://example.com:8080/myapp/MyPageAjax/id/16/ So the form action on these pages looks like this: ../../../?wicket:interface=:8:panel:form::IFormSubmitListener:: I end up changing this in JS to /myapp/?wicket:interface=:8:panel:form::IFormSubmitListener:: so it will work from the URL of ParentPage. But that doesn't seem likely to be at issue as the onSubmit is in fact being called. Any suggestions? Thanks, -- Scott Sauyet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PropertyModel of textfield not being updated
But if you don't send the new values using this button then how is wicket supposed to know there is a new value? Try using an AjaxFormSubmitBehavior instead of AjaxEventBehavior, it will submit the form for you. Maurice On Mon, Apr 21, 2008 at 9:58 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Edvin - this is the save button's behavior. I'm using that instead of > 'onSubmit()' because I needed to throttle the AJAX calls down a bit. > Does that make sense? The entire form is way too long and complex to > post it here. > > > Michael > > > -Original Message- > From: Edvin Syse [mailto:[EMAIL PROTECTED] > > > Sent: Monday, April 21, 2008 12:43 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > I don't see you post anything here that would indicate that you're > updating the model with data from the view.. > > What about saveButton and the form, can you supply that code as well? > > -- Edvin > > Michael Mehrle skrev: > > Sure: > > > > saveButton.add(ajaxSaveBehavior = new > > AjaxEventBehavior(JavaScriptUtil.CLICK) { > > @Override > > protected void onEvent(AjaxRequestTarget target) { > > > > modalWindow.setWindowClosedCallback(new > > ModalWindow.WindowClosedCallback() { > > public void > > onClose(AjaxRequestTarget target) { > > ... > > > > fooTextField.setOutputMarkupId(true); > > > > target.addComponent(fooTextField); > > > > modalWindow.close(target); > > } > > }); > > > > When I step in there with my debugger it seems that the frequency > field > > in eventSchedule (which is the texfield's bean), still is set to the > > default value. Meaning, the textfield doesn't receive the input. > > > > When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 > > does show up when I pop up the modal again. So, the link between the > > model and the textfield is clearly working, but the model is not being > > updated when typing into the textfield. > > > > Michael > > > > -Original Message- > > From: Edvin Syse [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 21, 2008 12:14 PM > > To: users@wicket.apache.org > > Subject: Re: PropertyModel of textfield not being updated > > > > What exactly are you doing via Ajax? Can you show some code? :) > > > > -- Edvin > > > > Michael Mehrle skrev: > >> I got a textfield: > >> > >> > >> > >> add(fooTextField = new TextField("foo", new > > PropertyModel(eventSchedule, > >> "foo"), Integer.class)); > >> > >> > >> > >> eventSchedule is a bean that has a foo field which is an integer. > >> > >> > >> > >> For some reason it's never being updated, although the field picks it > > up > >> when I programmatically call eventSchedule.setFoo(). > >> > >> > >> > >> I'm using this with AJAX and have all my component ids set and the > >> textfield added to the target. > >> > >> > >> > >> Any ideas? > >> > >> > >> > >> > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Integer models for textfields?
Makes sense - thanks for the input. I'll just set the field to required as this is part of the business rules right now. Michael -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 12:52 PM To: users@wicket.apache.org Subject: Re: Integer models for textfields? You might run into problems when trying to apply the converted null. If you can use setRequired that would prevent null input. If you can't enforce that the input will never be null you could either override setObject of your model to catch null and "convert" it to a primitive or you can extend IntegerConverter and override parse to return something other then null. The latter option is preferable if you want to enforce this application wide. Maurice On Mon, Apr 21, 2008 at 9:17 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Actually, I just realized that the field's model is an primitive int, > not an Integer - I assume JDK5 auto-boxing will take care of that, or do > I have to use a converter? > > Michael > > > > -Original Message- > From: Maurice Marrink [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 11:36 AM > To: users@wicket.apache.org > Subject: Re: Integer models for textfields? > > You can do new TextField(id, model,Integer.class) and the textfield > will automatically convert everything to integers. > > Maurice > > On Mon, Apr 21, 2008 at 8:25 PM, Michael Mehrle <[EMAIL PROTECTED]> > wrote: > > Do, I have to set up a converter for textfields that use integers as > > models? Or is that being converted implicitly? > > > > > > > > Michael > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalized error() from Page constructor
String errorMessage =Application.get().getResourceSettings().getLocalizer().getString(key, someComponentOrNull,defaultMsg); Maurice On Mon, Apr 21, 2008 at 9:46 PM, Enrique Rodriguez <[EMAIL PROTECTED]> wrote: > I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows > the use of StringResourceModel with Component#info. However, when I > tried that once, I simply got the Object#toString()-style output in my > FeedbackPanel! > > Enrique > > > > > On Mon, Apr 21, 2008 at 12:40 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > > Ryan Gravener wrote: > > > I think you can do error((String)(new > > ResourceModel("page.error").getObject())) > > > > > > > Nah.. besides beeing incredibly nasty, you just instantiate and unwrap it > > right away. Can't see how that will help? :) > > > > > > > > > > > > On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > > > > > > > Sometimes, I want to redirect to another page with an error message > > because > > > > of something I discover when the constructor runs. I would like to do: > > > > > > > > if(some_condition) { > > > >Session.get().error("errmsg"); > > > >setResponsePage(PageClass.class); > > > >return; > > > > } > > > > > > > > The problem is that Session#error() doesn't take a resource-key, only > > the > > > > final text. In the constructor it might be too early to determine the > > > > language etc. What's the Wicket way around this one? :) > > > > > > > > -- Edvin > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PropertyModel of textfield not being updated
Edvin - this is the save button's behavior. I'm using that instead of 'onSubmit()' because I needed to throttle the AJAX calls down a bit. Does that make sense? The entire form is way too long and complex to post it here. Michael -Original Message- From: Edvin Syse [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 12:43 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated I don't see you post anything here that would indicate that you're updating the model with data from the view.. What about saveButton and the form, can you supply that code as well? -- Edvin Michael Mehrle skrev: > Sure: > > saveButton.add(ajaxSaveBehavior = new > AjaxEventBehavior(JavaScriptUtil.CLICK) { > @Override > protected void onEvent(AjaxRequestTarget target) { > > modalWindow.setWindowClosedCallback(new > ModalWindow.WindowClosedCallback() { > public void > onClose(AjaxRequestTarget target) { > ... > > fooTextField.setOutputMarkupId(true); > > target.addComponent(fooTextField); > > modalWindow.close(target); > } > }); > > When I step in there with my debugger it seems that the frequency field > in eventSchedule (which is the texfield's bean), still is set to the > default value. Meaning, the textfield doesn't receive the input. > > When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 > does show up when I pop up the modal again. So, the link between the > model and the textfield is clearly working, but the model is not being > updated when typing into the textfield. > > Michael > > -Original Message- > From: Edvin Syse [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 12:14 PM > To: users@wicket.apache.org > Subject: Re: PropertyModel of textfield not being updated > > What exactly are you doing via Ajax? Can you show some code? :) > > -- Edvin > > Michael Mehrle skrev: >> I got a textfield: >> >> >> >> add(fooTextField = new TextField("foo", new > PropertyModel(eventSchedule, >> "foo"), Integer.class)); >> >> >> >> eventSchedule is a bean that has a foo field which is an integer. >> >> >> >> For some reason it's never being updated, although the field picks it > up >> when I programmatically call eventSchedule.setFoo(). >> >> >> >> I'm using this with AJAX and have all my component ids set and the >> textfield added to the target. >> >> >> >> Any ideas? >> >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Integer models for textfields?
that's auto: public final FormComponent setType(Class type) { typeName = type == null ? null : type.getName(); if (type != null && type.isPrimitive()) { setRequired(true); } On Mon, Apr 21, 2008 at 9:51 PM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > You might run into problems when trying to apply the converted null. > If you can use setRequired that would prevent null input. > If you can't enforce that the input will never be null you could > either override setObject of your model to catch null and "convert" it > to a primitive or you can extend IntegerConverter and override parse > to return something other then null. The latter option is preferable > if you want to enforce this application wide. > > Maurice > > On Mon, Apr 21, 2008 at 9:17 PM, Michael Mehrle <[EMAIL PROTECTED]> > wrote: > > Actually, I just realized that the field's model is an primitive int, > > not an Integer - I assume JDK5 auto-boxing will take care of that, or > do > > I have to use a converter? > > > > Michael > > > > > > > > -Original Message- > > From: Maurice Marrink [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 21, 2008 11:36 AM > > To: users@wicket.apache.org > > Subject: Re: Integer models for textfields? > > > > You can do new TextField(id, model,Integer.class) and the textfield > > will automatically convert everything to integers. > > > > Maurice > > > > On Mon, Apr 21, 2008 at 8:25 PM, Michael Mehrle <[EMAIL PROTECTED] > > > > wrote: > > > Do, I have to set up a converter for textfields that use integers as > > > models? Or is that being converted implicitly? > > > > > > > > > > > > Michael > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Integer models for textfields?
You might run into problems when trying to apply the converted null. If you can use setRequired that would prevent null input. If you can't enforce that the input will never be null you could either override setObject of your model to catch null and "convert" it to a primitive or you can extend IntegerConverter and override parse to return something other then null. The latter option is preferable if you want to enforce this application wide. Maurice On Mon, Apr 21, 2008 at 9:17 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Actually, I just realized that the field's model is an primitive int, > not an Integer - I assume JDK5 auto-boxing will take care of that, or do > I have to use a converter? > > Michael > > > > -Original Message- > From: Maurice Marrink [mailto:[EMAIL PROTECTED] > Sent: Monday, April 21, 2008 11:36 AM > To: users@wicket.apache.org > Subject: Re: Integer models for textfields? > > You can do new TextField(id, model,Integer.class) and the textfield > will automatically convert everything to integers. > > Maurice > > On Mon, Apr 21, 2008 at 8:25 PM, Michael Mehrle <[EMAIL PROTECTED]> > wrote: > > Do, I have to set up a converter for textfields that use integers as > > models? Or is that being converted implicitly? > > > > > > > > Michael > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to disable dates in Wicket Date Picker ?
On Mon, Apr 21, 2008 at 6:07 AM, Gerolf Seitz <[EMAIL PROTECTED]> wrote: > public class MyDatePicker extends DatePicker > { > ... >private static final SimpleDateFormat format = new > SimpleDateFormat("MM/dd/"); Maybe this was just quick example code but DateFormat's aren't thread safe. From the javadoc: "Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally." Just a heads-up, Enrique - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalized error() from Page constructor
I'm curious what's up here, too, since Pro Wicket Listing 6-15 shows the use of StringResourceModel with Component#info. However, when I tried that once, I simply got the Object#toString()-style output in my FeedbackPanel! Enrique On Mon, Apr 21, 2008 at 12:40 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > Ryan Gravener wrote: > > I think you can do error((String)(new > ResourceModel("page.error").getObject())) > > > > Nah.. besides beeing incredibly nasty, you just instantiate and unwrap it > right away. Can't see how that will help? :) > > > > > > > On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > > > > > Sometimes, I want to redirect to another page with an error message > because > > > of something I discover when the constructor runs. I would like to do: > > > > > > if(some_condition) { > > >Session.get().error("errmsg"); > > >setResponsePage(PageClass.class); > > >return; > > > } > > > > > > The problem is that Session#error() doesn't take a resource-key, only > the > > > final text. In the constructor it might be too early to determine the > > > language etc. What's the Wicket way around this one? :) > > > > > > -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
> > The iteraton is called with synchronized(tlds) { ... } around, but maybe > that's not enough? Should I wrap all calls to setXXX in TldChecker with a > synchronized, or even put synchronized directly on the getters/setters of > Tld? It is important that the read and write operation synchronize on the same lock. As I understand it the write of the "done" and "available" flag are in the TldChecker class which aren't locked by the same lock (the lock on tlds) you put around the iteration. This is because another thread is the executing of the code of the TldChecker (that is done via the Executor, if I understand your code correctly). So in order to make sure your write of the "done" and "available" flag are seen by other threads you can do two things: 1. Let the different Threads synchronize on the same lock. The simplest way is to make the setXXX and isXXX methods synchronized as you describe. 2. Declare the "done" and "available" properties as volatile. In my recollection this is the only way that, according to the JMM, guarantees visibility in other Threads. Another thing is that your populateItem method contains more probable concurrency issues: It can happen that during the populateItem method the current Tld is under process. That would cause some strange behavior: For instance: > /* Link to show who owns the domain if it's taken */ > item.add(new Link("taken") { > public boolean isVisible() { > return tld.getDone() && !tld.getAvailable() && > !tld.getIllegal(); > } > If the above code executes while in another Thread the TldChecker is currently processing the same tl, then at this point it can happen that the tld.getDone() returns false, as the TldChecker is not done yet. But then when adding the CheckBox like below: > /* Checkbox so it can be ordered */ > item.add(new CheckBox("selected", new PropertyModel(tld, "selected")) { > public boolean isVisible() { > return (tld.getDone() && tld.getAvailable()); > } > }); > The tld.getDone() can return true as it can happen that the TldChecker just finished up with the Tld. So there is an inconsistency between the CheckBox and the Link. I don't know the requirements of your application so I can't see if this is bad or not. A way to prevent this is to make sure that populateItem has the exclusive lock for the Tld it is currently processing, so synchronize on the tld that is in the item.getModelObject() AND make sure the TldChecker also synchronizes on the tld it is processing. The thing is that with these kind of Threading issues it can go right 100 times in a row and than it goes wrong for 10 times, or it may never go wrong. If you don't use correct locking you just don't get any guarantees from the JVM, only headaches :-). Lars On Mon, Apr 21, 2008 at 5:32 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > lars vonk wrote: > > > Hi, > > > > How is the "done" and "available" flag set in the Tld class by the > > TldChecker? Since you are using a separate Thread that sets these flags > > : > > > > /* Iterate over the tlds and instantiate a TldChecker */ > > > > > for(Tld tld : tlds) > > > e.execute(new TldChecker(tld, query)); // Args could be for > > > instance "com", and "mydomain" > > > > > > The iteraton is called with synchronized(tlds) { ... } around, but maybe > that's not enough? Should I wrap all calls to setXXX in TldChecker with a > synchronized, or even put synchronized directly on the getters/setters of > Tld? > > Another thing is, (I am not sure about this) is that if the > > Checkbox.isVisible method returns false wouldn't Wicket always complain > > since there is HTML markup but no corresponding Java component? > > > > When you do setVisible(false) on a component, the corresponding markup > will be hidden. That's the beauty of it. > > I know that getVisible() might be called multiple times during a > page-render, so I'm beginning to think that maybe it returns false on the > call that decides wether to include the markup, and then true later on, > creating the mismatch in hiearachy. Does this sound plausible? > > > -- Edvin > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: PropertyModel of textfield not being updated
I don't see you post anything here that would indicate that you're updating the model with data from the view.. What about saveButton and the form, can you supply that code as well? -- Edvin Michael Mehrle skrev: Sure: saveButton.add(ajaxSaveBehavior = new AjaxEventBehavior(JavaScriptUtil.CLICK) { @Override protected void onEvent(AjaxRequestTarget target) { modalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { ... fooTextField.setOutputMarkupId(true); target.addComponent(fooTextField); modalWindow.close(target); } }); When I step in there with my debugger it seems that the frequency field in eventSchedule (which is the texfield's bean), still is set to the default value. Meaning, the textfield doesn't receive the input. When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 does show up when I pop up the modal again. So, the link between the model and the textfield is clearly working, but the model is not being updated when typing into the textfield. Michael -Original Message- From: Edvin Syse [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 12:14 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated What exactly are you doing via Ajax? Can you show some code? :) -- Edvin Michael Mehrle skrev: I got a textfield: add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, "foo"), Integer.class)); eventSchedule is a bean that has a foo field which is an integer. For some reason it's never being updated, although the field picks it up when I programmatically call eventSchedule.setFoo(). I'm using this with AJAX and have all my component ids set and the textfield added to the target. Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalized error() from Page constructor
Ryan Gravener wrote: I think you can do error((String)(new ResourceModel("page.error").getObject())) Nah.. besides beeing incredibly nasty, you just instantiate and unwrap it right away. Can't see how that will help? :) On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: Sometimes, I want to redirect to another page with an error message because of something I discover when the constructor runs. I would like to do: if(some_condition) { Session.get().error("errmsg"); setResponsePage(PageClass.class); return; } The problem is that Session#error() doesn't take a resource-key, only the final text. In the constructor it might be too early to determine the language etc. What's the Wicket way around this one? :) -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalized error() from Page constructor
I think you can do error((String)(new ResourceModel("page.error").getObject())) On Mon, Apr 21, 2008 at 3:11 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > Sometimes, I want to redirect to another page with an error message because > of something I discover when the constructor runs. I would like to do: > > if(some_condition) { > Session.get().error("errmsg"); > setResponsePage(PageClass.class); > return; > } > > The problem is that Session#error() doesn't take a resource-key, only the > final text. In the constructor it might be too early to determine the > language etc. What's the Wicket way around this one? :) > > -- Edvin > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Ryan Gravener http://ryangravener.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bookmarkable RSS feed with parameter using wicketstuff-rome
see responses inline: On Mon, Apr 21, 2008 at 1:07 PM, Zach Cox <[EMAIL PROTECTED]> wrote: > I would like to have URLs for this feed something like this: > > http://site.com/feed/1234 > > This should be possible by mounting the feed resource with a "nice" url from within your WebApplication class: public class MyApplication extends WebApplication { public void init() { mountSharedResource("/view/rss", new ResourceReference("myFeed") { protected FeedResource newResource() { return new MyFeedResource(); } }.getSharedResourceKey()); } } > That way users can add that URL to their feed readers and always get > the latest info for object 1234. All of the wicketstuff-rome examples > I've seen seem to create the FeedResource instance once and then make > it a shared resource. I'm currently doing that but the feeds seem to > disappear and cannot be read in a feed reader after some time. This would be a question for the wicket folks and not a wicketstuff-rome issue. Is there any known limitation for feed resources? > Since wicketstuff-rome provides a Resource subclass (FeedResource) and > not a WebPage subclass I'm confused as to how to do the following: > - get bookmarkable URLs with a parameter for the feed You can grab request params by using the getParameters() method within your FeedResource public class MyFeedResource extends FeedResource { protected SyndFeed getFeed() { Long id = getParameters().getLong("id"); } } - have a new FeedResource created & returned when user accesses that URL need to ask the wicket folks why this isn't happening...
RE: PropertyModel of textfield not being updated
Sure: saveButton.add(ajaxSaveBehavior = new AjaxEventBehavior(JavaScriptUtil.CLICK) { @Override protected void onEvent(AjaxRequestTarget target) { modalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { ... fooTextField.setOutputMarkupId(true); target.addComponent(fooTextField); modalWindow.close(target); } }); When I step in there with my debugger it seems that the frequency field in eventSchedule (which is the texfield's bean), still is set to the default value. Meaning, the textfield doesn't receive the input. When I just add 'eventSchedule.setFrequency(10)' for instance - the 10 does show up when I pop up the modal again. So, the link between the model and the textfield is clearly working, but the model is not being updated when typing into the textfield. Michael -Original Message- From: Edvin Syse [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 12:14 PM To: users@wicket.apache.org Subject: Re: PropertyModel of textfield not being updated What exactly are you doing via Ajax? Can you show some code? :) -- Edvin Michael Mehrle skrev: > I got a textfield: > > > > add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, > "foo"), Integer.class)); > > > > eventSchedule is a bean that has a foo field which is an integer. > > > > For some reason it's never being updated, although the field picks it up > when I programmatically call eventSchedule.setFoo(). > > > > I'm using this with AJAX and have all my component ids set and the > textfield added to the target. > > > > Any ideas? > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Integer models for textfields?
Actually, I just realized that the field's model is an primitive int, not an Integer - I assume JDK5 auto-boxing will take care of that, or do I have to use a converter? Michael -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Monday, April 21, 2008 11:36 AM To: users@wicket.apache.org Subject: Re: Integer models for textfields? You can do new TextField(id, model,Integer.class) and the textfield will automatically convert everything to integers. Maurice On Mon, Apr 21, 2008 at 8:25 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Do, I have to set up a converter for textfields that use integers as > models? Or is that being converted implicitly? > > > > Michael > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unit testing with SpringBean's in Restlet Resources
I got some big help from others who took the time to post ideas about integrating Wicket and Restlet [1] [2], so I figured I'd share something I figured out. The missing link for me was to get the SpringBean's in the Restlet Resource's working in unit tests and thus getting the Wicket Application set on the thread used to handle the Restlet Resource request. In short, you just override Restlet#handle and set the Wicket Application prior to the rest of the handle call. Note that I use 'WebApplication' below only to differentiate from the same-named Restlet Application. Also, this is example code; in my real code I use a Template Method to get a custom Router w/webapp, much like some people override their spring injector for unit tests. import org.apache.wicket.protocol.http.WebApplication; import org.restlet.Application; import org.restlet.Context; import org.restlet.Restlet; import org.restlet.Router; import org.restlet.data.Request; import org.restlet.data.Response; public class TestApplication extends Application { private WebApplication webapp; public TestApplication( Context parentContext, WebApplication webapp ) { super( parentContext ); this.webapp = webapp; } @Override public synchronized Restlet createRoot() { Router router = new Router( getContext() ) { public void handle( Request request, Response response ) { WebApplication.set( webapp ); //<-- set webapp before handle super.handle( request, response ); } }; router.attach( "/test", TestResource.class ); return router; } } HTH, Enrique [1] http://www.nabble.com/Re%3A-Feature-request%3A-using-%40SpringBean-outside-Wicket-request-p16582239.html [2] http://blog.ehour.nl/index.php/archives/21 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PropertyModel of textfield not being updated
What exactly are you doing via Ajax? Can you show some code? :) -- Edvin Michael Mehrle skrev: I got a textfield: add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, "foo"), Integer.class)); eventSchedule is a bean that has a foo field which is an integer. For some reason it's never being updated, although the field picks it up when I programmatically call eventSchedule.setFoo(). I'm using this with AJAX and have all my component ids set and the textfield added to the target. Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Internationalized error() from Page constructor
Sometimes, I want to redirect to another page with an error message because of something I discover when the constructor runs. I would like to do: if(some_condition) { Session.get().error("errmsg"); setResponsePage(PageClass.class); return; } The problem is that Session#error() doesn't take a resource-key, only the final text. In the constructor it might be too early to determine the language etc. What's the Wicket way around this one? :) -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PropertyModel of textfield not being updated
I got a textfield: add(fooTextField = new TextField("foo", new PropertyModel(eventSchedule, "foo"), Integer.class)); eventSchedule is a bean that has a foo field which is an integer. For some reason it's never being updated, although the field picks it up when I programmatically call eventSchedule.setFoo(). I'm using this with AJAX and have all my component ids set and the textfield added to the target. Any ideas?
Re: Implementing AutoComplete Issue
Great thanks!!! saved me some work :) On Mon, Apr 21, 2008 at 2:11 PM, Gerolf Seitz <[EMAIL PROTECTED]> wrote: > to quote johan, maybe in about 1-2 weeks. > Gerolf > > On Mon, Apr 21, 2008 at 7:34 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > But there isn't a 1.3.4 in very near future is it ? > > > > Btw, Scriptaculous is down ... (the detail documentation i mean, that > > simple > > source doesn't tell you that much) > > > > On Mon, Apr 21, 2008 at 10:27 AM, Gerolf Seitz <[EMAIL PROTECTED]> > > wrote: > > > > > this is fixed for 1.3.4 > > > > > > Gerolf > > > > > > On Mon, Apr 21, 2008 at 3:50 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > > > > > > I have implemented autocomplete using 1.3.3. examples in wicket > > stuff. > > > It > > > > is working fine in firefox, however doesnt work in IE. Is there a > fix > > > for > > > > this ? Is scriptaculous thing the answer ? if so can someone point > me > > to > > > > the > > > > example source or give me a rough idea ? > > > > > > > > > > > > thanks > > > > Rick > > > > > > > > > > -- Regards Vyas, Anirudh || ॐ ||
Re: Integer models for textfields?
You can do new TextField(id, model,Integer.class) and the textfield will automatically convert everything to integers. Maurice On Mon, Apr 21, 2008 at 8:25 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Do, I have to set up a converter for textfields that use integers as > models? Or is that being converted implicitly? > > > > Michael > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: If logic in wicket seems complicated
right, use fragments for these small inline chunks, also because your usecase is so simple: just a string, you can simply do class aliasesmodel extends ldm { object load() { list aliases=getaliases(); if (aliases.isempty()) { aliases.add(new alias("none")); } } } then there is no need to toggle the none fragment to show up -igor On Mon, Apr 21, 2008 at 11:33 AM, Enrique Rodriguez <[EMAIL PROTECTED]> wrote: > On Mon, Apr 21, 2008 at 11:27 AM, Doug Donohoe <[EMAIL PROTECTED]> wrote: > > ... > > > I may be having a mental block, but I'm finding it tedious to implement 'if' > > behavior in Wicket. > > I use Wicket Fragments all over the place for this sort of thing. > > http://wicket.apache.org/examplefragments.html > > Enrique > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: If logic in wicket seems complicated
On Mon, Apr 21, 2008 at 11:27 AM, Doug Donohoe <[EMAIL PROTECTED]> wrote: > ... > I may be having a mental block, but I'm finding it tedious to implement 'if' > behavior in Wicket. I use Wicket Fragments all over the place for this sort of thing. http://wicket.apache.org/examplefragments.html Enrique - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket auth roles
Could it be you have 2 different wicket versions on your classpath? Maurice On Mon, Apr 21, 2008 at 8:14 PM, NTS <[EMAIL PROTECTED]> wrote: > > Hi, >I am trying to use auth-roles in our application. I am getting the error: > > Caused by: java.lang.IllegalArgumentException: MetaDataKey class > > org.apache.wicket.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy$1 > requires argument of class > org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions, > not class > org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions > > > on the line > > final Label lbl = new Label("lblMessage"); > MetaDataRoleAuthorizationStrategy.authorize(lbl, RENDER, > "ADMIN"); > add(lbl); > > Without this line I am able to restrict access to the pages. But once I try > to implement the strategy over components, I am getting error. Any ideas ? > > Thanks, > NTS > -- > View this message in context: > http://www.nabble.com/wicket-auth-roles-tp16808310p16808310.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
If logic in wicket seems complicated
As mentioned in previous posts, I'm a new wicket user and I'm migrating online.ddpoker.com to it. I may be having a mental block, but I'm finding it tedious to implement 'if' behavior in Wicket. As an example, I have a page which lists information about a DD Poker online user. It lists known aliases for the user (which are linked to details about that alias) or none: Known Aliases: none --- or --- Known Aliases: _Tahoe_ _Zorro_ Ideally, I'd like a reusable panel component which displays 'none' or the linked aliases. Thus the displaying page can just define and do add(new Aliases("aliases")) in the java code. However, in order for Aliases to do it's thing, it seems like I need to do one of two things: * OPTION ONE * Define a template like A: <-span- wicket-id="none">None B: <-a- href="#" wicket-id="links"><-span- wicket-id="name">Name Then in the java code, use setVisible() to turn A/B on/off depending on whether there are any aliases. ** OPTION TWO * Define a template like <-div- wicket-id="aliasDetail"> Define two more panels, AliasesNone and AliasesList and in the java code do if (aliases.size() == 0) { add new AliasesNone("aliasDetail"); } else { add new AliasesList("aliasDetail"); } The problem I see with this is that to implement a simple fragment would require 3 panel classes (with 3 associated HTML classes) as opposed to the few lines of JSP code I use today. * END OPTIONS * In summary, it seems to me that in order to do if-then logic in wicket, I need to choose one of the following options: a) list all options in the html template and turn off the ones that don't apply depending on the data. b) define Panels at a very fine level and have the Java code select the correct sub-panel depending on the data. This is seems like a lot of work - is there an easier way? I also feel that I want to be able to add components in Java with out needing associated markup. In other words, I feel artificially constrained not being able to do something like this: <-html-> Known aliases: <-span- wicket:id="aliases">list here || none List a = getAliases(user); if (a.empty()) { add(new Label("aliases", "none"); } else { RepeatingView rv = new RepeatingView("aliases"); add(rv); for (Alias alias : a) { Link l = new Link([detailpage for alias]); rv.add(l); l.add(new Label(alias.getName()); } } I'm interested to here what wicket users have done in practice. It seems very common to have if-logic in html pages that depending on the condition display completely different html hierarchies. Thanks, -Doug -- View this message in context: http://www.nabble.com/If-logic-in-wicket-seems-complicated-tp16808507p16808507.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Integer models for textfields?
Do, I have to set up a converter for textfields that use integers as models? Or is that being converted implicitly? Michael
wicket auth roles
Hi, I am trying to use auth-roles in our application. I am getting the error: Caused by: java.lang.IllegalArgumentException: MetaDataKey class org.apache.wicket.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy$1 requires argument of class org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions, not class org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions on the line final Label lbl = new Label("lblMessage"); MetaDataRoleAuthorizationStrategy.authorize(lbl, RENDER, "ADMIN"); add(lbl); Without this line I am able to restrict access to the pages. But once I try to implement the strategy over components, I am getting error. Any ideas ? Thanks, NTS -- View this message in context: http://www.nabble.com/wicket-auth-roles-tp16808310p16808310.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Implementing AutoComplete Issue
to quote johan, maybe in about 1-2 weeks. Gerolf On Mon, Apr 21, 2008 at 7:34 PM, Ricky <[EMAIL PROTECTED]> wrote: > But there isn't a 1.3.4 in very near future is it ? > > Btw, Scriptaculous is down ... (the detail documentation i mean, that > simple > source doesn't tell you that much) > > On Mon, Apr 21, 2008 at 10:27 AM, Gerolf Seitz <[EMAIL PROTECTED]> > wrote: > > > this is fixed for 1.3.4 > > > > Gerolf > > > > On Mon, Apr 21, 2008 at 3:50 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > I have implemented autocomplete using 1.3.3. examples in wicket > stuff. > > It > > > is working fine in firefox, however doesnt work in IE. Is there a fix > > for > > > this ? Is scriptaculous thing the answer ? if so can someone point me > to > > > the > > > example source or give me a rough idea ? > > > > > > > > > thanks > > > Rick > > > > > >
Bookmarkable RSS feed with parameter using wicketstuff-rome
I have a WebPage that takes the ID of an object in the database in the URL, extracts it from PageParameters, and displays information related to that object. I'm also using wicketstuff-rome to create an RSS feed for information related to that object, so I'll have the autodiscovery link in the section and an RSS feed link in the page. I would like to have URLs for this feed something like this: http://site.com/feed/1234 That way users can add that URL to their feed readers and always get the latest info for object 1234. All of the wicketstuff-rome examples I've seen seem to create the FeedResource instance once and then make it a shared resource. I'm currently doing that but the feeds seem to disappear and cannot be read in a feed reader after some time. Since wicketstuff-rome provides a Resource subclass (FeedResource) and not a WebPage subclass I'm confused as to how to do the following: - get bookmarkable URLs with a parameter for the feed - have a new FeedResource created & returned when user accesses that URL I'm sure there's an obvious solution in front of my face but I can't seem to find it. Thanks, Zach - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Implementing AutoComplete Issue
But there isn't a 1.3.4 in very near future is it ? Btw, Scriptaculous is down ... (the detail documentation i mean, that simple source doesn't tell you that much) On Mon, Apr 21, 2008 at 10:27 AM, Gerolf Seitz <[EMAIL PROTECTED]> wrote: > this is fixed for 1.3.4 > > Gerolf > > On Mon, Apr 21, 2008 at 3:50 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I have implemented autocomplete using 1.3.3. examples in wicket stuff. > It > > is working fine in firefox, however doesnt work in IE. Is there a fix > for > > this ? Is scriptaculous thing the answer ? if so can someone point me to > > the > > example source or give me a rough idea ? > > > > > > thanks > > Rick > > >
Re: Auto-Complete TextField Problem
Will this help? https://svn.apache.org/repos/asf/wicket/releases/wicket-1.3.2 Maurice On Mon, Apr 21, 2008 at 2:52 PM, Ricky <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to look for 1.3.2 example? (I am using 1.3.3. for auto complete > feature, its working fine with Firefox 2 but with IE it goes Wiggy). Can > someone point me where is 1.3.2 example ? > > Regards > Vyas, Anirudh > > > > On Thu, Apr 17, 2008 at 5:41 PM, Vatroslav <[EMAIL PROTECTED]> wrote: > > > > > > > Gerolf, > > thanks for the info.. > > > > Vatroslav > > > > > > Gerolf Seitz wrote: > > > > > > it's fixed in trunk for 1.3.4 and 1.4M1 > > > > > > Gerolf > > > > > > On Tue, Apr 15, 2008 at 12:25 PM, Vatroslav <[EMAIL PROTECTED]> wrote: > > > > > >> > > >> Hi, > > >> I've problem with AutoCompleteTextField with IE6 and Wicket > > >> 1.3.3.installed > > >> on Tomcat6 and/or Jetty6. > > >> > > > > > > > -- > > View this message in context: > > > http://www.nabble.com/Auto-Complete-TextField-Problem-tp16698982p16756375.html > > Sent from the Wicket - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-minis release?
minis doesnt have a project lead. it is meant as a community repository for small reusable things. if there is a need for a release someone can do it. -igor On Mon, Apr 21, 2008 at 6:25 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > I think Igor is officially project lead for the mini's but i doubt he > is planning a release anytime soon. > Not that there are that many bugs open, it's just a matter of demand :) > > Maurice > > > > On Mon, Apr 21, 2008 at 2:45 PM, Hoover, William <[EMAIL PROTECTED]> wrote: > > Does anyone know how close we are to a release of wicket-minis? > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/ > shows 1.3.0-SNAPSHOT. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form ListView Validator
Hi, I encountered a problem with wicket form validation, that I am not able to solve myself. The situation is that I have some form with some TextFields. These TextFields are generated from a ListView and represents ordering of user applications. I added to each TextField the NumberValidator. That's easy. But a user is asked to fill the TextFields with number and the number must be in interval from zero to the number of his applications and the numbers cannot be repeated. I am using wicket 1.3.0. I saw in previous versions that there was some validator, that can be filled by numerous of FormComponent object and then this validator can work with this collection. I thought this perfect match my needs. But I am not able to find this type of Validator in wicket 1.3.0. Is this type deprecated? Is there any alternative validator? Or should I override AbstractValidator and make one on my own? If anybody solved the same problem I will be very glad for any snippet of code. I realy dont know how to Validate the ListView I have. Thanks for your advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form ListView validator
you can always override form.validate() { super.validate(); // do any sort of form-level validation here } -igor On Mon, Apr 21, 2008 at 6:17 AM, Milan Křápek <[EMAIL PROTECTED]> wrote: > Hi, > I encountered a problem with wicket form validation, that I am not able to > solve myself. The situation is that I have some form with some TextFields. > These TextFields are generated from a ListView and represents ordering of > user applications. I added to each TextField the NumberValidator. That's > easy. But a user is asked to fill the TextFields with number and the number > must be in interval from zero to the number of his applications and the > numbers cannot be repeated. > I am using wicket 1.3.0. I saw in previous versions that there was some > validator, that can be filled by numerous of FormComponent object and then > this validator can work with this collection. I thought this perfect match my > needs. But I am not able to find this type of Validator in wicket 1.3.0. Is > this type deprecated? Is there any alternative validator? Or should I > override AbstractValidator and make one on my own? > If anybody solved the same problem I will be very glad for any snippet of > code. I realy dont know how to Validate the ListView I have. > > Thanks for your advice. > > Milan > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: TreeTable escape HTML does not work
that is a bit wrong, a cleaner way is to: public Component newHeader(MarkupContainer parent, String id) { return super.newHeader(parent, id).setEscapeModelStrings(false); } -igor On Mon, Apr 21, 2008 at 5:41 AM, Rikard Lindström <[EMAIL PROTECTED]> wrote: > > > wenm wrote: > > > > > > Columns does not have escapemodelstrings method. I tried > > PropertyRenderableColumn.setEscapeContent(false), it works! But the > > problem is PropertyTreeColumn does not support any escape setting method, > > and that's the column I would like to disable the escape. > > > > > > I was able to override the newHeader method, and set the escape onto the > Label, which seems to work fine. This was the only way I was able to put a > that was rendered as I wanted into the column. > > PropertyRenderableColumn month = new PropertyRenderableColumn(new > ColumnLocation(Alignment.MIDDLE, 1, Unit.PROPORTIONAL), header, > "userObject.oneMonth") { > > public Component newHeader(MarkupContainer parent, > String id) > { > Label l = new Label(id, header); > l.setEscapeModelStrings(false); > return l; > } > }; > -- > View this message in context: > http://www.nabble.com/TreeTable-escape-HTML-does-not-work-tp16047309p16807603.html > > > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sortable(DnD) editable TreeTable
The meaning of tree.updateTree(target) is to refresh changed parts of the tree during ajax request (assuming the model fired proper listeners). The problem with DnD tree is that it's more complicated than just reordering DOM entries and then notifying the server. Anyway, if you want to make sure that the whole tree is redrawn call invalidateAll on it before sending to ajaxrequesttarget. -Matej On Mon, Apr 21, 2008 at 5:45 PM, Roman Zechner <[EMAIL PROTECTED]> wrote: > Noone else interested in a similar component? What is the meaning of > tree.updateTree(target)? > In the code sample below I expect the tree to be reloaded when the button > is pressed, but nothing happens. > What am I doing wrong? > > Cheers, Roman > > > > Roman Zechner wrote: > > > i am building a variant of matej knopp's cool editable treetable. > > i am using jquery for the drag'n drop operations on it's rows. > > now if i have my new tree in DOM, how can i submit it back to the server? > > > > the idea is simple: > > 1. change the DOM of the tree, i.e. change the order of rows > > 2. submit it via a "save" button > > 3. save the new tree on the serverside and update tree on view > > > > > > > > form.add(tree) > > form.add(new AjaxFallbackButton("save", new ResourceModel("save"), form) { > > @Override > > protected void onSubmit(AjaxRequestTarget target, Form form) { > > TreeTable treeTable = (TreeTable) > findParent(TreeTable.class); > > // do some db work > > tree.updateTree(target); //this does nothing? no redraw of > tree as expected?! > > } > > } > > > > thanks, > > > > roman > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester.startPage(page) throws "No requestCycle is currently set"
On Sat, 19 Apr 2008 10:39:41 +0200 "Johan Compagner" <[EMAIL PROTECTED]> wrote: > Somehow something detaches everything when it shouldnt have done it > yet in your example. Upload your test to a jira issue Done, WICKET-1558, thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
Yes, if you want to have an invisible component made visible again via AJAX you have to call setOutputMarkupPlaceholderTag(true) on it, or wrap it in a WebMarkupContainer that is always visible and refresh the container. The component was never fully rendered or returned via AJAX without being visible. But since tld.setPublished() was set in the "current" Thread, and the other booleans were set in the thread of the TldChecker, I guess that's what causing it. It seems that it acually helped to include getPublished() in the isVisible() like this: public boolean isVisible() { return tld.getPublished() && tld.getDone() && tld.getAvailable(); } I guess it is not "water proof" like this, so I'll include the setOutputMarkupPleaceholderTag(true) as well. Thank's a lot! -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
On Mon, Apr 21, 2008 at 05:32:08PM +0200, Edvin Syse wrote: > > I know that getVisible() might be called multiple times during a > page-render, so I'm beginning to think that maybe it returns false on the > call that decides wether to include the markup, and then true later on, > creating the mismatch in hiearachy. Does this sound plausible? > Yes, if you want to have an invisible component made visible again via AJAX you have to call setOutputMarkupPlaceholderTag(true) on it, or wrap it in a WebMarkupContainer that is always visible and refresh the container. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sortable(DnD) editable TreeTable
Noone else interested in a similar component? What is the meaning of tree.updateTree(target)? In the code sample below I expect the tree to be reloaded when the button is pressed, but nothing happens. What am I doing wrong? Cheers, Roman Roman Zechner wrote: i am building a variant of matej knopp's cool editable treetable. i am using jquery for the drag'n drop operations on it's rows. now if i have my new tree in DOM, how can i submit it back to the server? the idea is simple: 1. change the DOM of the tree, i.e. change the order of rows 2. submit it via a "save" button 3. save the new tree on the serverside and update tree on view form.add(tree) form.add(new AjaxFallbackButton("save", new ResourceModel("save"), form) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { TreeTable treeTable = (TreeTable) findParent(TreeTable.class); // do some db work tree.updateTree(target); //this does nothing? no redraw of tree as expected?! } } thanks, roman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
lars vonk wrote: Hi, How is the "done" and "available" flag set in the Tld class by the TldChecker? Since you are using a separate Thread that sets these flags : /* Iterate over the tlds and instantiate a TldChecker */ for(Tld tld : tlds) e.execute(new TldChecker(tld, query)); // Args could be for instance "com", and "mydomain" The iteraton is called with synchronized(tlds) { ... } around, but maybe that's not enough? Should I wrap all calls to setXXX in TldChecker with a synchronized, or even put synchronized directly on the getters/setters of Tld? Another thing is, (I am not sure about this) is that if the Checkbox.isVisible method returns false wouldn't Wicket always complain since there is HTML markup but no corresponding Java component? When you do setVisible(false) on a component, the corresponding markup will be hidden. That's the beauty of it. I know that getVisible() might be called multiple times during a page-render, so I'm beginning to think that maybe it returns false on the call that decides wether to include the markup, and then true later on, creating the mismatch in hiearachy. Does this sound plausible? -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView and Threading
Hi, How is the "done" and "available" flag set in the Tld class by the TldChecker? Since you are using a separate Thread that sets these flags : /* Iterate over the tlds and instantiate a TldChecker */ > for(Tld tld : tlds) >e.execute(new TldChecker(tld, query)); // Args could be for > instance "com", and "mydomain" > those variables needs to be set via for instance synchronized gets/and sets or declared volatile to garantuee visibility by other Threads. Another thing is, (I am not sure about this) is that if the Checkbox.isVisible method returns false wouldn't Wicket always complain since there is HTML markup but no corresponding Java component? Lars On Mon, Apr 21, 2008 at 4:30 PM, Edvin Syse <[EMAIL PROTECTED]> wrote: > Hi, > > I've created a "domain search" panel for Wicket. It consists of a ListView > that lists all the TLD's, and a checkbox so you can order if the domain is > available. To make it a bit fancy, I iterate over the list after > construction, and set a "TldChecker" to work on each tld. Basically, it > performs a whois search, and sets some boolean values on the tld after it's > finished. > > Then I have a AbstractAjaxTimerBehavior running every 500 milliseconds > that adds any tld that has finished the whois-search to the > AjaxRequestTarget. This works most of the times, but on some occations, > Wicket will complain about a mismatch in the hierachy. That's obviously not > the case, so I suspect the threading causes some kind of strange situation. > The pertinent code: > > /* The list */ > final List tlds = Collections.synchronizedList(getTlds()); > > /* A basic executor to spin off the threads */ > Executor e = new Executor() { >public void execute(Runnable command) { >new Thread(command).start(); >} > }; > > /* Iterate over the tlds and instantiate a TldChecker */ > for(Tld tld : tlds) >e.execute(new TldChecker(tld, query)); // Args could be for > instance "com", and "mydomain" > > > /* The ListView - simplified */ > results = new ListView("results", tlds) { >protected void populateItem(ListItem item) { >final Tld tld = (Tld) item.getModelObject(); >item.setOutputMarkupId(true); > >/* Link to show who owns the domain if it's taken */ >item.add(new Link("taken") { >public boolean isVisible() { >return tld.getDone() && !tld.getAvailable() > && !tld.getIllegal(); >} >public void onClick() { >setResponsePage(new WhoisPage(query)); >} >}.setPopupSettings(new PopupSettings())); > >/* Checkbox so it can be ordered */ >item.add(new CheckBox("selected", new PropertyModel(tld, > "selected")) { >public boolean isVisible() { >return (tld.getDone() && > tld.getAvailable()); >} >}); > >/* Some other fields, showing spinner while !tld.getDone() > etc */ >} > } > > > /* The timer - it stops when all the TldChekers are finished. 'Published' > means it has been added to the request target */ > add(new AbstractAjaxTimerBehavior(Duration.milliseconds(500)) { >protected void onTimer(AjaxRequestTarget target) { >int running = 0; >synchronized (tlds) { >for(int i = 0; i < tlds.size(); i++) { >Tld tld = tlds.get(i); >if(!tld.getDone()) >running++; >if(tld.getDone() && !tld.getPublished()) { >Component theTr = > results.get(String.valueOf(i)); >target.addComponent(theTr); >target.appendJavascript("fadein('" > + theTr.getMarkupId() +"');"); // JQuery Magick, has nothing to do with the > problem, tried to remove it >tld.setPublished(true); >} >} >} >if(running == 0) >stop(); >} > }); > > /* The HTML for the ListView */ > > wicket:id="domain">Domain > > >taken > > > > > Wicket will complain about the checkbox with wicket:id "selected". If I > remove the isVisible() method, it never fails: > > public boolean isVisible() { >return (tld.getDone() && tld.getAvailable()); > } > > What might I be doing wrong? Any idea? :)) > > Here's Wicket's complaint at the time of the error: > > 13:13:39,186 ERROR [RequestCycle] [btpool0-1 - > /?wicket:interface=:5:searchInput
Re: integrating extjs with wicket
Hi Paulo, Did you have sucess integrating Ext.form.FormPanel ??? Can you upload Wicket-Extjs integration Test App ? AT 2008/1/9, Paolo Di Tommaso <[EMAIL PROTECTED]>: > > This is really an interesting topic! > > I've made some Wicket-Extjs integration tests and I haven't found any > particular issues to make them work smoothly together. > > Extjs UI widgets can be created dynamically or can be attach to existing > HTML elements using the element IDs. > > Following the latter approach is quite easy integrate Extjs with Wicket. > > The simplest way I've tried is using a behavior to 'attach' an Extjs > widget > to Wicket component. > > For example: > > public class ExtDateFieldBehavior extends ExtAbstractBehavior{ > > @Override > String getExtjsClassName() { > return "Ext.form.DateField"; > } > > } > > public abstract class ExtAbstractBehavior extends AbstractBehavior { > > > /** > * Used to add all common Extjs required JavaScript and CSS resources > */ > @Override > public void bind(Component component) { > if( component == null ) throw new > IllegalArgumentException("Argument > cannot be null"); > component.setOutputMarkupId(true); > component.add(HeaderContributor.forCss( Extjs.Css.EXT_ALL )); > component.add(HeaderContributor.forJavaScript( Extjs.Js.EXT_BASE > )); > component.add(HeaderContributor.forJavaScript( > Extjs.Js.EXT_ALL_DEBUG )); > } > > > abstract String getExtjsClassName(); > > abstract String getOptions(); > > @Override > public void onRendered( Component component ) { > /* create a copy of options */ > Config options = new Config( config ); > /* initialization */ > config(component,options); > /* get the string version */ > String sConfig = Extjs.serialize(options); > > String extjs = "new " + getExtjsClassName() + "(" + getOptions() + > ");"; > //TODO log here > > Response r = component.getResponse(); > r.write( JavascriptUtils.SCRIPT_OPEN_TAG ); > r.write( extjs ); > r.write( JavascriptUtils.SCRIPT_CLOSE_TAG ); > } > } > > > That's all! > > Obviously this is just a simple test but it works and can be extended > easily > for other widgets. > > > What I've found not trivial is to pass/define the Extjs widget > property/configuration in a easy/elegant way. > > Would be interesting discuss this... > > > -- Paolo > > > > > > On Jan 9, 2008 6:25 PM, Jeremy Fergason <[EMAIL PROTECTED]> wrote: > > > wicket seems to provide some nice management classes like TextField, > that > > do > > things like set the value for you, I don't see how to integrate this > with > > a > > javascript solution like ExtJs which does not use an > ... > > tag. It could be something very simple and I am just missing it, if so > > please point me in the right direction. > > > > Thanks! > > > > On Jan 9, 2008 10:19 AM, Martijn Dashorst <[EMAIL PROTECTED]> > > wrote: > > > > > What is keeping you from building it? > > > > > > Martijn > > > > > > On Jan 9, 2008 6:15 PM, Reinout van Schouwen <[EMAIL PROTECTED]> > wrote: > > > > > > > > Op woensdag 09-01-2008 om 09:07 uur [tijdzone -0700], schreef Jeremy > > > > Fergason: > > > > > > > > > I'm just starting out with wicket and I would like to use a > > > client-side > > > > > javascript library--ExtJs, to enhance the end user experience. > > > > > > > > +1 > > > > > > > > At my company we use Ext2 and are very enthousiastic about it. > > > > I want to move us from Struts to Wicket but lack of support for Ext2 > > > > would be a roadblock... > > > > > > > > -- > > > > Reinout van Schouwen > > > > > > > > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > -- > > > Buy Wicket in Action: http://manning.com/dashorst > > > Apache Wicket 1.3.0 is released > > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0 > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- AT(R)
Re: 1.3.4 Release
i guess in 1 or 2 weeks for now just use a snapshot On Mon, Apr 21, 2008 at 3:25 PM, Ricky <[EMAIL PROTECTED]> wrote: > How soon ? I am looking for fixes they have done to Autocomplete Text > Field > which is not working in IE, just a rough estimate ... a month ? > > On Mon, Apr 21, 2008 at 9:22 AM, Maurice Marrink <[EMAIL PROTECTED]> > wrote: > > > nope :) > > > > 1.4-m1 will be soon though. > > > > Maurice > > > > On Mon, Apr 21, 2008 at 3:15 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > Is 1.3.4 release out yet? > > > > > > Rick > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
ListView and Threading
Hi, I've created a "domain search" panel for Wicket. It consists of a ListView that lists all the TLD's, and a checkbox so you can order if the domain is available. To make it a bit fancy, I iterate over the list after construction, and set a "TldChecker" to work on each tld. Basically, it performs a whois search, and sets some boolean values on the tld after it's finished. Then I have a AbstractAjaxTimerBehavior running every 500 milliseconds that adds any tld that has finished the whois-search to the AjaxRequestTarget. This works most of the times, but on some occations, Wicket will complain about a mismatch in the hierachy. That's obviously not the case, so I suspect the threading causes some kind of strange situation. The pertinent code: /* The list */ final List tlds = Collections.synchronizedList(getTlds()); /* A basic executor to spin off the threads */ Executor e = new Executor() { public void execute(Runnable command) { new Thread(command).start(); } }; /* Iterate over the tlds and instantiate a TldChecker */ for(Tld tld : tlds) e.execute(new TldChecker(tld, query)); // Args could be for instance "com", and "mydomain" /* The ListView - simplified */ results = new ListView("results", tlds) { protected void populateItem(ListItem item) { final Tld tld = (Tld) item.getModelObject(); item.setOutputMarkupId(true); /* Link to show who owns the domain if it's taken */ item.add(new Link("taken") { public boolean isVisible() { return tld.getDone() && !tld.getAvailable() && !tld.getIllegal(); } public void onClick() { setResponsePage(new WhoisPage(query)); } }.setPopupSettings(new PopupSettings())); /* Checkbox so it can be ordered */ item.add(new CheckBox("selected", new PropertyModel(tld, "selected")) { public boolean isVisible() { return (tld.getDone() && tld.getAvailable()); } }); /* Some other fields, showing spinner while !tld.getDone() etc */ } } /* The timer - it stops when all the TldChekers are finished. 'Published' means it has been added to the request target */ add(new AbstractAjaxTimerBehavior(Duration.milliseconds(500)) { protected void onTimer(AjaxRequestTarget target) { int running = 0; synchronized (tlds) { for(int i = 0; i < tlds.size(); i++) { Tld tld = tlds.get(i); if(!tld.getDone()) running++; if(tld.getDone() && !tld.getPublished()) { Component theTr = results.get(String.valueOf(i)); target.addComponent(theTr); target.appendJavascript("fadein('" + theTr.getMarkupId() +"');"); // JQuery Magick, has nothing to do with the problem, tried to remove it tld.setPublished(true); } } } if(running == 0) stop(); } }); /* The HTML for the ListView */ Domain taken Wicket will complain about the checkbox with wicket:id "selected". If I remove the isVisible() method, it never fails: public boolean isVisible() { return (tld.getDone() && tld.getAvailable()); } What might I be doing wrong? Any idea? :)) Here's Wicket's complaint at the time of the error: 13:13:39,186 ERROR [RequestCycle] [btpool0-1 - /?wicket:interface=:5:searchInputPanel:searchInputForm::IFormSubmitListener::] The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [MarkupContainer [Component id = selected, page = no.tornado.web.modules.domorder.DomainSearchPage, path = 6:searchResultPanel:f:results:0:selected.DomainSearchResultPanel$3$2, isVisible = true, isVersioned = false]] org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [MarkupContainer [Component id = selected, page = no.tornado.web.modules.domorder.DomainSearchPage, path = 6:searchResultPanel:f:results:0:selected.DomainSearchResultPanel$3$2, isVisible = true, isVersioned = fal
Re: interesting scriptaculous usage conundrum
On Mon, Apr 21, 2008 at 07:18:57AM -0700, Doug Donohoe wrote: > > So I added an attribute modifier to the loginPanel: > > new AttributeModifier("style", true, new Model("display: none") > > This corrected the 'flash' problem. But introduced another problem. Now, > when the form is submitted with an error, when the page is redisplayed, the > form is hidden (because the attribute modifier is still in effect). > One of the great things about models is that they facilitate lazy evaluation. Try this: new AttributeModifier("style", true, new AbstractReadOnlyModel() { public Object getObject() { return hidePanel ? "display: none" : ""; } }); You can then toggle whether "display:none" is rendered by toggling the hidePanel field of your class. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Implementing AutoComplete Issue
this is fixed for 1.3.4 Gerolf On Mon, Apr 21, 2008 at 3:50 PM, Ricky <[EMAIL PROTECTED]> wrote: > Hi, > > I have implemented autocomplete using 1.3.3. examples in wicket stuff. It > is working fine in firefox, however doesnt work in IE. Is there a fix for > this ? Is scriptaculous thing the answer ? if so can someone point me to > the > example source or give me a rough idea ? > > > thanks > Rick >
interesting scriptaculous usage conundrum
I am trying to implement a login section which appears (inserted into he page) when a user clicks a [login] link at the top of the page. I have this working fine with AjaxFallbackLink which turns visibility on/off based on the link. The pertinent code is as follows: Link link = new AjaxFallbackLink("loginLink", new Model(loginText)) { @Override public void onClick(final AjaxRequestTarget target) { loginPanel.setVisible(!loginPanel.isVisible()); loginLabel.setModelObject(loginPanel.isVisible() ? cancelText : loginText); if (target != null) { target.addComponent(loginPanel); target.addComponent(loginLabel); } } }; Everything works great. Next I wanted to use the scriptaculous "blind down" effect to unveil the login box instead of just appearing all at once. So I added a line which did this when displaying the panel: target.appendJavascript(new BlindDown(loginPanel).toJavascript()); Where BlindDown is an implementation of the wicket-stuff scriptaculous effect. This worked with one issue: the login panel "flashed", went away and then was revealed. This is because the login panel needs to be initially hidden (style="display: none") for the 'blind down' to be visually correct. So I added an attribute modifier to the loginPanel: new AttributeModifier("style", true, new Model("display: none") This corrected the 'flash' problem. But introduced another problem. Now, when the form is submitted with an error, when the page is redisplayed, the form is hidden (because the attribute modifier is still in effect). I tried two ways to turn off the AttributeModifier: 1) remove it in an onAfterRender call, but I got a exception regarding modifying component tree during render. I couldn't find a way to actually remove it after render due to all the 'final' methods. However, this may not have worked anyway for the same reason #2 below didn't work. 2) call setEnabled(false) on the AttributeModifier in the onAfterRender() call, but that seems to have no effect. I assume this is because of how the page is cached internally in wicket. I'm not 100% certain how wicket redisplays a page with a form without re-rendering the page, but apparently it doesn't revisit it's attribute modifiers. So the question is, how to solve this problem. I essentially have a case where I need to have a "one-time-only" attribute modifier. When the component is sent back in an Ajax request, it needs to be set, but otherwise not set. Any suggestions on how to solve this? Thanks, -Doug -- View this message in context: http://www.nabble.com/interesting-scriptaculous-usage-conundrum-tp16807943p16807943.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Implementing AutoComplete Issue
the scriptaculous autocomplete component does work on all known versions of IE and firefox (and safari too). it's a very simple API to use. here's an example of how to use it in your app. http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior On Mon, Apr 21, 2008 at 8:50 AM, Ricky <[EMAIL PROTECTED]> wrote: > Hi, > > I have implemented autocomplete using 1.3.3. examples in wicket stuff. It > is working fine in firefox, however doesnt work in IE. Is there a fix for > this ? Is scriptaculous thing the answer ? if so can someone point me to > the > example source or give me a rough idea ? > > > thanks > Rick >
Implementing AutoComplete Issue
Hi, I have implemented autocomplete using 1.3.3. examples in wicket stuff. It is working fine in firefox, however doesnt work in IE. Is there a fix for this ? Is scriptaculous thing the answer ? if so can someone point me to the example source or give me a rough idea ? thanks Rick
Re: Why does the method getObject of IModel return Object but not Serializable?
The IModel contract allows models to return any type of object. This could be a Serializable object that is retained in the model at all time (like Model does) or a non-serializable object that is (re)created at every invocation of getObject. This non serializable object would obviously not be stored in the session. Maurice On Mon, Apr 21, 2008 at 2:47 PM, Vitaly Tsaplin <[EMAIL PROTECTED]> wrote: >Hi everyone, > >I am going to ask probably the most stupid question ever :) Why > does the method getObject of IModel return Object but not > Serializable? I suspect a model object is meant to be always stored in > a session? > >Vitaly > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 1.3.4 Release
Sorry, can't possibly give you an estimate. There are still a good number of bugs that need to be addressed. So we haven't even discussed a timeframe yet. Maurice On Mon, Apr 21, 2008 at 3:25 PM, Ricky <[EMAIL PROTECTED]> wrote: > How soon ? I am looking for fixes they have done to Autocomplete Text Field > which is not working in IE, just a rough estimate ... a month ? > > > > On Mon, Apr 21, 2008 at 9:22 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > nope :) > > > > 1.4-m1 will be soon though. > > > > Maurice > > > > On Mon, Apr 21, 2008 at 3:15 PM, Ricky <[EMAIL PROTECTED]> wrote: > > > Is 1.3.4 release out yet? > > > > > > Rick > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-minis release?
I think Igor is officially project lead for the mini's but i doubt he is planning a release anytime soon. Not that there are that many bugs open, it's just a matter of demand :) Maurice On Mon, Apr 21, 2008 at 2:45 PM, Hoover, William <[EMAIL PROTECTED]> wrote: > Does anyone know how close we are to a release of wicket-minis? > http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-minis/ > shows 1.3.0-SNAPSHOT. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 1.3.4 Release
How soon ? I am looking for fixes they have done to Autocomplete Text Field which is not working in IE, just a rough estimate ... a month ? On Mon, Apr 21, 2008 at 9:22 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > nope :) > > 1.4-m1 will be soon though. > > Maurice > > On Mon, Apr 21, 2008 at 3:15 PM, Ricky <[EMAIL PROTECTED]> wrote: > > Is 1.3.4 release out yet? > > > > Rick > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: 1.3.4 Release
nope :) 1.4-m1 will be soon though. Maurice On Mon, Apr 21, 2008 at 3:15 PM, Ricky <[EMAIL PROTECTED]> wrote: > Is 1.3.4 release out yet? > > Rick > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form ListView validator
Hi, I encountered a problem with wicket form validation, that I am not able to solve myself. The situation is that I have some form with some TextFields. These TextFields are generated from a ListView and represents ordering of user applications. I added to each TextField the NumberValidator. That's easy. But a user is asked to fill the TextFields with number and the number must be in interval from zero to the number of his applications and the numbers cannot be repeated. I am using wicket 1.3.0. I saw in previous versions that there was some validator, that can be filled by numerous of FormComponent object and then this validator can work with this collection. I thought this perfect match my needs. But I am not able to find this type of Validator in wicket 1.3.0. Is this type deprecated? Is there any alternative validator? Or should I override AbstractValidator and make one on my own? If anybody solved the same problem I will be very glad for any snippet of code. I realy dont know how to Validate the ListView I have. Thanks for your advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
1.3.4 Release
Is 1.3.4 release out yet? Rick
Re: Is it possible to disable dates in Wicket Date Picker ?
public class MyDatePicker extends DatePicker { private static final long serialVersionUID = 1L; private static final SimpleDateFormat format = new SimpleDateFormat("MM/dd/"); @SuppressWarnings("unchecked") @Override protected void configure(Map widgetProperties) { super.configure(widgetProperties); // set minimal date Date minDate = getMinDate(); widgetProperties.put("mindate", format.format(minDate)); // set maximal date Date maxDate = getMaxDate(); widgetProperties.put("maxdate", format.format(maxDate)); } } Gerolf On Mon, Apr 21, 2008 at 3:02 PM, nanotech <[EMAIL PROTECTED]> wrote: > > Hi All, > > Is it possible to programatically disable dates that have passed in > wicket's > date picker. for exampleI want to disable all the dates before today's > day. > > Can someone please give an example? > > Thanks, > ~ R > -- > View this message in context: > http://www.nabble.com/Is-it-possible-to-disable-dates-in-Wicket-Date-Picker---tp16807706p16807706.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Is it possible to disable dates in Wicket Date Picker ?
Hi All, Is it possible to programatically disable dates that have passed in wicket's date picker. for exampleI want to disable all the dates before today's day. Can someone please give an example? Thanks, ~ R -- View this message in context: http://www.nabble.com/Is-it-possible-to-disable-dates-in-Wicket-Date-Picker---tp16807706p16807706.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]