Re: Models, and preventing obsolete objects being manipulated by Ajax requests
Each component can have as many models it needs. For an example see ListChoice which has one model for its selection and a second one for the available choices. Wicket's Component base class has a default model, which offers convenience (it's automatically detached after request) and some other goodies (i.e. inherited models). Read more here: https://cwiki.apache.org/WICKET/working-with-wicket-models.html >Page#setDefaultModel( new PropertyModel( this, "user" ) ); And then in on* methods, >I should use getPage().getDefaultModelObject(). Models offer no magic: Doing the above versus just directly accessing the page's property doesn't change much (depending on what "this" is referring to). >Is that correct, or should I look for some other bug in my code? Your components are probably holding references to different User objects. Cleaning up your code using models might help. Sven On 09/29/2012 05:26 AM, Ondrej Zizka wrote: Hi, I have observed that if I simply refer to Page object's (say, User) member field everywhere, sometimes I get a strange behavior: Ajax requests update the User object properly. But then I have non-ajax save (submit) button, and this one actually saves the old state of the object, before editations. I get it I am supposed to use models in this case, like, Page#setDefaultModel( new PropertyModel( this, "user" ) ); And then in on* methods, I should use getPage().getDefaultModelObject(). Is that correct, or should I look for some other bug in my code? And also, what does the "default" mean in the methods names getDefaultModel*() ? Can the page/component have multiple models? Thanks, Ondra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: edit label w/o ajax
Hi, I don't like switching a and ... so I take (IMO) better approach: Style the or a so it looks like a label - i.e. no border, transparent background, inherited font. And disable/re-enable this the style on focus/blur. Very easy and works. Ondra On Fri, 2012-09-28 at 09:28 +0200, rpere...@ok.de wrote: > > Hello, > does it exist an edit label component without ajax? > I mean, switching from label to field without ajax, but an ajax request when > switching it back. > > Regards, > Rodrigo P.
Re: form with arbitrary number of fields
On Fri, 2012-09-28 at 13:37 +0530, vineet semwal wrote: > sorry somehow i didn't type last message correctly :) > use a repeater and you can add your formcoponents to its items ,see > listview/dataview FYC, http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/repeater/RepeatingView.html > > On Fri, Sep 28, 2012 at 1:35 PM, vineet semwal > wrote: > > use a repeater which and yo can attach your formcomponents to items > > > > On Fri, Sep 28, 2012 at 8:18 AM, Steve Swinsburg > > wrote: > >> Hi all, > >> > >> I have a form that allows users to add an arbitrary number of fields, for > >> example keywords for an item where there could be multiple. > >> > >> Up until now I have been processing my form where the fields are known and > >> map directly to a model. However I'm unsure as to how this mapping works, > >> for example having two or more keywords for one item. Would the property > >> in the backing model be a list for this item? Rather than a string for > >> example? > >> > >> Are there any examples of a similar dynamic form? > >> > >> cheers, > >> Steve > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > > > > > > > > -- > > regards, > > > > Vineet Semwal > > >
Re: Problem in implementing user confirm modal while deleting something..
To add my 2 cents: Confirmatory modal dialogs suck. I rather put a hidden bright red button next to the one which deletes, and on click, I show this red button which actually deletes. So the user 1) doesn't have to travel the mouse around the page too far 2) can't accidentally press space or enter to confirm. 3) With AjaxFallback..., it doesn't need JS. Ondra On Fri, 2012-09-28 at 22:32 -0500, Jeremy Thomerson wrote: > On Fri, Sep 28, 2012 at 10:21 AM, kshitiz wrote: > > > *Last cause: 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. [Component id = message]* > > > > > The error message says it all. Somewhere you have a component added to > your java hierarchy that is not in the markup. Look for "message" in your > codebase. If you can't find it, put a breakpoint in the Component class > constructor with a conditional if the ID is "message". Find where that > component is being created but not referenced in the markup. > > You can also turn this check off, but that's not a fix. The message is > indicative of a problem. If you do decide to turn the check off it's > somewhere in the app's settings (debug or markup - can't remember) - look > for component use check. >
Re: Found IExceptionMapper // Re: Redirecting on Exception - some "ExceptionMapper"? Also for exceptions outside app's code
On Thu, 2012-09-27 at 09:58 +0300, Martin Grigorov wrote: > > But still: > > I only get the exception. Ok, it has a stacktrace. But for convenience, > > is it possible that I could get the component it came from? > > No > But what would you do if you know that SomePanel did it ? I would redirect to that page, and inform that processing this or that failed. Of course, the app shouldn't leak exceptions like that and they should be caught at right places... But that's a perfect state, and until that's reached, this could make the app a bit more robust. But having just the exception is good enough. Ondra
Re: Problem in implementing user confirm modal while deleting something..
On Fri, Sep 28, 2012 at 10:21 AM, kshitiz wrote: > *Last cause: 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. [Component id = message]* > The error message says it all. Somewhere you have a component added to your java hierarchy that is not in the markup. Look for "message" in your codebase. If you can't find it, put a breakpoint in the Component class constructor with a conditional if the ID is "message". Find where that component is being created but not referenced in the markup. You can also turn this check off, but that's not a fix. The message is indicative of a problem. If you do decide to turn the check off it's somewhere in the app's settings (debug or markup - can't remember) - look for component use check. -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*
Models, and preventing obsolete objects being manipulated by Ajax requests
Hi, I have observed that if I simply refer to Page object's (say, User) member field everywhere, sometimes I get a strange behavior: Ajax requests update the User object properly. But then I have non-ajax save (submit) button, and this one actually saves the old state of the object, before editations. I get it I am supposed to use models in this case, like, Page#setDefaultModel( new PropertyModel( this, "user" ) ); And then in on* methods, I should use getPage().getDefaultModelObject(). Is that correct, or should I look for some other bug in my code? And also, what does the "default" mean in the methods names getDefaultModel*() ? Can the page/component have multiple models? Thanks, Ondra
Re: HybridUrlCodingStrategy in Wicket 1.5
I'd like to clarify that we have a lot of pages mounted with HybridUrlCodingStrategy, so I need to implement it in 1.5 without knowing the names of parameters for each page. Thanks On Fri, Sep 28, 2012 at 4:47 PM, Alec Swan wrote: > Hello, > > What's the best way to implement HybridUrlCodingStrategy in Wicket 1.5? > Also, is there a Wicket utility method that generates a URL given a > base URL and page parameters? > > Thanks, > > Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Centralizing ajax inline javascript
actually i have the elegant solution for your problem in 6.x ,i didn't recommend it before because you are on 1.4 i wrote Quickview and QuickGridView ,the whole project is available at https://github.com/vineetsemwal/quickview including examples. the way of using QuickView is almost like DataView the way of using QuickGridView is almost like Gridview what they offer is they can add/remove new items/rows without the need to repaint the whole repeater.i have written a navigator and a scroll behavior for that so on demand/scroll you can add new rows.this in working is like how new rows are added on demand/scroll in social networking sites.a user practically doesn't have to learn anything. the problem is i don't want to port/support any version less than 6.x On Fri, Sep 28, 2012 at 8:34 PM, lukuperman wrote: > Hi Vineet. I knew someone would ask. Lots of components right? Yes, I agree. > The component tree is giving us a hard time with performance in general > (around 5 minutes to process) and stack overflows when serializing, etc. But > focusing back to my original question, unfortunately the business > requirement remains. Pagination is not allowed. The page is currently loaded > at once, but lazy loading is certainly an option if end result is the same. > I'll search for ajax scroll behaviors. If you happen to have used something > like that with Wicket and have a link handy, it would be appreciated. > > Thanks for contributing on my thread > > Lucas Kuperman > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Centralizing-ajax-inline-javascript-tp4652499p4652505.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Centralizing ajax inline javascript
Hi Vineet. I knew someone would ask. Lots of components right? Yes, I agree. The component tree is giving us a hard time with performance in general (around 5 minutes to process) and stack overflows when serializing, etc. But focusing back to my original question, unfortunately the business requirement remains. Pagination is not allowed. The page is currently loaded at once, but lazy loading is certainly an option if end result is the same. I'll search for ajax scroll behaviors. If you happen to have used something like that with Wicket and have a link handy, it would be appreciated. Thanks for contributing on my thread Lucas Kuperman -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Centralizing-ajax-inline-javascript-tp4652499p4652505.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Centralizing ajax inline javascript
Yes, I think the AbstractDefaultAjaxBehavior could look to something like: public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.renderJavaScript("function boup(id) { " + this.getCallbackScript() + " }", "my-script-id"); //TODO: where (id = 10) } protected CharSequence getCallbackScript() { return this.generateCallbackScript("wicketAjaxGet('" + this.getCallbackUrl() + "&id=' + id"); //warning, do not close script with ")"! } protected void respond(AjaxRequestTarget target) { final IRequestParameters parameters = RequestCycle.get().getRequest().getQueryParameters(); int id = parameters.getParameterValue("id").toInt(); //TODO: do something with id } On Fri, Sep 28, 2012 at 2:52 PM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Hi, > > I would do the following > > 1- attach an AbstractDefaultAjaxBehavior to the table > 2- Use that behavior as a context for making AJAX call-backs (i.e. generate > a URL to it amd pas it to the client side). > 3- On client side use some jquery (or similar machinery) to generate > wickeAjaxGet(URL in step 2) passing as extra parameter the info you need > > This way you reduce the amount of "code" to be streamed back to the client > as well as the "foot-print" on server side. This approach should work in > any of the current version of wicket (AFAIK). > > On Fri, Sep 28, 2012 at 5:41 AM, lukuperman > wrote: > > > Hello all, I am working on an application that was built with Wicket > > 1.4.15. > > It has to show a table with an AjaxCheckBox on each cell. Most of the > final > > html size is because of the inline ajax behavior on each cb (ie 20Mb for > a > > 200x200 table). Leaving aside the fact of rendering big tables (which is > > imposed by business), can you give me some hints or ideas on how can I > > decrease final html size maintaining ajax behavior? For example, how can > I: > > > > -centralize the javascript and make checkboxes call it passing the > minimum > > parameters needed (id, etc) > > -or event registration, without migrating to Wicket 6 (not allowed to) > > -some other way? > > > > Thank you! > > Lucas > > > > > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/Centralizing-ajax-inline-javascript-tp4652499.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > -- > Regards - Ernesto Reinaldo Barreiro > Antilia Soft > http://antiliasoft.com >
Re: Centralizing ajax inline javascript
assuming you are using a repeater say dataview/gridview,think about that in this way 200*200==40k items of repeater,are you rendering that number of items at once? i would have used a small table with navigator or some ajax scroll behavior .. On Fri, Sep 28, 2012 at 6:11 PM, lukuperman wrote: > Hello all, I am working on an application that was built with Wicket 1.4.15. > It has to show a table with an AjaxCheckBox on each cell. Most of the final > html size is because of the inline ajax behavior on each cb (ie 20Mb for a > 200x200 table). Leaving aside the fact of rendering big tables (which is > imposed by business), can you give me some hints or ideas on how can I > decrease final html size maintaining ajax behavior? For example, how can I: > > -centralize the javascript and make checkboxes call it passing the minimum > parameters needed (id, etc) > -or event registration, without migrating to Wicket 6 (not allowed to) > -some other way? > > Thank you! > Lucas > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Centralizing-ajax-inline-javascript-tp4652499.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1.5 -> 6 wheres org.apache.wicket.ajax.IAjaxCallDecorator?
thanks everyone.. 2012/9/28 Timo Schmidt > On Fri 28.09.2012 14:34, nino martinez wael wrote: > > So where is it? What should I do ? > > > > I could not find anything about it here: > > > https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-Refactorings > > See > > https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax > espcially the part about AjaxRequestAttributes. > > -Timo > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Best regards / Med venlig hilsen Nino Martinez
Centralizing ajax inline javascript
Hello all, I am working on an application that was built with Wicket 1.4.15. It has to show a table with an AjaxCheckBox on each cell. Most of the final html size is because of the inline ajax behavior on each cb (ie 20Mb for a 200x200 table). Leaving aside the fact of rendering big tables (which is imposed by business), can you give me some hints or ideas on how can I decrease final html size maintaining ajax behavior? For example, how can I: -centralize the javascript and make checkboxes call it passing the minimum parameters needed (id, etc) -or event registration, without migrating to Wicket 6 (not allowed to) -some other way? Thank you! Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Centralizing-ajax-inline-javascript-tp4652499.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1.5 -> 6 wheres org.apache.wicket.ajax.IAjaxCallDecorator?
On Fri 28.09.2012 14:34, nino martinez wael wrote: > So where is it? What should I do ? > > I could not find anything about it here: > https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-Refactorings See https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax espcially the part about AjaxRequestAttributes. -Timo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1.5 -> 6 wheres org.apache.wicket.ajax.IAjaxCallDecorator?
Read carefully in the Ajax related paragraph. On Fri, Sep 28, 2012 at 3:34 PM, nino martinez wael wrote: > So where is it? What should I do ? > > I could not find anything about it here: > https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-Refactorings > > > -- > Best regards / Med venlig hilsen > Nino Martinez -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1.5 -> 6 wheres org.apache.wicket.ajax.IAjaxCallDecorator?
IAjaxCallListener replaced it, see here https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax On Fri, Sep 28, 2012 at 6:04 PM, nino martinez wael wrote: > So where is it? What should I do ? > > I could not find anything about it here: > https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-Refactorings > > > -- > Best regards / Med venlig hilsen > Nino Martinez -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: edit label w/o ajax
i just checked AjaxEditableLabel ,it's pretty flexible,you can override new label which have your custom non-ajax behavior added to it .the behavior can use render javascript which does what ernesto suggested ie. makes textfield/editor visible on click On Fri, Sep 28, 2012 at 3:10 PM, vineet semwal wrote: > sorry,i just realized i have misread the post ,follow what Ernesto > recommended.. > > On Fri, Sep 28, 2012 at 1:32 PM, vineet semwal > wrote: >> hi! >> see AjaxEditableLabel >> >> On Fri, Sep 28, 2012 at 12:58 PM, wrote: >>> >>> Hello, >>> does it exist an edit label component without ajax? >>> I mean, switching from label to field without ajax, but an ajax request >>> when switching it back. >>> >>> Regards, >>> Rodrigo P. >> >> >> >> -- >> thank you, >> >> regards, >> Vineet Semwal >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> > > > > -- > regards, > > Vineet Semwal -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: edit label w/o ajax
sorry,i just realized i have misread the post ,follow what Ernesto recommended.. On Fri, Sep 28, 2012 at 1:32 PM, vineet semwal wrote: > hi! > see AjaxEditableLabel > > On Fri, Sep 28, 2012 at 12:58 PM, wrote: >> >> Hello, >> does it exist an edit label component without ajax? >> I mean, switching from label to field without ajax, but an ajax request when >> switching it back. >> >> Regards, >> Rodrigo P. > > > > -- > thank you, > > regards, > Vineet Semwal > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: get new value of drop down inside vieworedit on onchange
try ajaxformcomponentupdatingbehvior with change event On Fri, Sep 28, 2012 at 1:15 PM, cosmindumy wrote: > Hi, > I want to get the new selected of a dropdown wich is inside a vieworedit > component. > Attached an ajax behaviour on onchange event, but cannot get the new vale. > Do not need model object. drop down value is enough, but it is still the old > valuel. > I setted on selection changed notification. > > Thanks. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/get-new-value-of-drop-down-inside-vieworedit-on-onchange-tp4652479.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: form with arbitrary number of fields
sorry somehow i didn't type last message correctly :) use a repeater and you can add your formcoponents to its items ,see listview/dataview On Fri, Sep 28, 2012 at 1:35 PM, vineet semwal wrote: > use a repeater which and yo can attach your formcomponents to items > > On Fri, Sep 28, 2012 at 8:18 AM, Steve Swinsburg > wrote: >> Hi all, >> >> I have a form that allows users to add an arbitrary number of fields, for >> example keywords for an item where there could be multiple. >> >> Up until now I have been processing my form where the fields are known and >> map directly to a model. However I'm unsure as to how this mapping works, >> for example having two or more keywords for one item. Would the property in >> the backing model be a list for this item? Rather than a string for example? >> >> Are there any examples of a similar dynamic form? >> >> cheers, >> Steve >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> > > > > -- > regards, > > Vineet Semwal -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: form with arbitrary number of fields
use a repeater which and yo can attach your formcomponents to items On Fri, Sep 28, 2012 at 8:18 AM, Steve Swinsburg wrote: > Hi all, > > I have a form that allows users to add an arbitrary number of fields, for > example keywords for an item where there could be multiple. > > Up until now I have been processing my form where the fields are known and > map directly to a model. However I'm unsure as to how this mapping works, for > example having two or more keywords for one item. Would the property in the > backing model be a list for this item? Rather than a string for example? > > Are there any examples of a similar dynamic form? > > cheers, > Steve > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: edit label w/o ajax
hi! see AjaxEditableLabel On Fri, Sep 28, 2012 at 12:58 PM, wrote: > > Hello, > does it exist an edit label component without ajax? > I mean, switching from label to field without ajax, but an ajax request when > switching it back. > > Regards, > Rodrigo P. -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: edit label w/o ajax
I don't know if it already exist but I would do the following to implement it 1-Make a component that contain both a label + plus the edit field 2-Edit field and View component are always present but visibility is toggled via JavaScript (at client side). 4-When user choose edit, view field is made hidden via JS and edit field is shown (also via JS) 4-When user finish editing, edit field is submited via AJAX, then edit field is hidden, via JS, and view field is shown (maybe returned as JS "action" on AJAX call). This should not be that difficult to implement (I guess). On Fri, Sep 28, 2012 at 9:28 AM, wrote: > > Hello, > does it exist an edit label component without ajax? > I mean, switching from label to field without ajax, but an ajax request > when switching it back. > > Regards, > Rodrigo P. -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com
get new value of drop down inside vieworedit on onchange
Hi, I want to get the new selected of a dropdown wich is inside a vieworedit component. Attached an ajax behaviour on onchange event, but cannot get the new vale. Do not need model object. drop down value is enough, but it is still the old valuel. I setted on selection changed notification. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/get-new-value-of-drop-down-inside-vieworedit-on-onchange-tp4652479.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
edit label w/o ajax
Hello, does it exist an edit label component without ajax? I mean, switching from label to field without ajax, but an ajax request when switching it back. Regards, Rodrigo P.