Re: Form looses data

2011-08-12 Thread Mike Mander
That's right. But the only consequence here is that he has to fill out this (formerly invalid) field again. I know that this is not the default intention of form behavior. But the opposite of loosing all data is much more expensive because 10% (maybe more) of willing customers buy elsewhere then

Re: Form looses data

2011-08-12 Thread Igor Vaynberg
heh, this is a reallly bad idea. suppose you have textfield and the user enters "a". that would result in a conversion exception represented by the feedback message - which you cleared. so when you call updatemodels() you will get null set on the model... -igor On Fri, Aug 12, 2011 at 7:28 AM, M

Re: Form looses data

2011-08-12 Thread Mike Mander
With an annotation on my button i can go over the name cluttering issue import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.anno

Re: Form looses data

2011-08-12 Thread Mike Mander
onValidate seems a way to go. It leads to a not soo reusable solution like your ReuseManager but it works. I simply override onConfigure in Form and did that @Override protected void onValidate() { super.onValidate(); if (findSubmittingBut

Re: Form looses data

2011-08-12 Thread Martin Makundi
It must be manhandled. I am not sure though, if it can be automated. A wizard is almost like that, but again, you canot assume all user interactions to be same. However, it would be nice to maybe register components to a conversation-scoped reuseManager instead of handling all that on a case-by-cas

Re: Form looses data

2011-08-12 Thread Bruno Borges
I don't think so. Its nature already provides that. Just keep an object instantiated somewhere. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Fri, Aug 12, 2011 at 10:21 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > I think wicket needs some sort of "conversatio

Re: Form looses data

2011-08-12 Thread Martin Makundi
I think wicket needs some sort of "conversation" scope like Seam does... that should cover it. ** Martin 2011/8/12 Mike Mander : > But if wicket should support it out of the box there is maybe another way. > If we could get a method onBeforeFormSubmit() in form there would be > an access point to

Re: Form looses data

2011-08-12 Thread Mike Mander
I checked Form. There is an onValidate. Maybe i can clear the feedback messages there. Will try it. But if wicket should support it out of the box there is maybe another way. If we could get a method onBeforeFormSubmit() in form there would be an access point to configure validators in all chil

Re: Form looses data

2011-08-12 Thread Mike Mander
But if wicket should support it out of the box there is maybe another way. If we could get a method onBeforeFormSubmit() in form there would be an access point to configure validators in all childs. In default nothing is to do - means leave form as configured at creation time. If it's nessecary i

Re: Form looses data

2011-08-12 Thread Martin Makundi
AH not to say that I would mind if wicket would handle reusemanager itself.. I wonder if it is there in 1.5? Hmm.. I think a proposal should be added to the whishlist. ** Martin 2011/8/12 Martin Makundi : > The Form way is a quirk way to do it in the first place. You are not > supposed to upd

Re: Form looses data

2011-08-12 Thread Martin Makundi
The Form way is a quirk way to do it in the first place. You are not supposed to update model before validation etc. so you will run into lots of troubles that way. Reusemanager simply works like wicket normally works when you validate and repaint the screen with rawInput values. It just keeps tho

Re: Form looses data

2011-08-12 Thread Mike Mander
Thanks Martin, now it works as expected. I don't have a clue how but it is. I really would be interested in knowing why the reusemanager gets the data and the form not. I think i will start a debugging session at weekend :-) Maybe we should use this scenario and put it in the wiki? Especially

Re: Form looses data

2011-08-12 Thread Martin Makundi
This is how you can do it with reusemanager: HomePage: public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { Form form; add(form = new Form("form")); form.add(WicketSession.get().getReuseManager().rememberOrReuseA

Re: Form looses data

2011-08-12 Thread Mike Mander
That is not working to. I've created a quickstart for this. Scenario is simplified. HomePage gets the data and has two submit buttons. Do i press the "submit" and click back on other page data are present (submitted). Do i press the "invalid submit" and click back on other page data are lost. H

Re: Form looses data

2011-08-12 Thread Martin Makundi
Actually notesField = localNotesfield = TextArea(...) ** Martin 2011/8/12 Martin Makundi : > Hi! > >> i have some questions for usage of this. >> 1. Where do i have to put my instance of reusemanager? > > Where you want to keep the values? What is your "common denominator". > It can be a page or

Re: Form looses data

2011-08-12 Thread Martin Makundi
Hi! > i have some questions for usage of this. > 1. Where do i have to put my instance of reusemanager? Where you want to keep the values? What is your "common denominator". It can be a page or it can be in session... I normally use a Panel and it keeps values of listview items' formcomponents du

Re: Form looses data

2011-08-12 Thread Mike Mander
Hello Martin Makundi, i have some questions for usage of this. 1. Where do i have to put my instance of reusemanager? 2. What is MarkupUtils.fakeRawInput and MarkupUtils.replaceReporter doing? 3. I don't have any persistent id (rowid) for usage. 4. Do you have a working example for me? Thanks Mi

Re: Form looses data

2011-08-11 Thread Martin Makundi
No, if you don't want to update models, you can use reusemanager. It retains the raw unsubmitted values in rawInput fields. ** Martin 2011/8/11 Bruno Borges : > Models must be updated anyway, and that's solved with > form.updateFormComponentModels() > > > *Bruno Borges* > www.brunoborges.com.br >

Re: Form looses data

2011-08-11 Thread Bruno Borges
Models must be updated anyway, and that's solved with form.updateFormComponentModels() *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Thu, Aug 11, 2011 at 12:21 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Is possible using reuseManager, but you need to keep ref

Re: Form looses data

2011-08-11 Thread Martin Makundi
Is possible using reuseManager, but you need to keep reference to it somewhere. http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html ** Martin 2011/8/11 Bruno Borges : > In your GoBack button's submit method (dpf = false), call > >   form.updateForm

Re: Form looses data

2011-08-11 Thread Bruno Borges
In your GoBack button's submit method (dpf = false), call form.updateFormComponentModels() *Bruno Borges * www.brunoborges.com.br +55 21 76727099 On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander wrote: > Am 11.08.2011 16:54, schrieb Bruno Borges: > >> You want to go back to another page wi

Re: Form looses data

2011-08-11 Thread Mike Mander
Am 11.08.2011 16:54, schrieb Bruno Borges: You want to go back to another page without having to fill the form, but you also don't want to lose data you typed in in the previous screen? Seems weird to me. Have you considered to add Ajax update behaviour? onBlur of components, you could update th

Re: Form looses data

2011-08-11 Thread Bruno Borges
You want to go back to another page without having to fill the form, but you also don't want to lose data you typed in in the previous screen? Seems weird to me. Have you considered to add Ajax update behaviour? onBlur of components, you could update the model of each component. *Bruno Borges* www

Re: Form looses data

2011-08-11 Thread Mike Mander
Am 11.08.2011 16:36, schrieb Bruno Borges: Shouldn't you be submitting that button anyway? dfp = true *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander wrote: Hi, i've added a domain model globally to my session. A form for editing this

Re: Form looses data

2011-08-11 Thread Bruno Borges
Shouldn't you be submitting that button anyway? dfp = true *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander wrote: > Hi, > > i've added a domain model globally to my session. > > A form for editing this data is provided on page A. On this i

Form looses data

2011-08-11 Thread Mike Mander
Hi, i've added a domain model globally to my session. A form for editing this data is provided on page A. On this i have 2 submit buttons. One with setDefaultFormProcessing false (to previous page) and one with true (to next step). If i press the main submit (next step | dfp = true) then eve