You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2011/01/17 17:12:27 UTC

Check for User-Modified ("Dirty") Fields before Form Submission

Is there a way in wicket to check if a field has been modified by the user
before submitting the form?

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by Paul Wong <pa...@gmail.com>.
We've done it in our project using a jquery plugin:
http://www.thoughtdelimited.org/dirtyFields/index.cfm


On Tue, Jan 18, 2011 at 3:33 AM, James Carman <ja...@carmanconsulting.com>wrote:

> Couldn't you do this with JavaScript?  Just modify a hidden form field if a
> field is modified by the user?
>
> On Mon, Jan 17, 2011 at 11:23 AM, Pedro Santos <pe...@gmail.com>
> wrote:
>
> > or you can test if the formComponent.getConvertedInput() is different
> from
> > formComponent.getModelObject() at validation time (inside an IValidator
> > implementation)
> >
> > On Mon, Jan 17, 2011 at 2:19 PM, Pedro Santos <pe...@gmail.com>
> wrote:
> >
> > > I guess you want to test if the raw input is different from the model
> > > value.
> > >
> > >
> > > On Mon, Jan 17, 2011 at 2:12 PM, eugenebalt <eu...@yahoo.com>
> > wrote:
> > >
> > >>
> > >> Is there a way in wicket to check if a field has been modified by the
> > user
> > >> before submitting the form?
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
> > >> Sent from the Users forum mailing list archive at Nabble.com.
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > Pedro Henrique Oliveira dos Santos
> > >
> >
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>

Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by James Carman <ja...@carmanconsulting.com>.
Couldn't you do this with JavaScript?  Just modify a hidden form field if a
field is modified by the user?

On Mon, Jan 17, 2011 at 11:23 AM, Pedro Santos <pe...@gmail.com> wrote:

> or you can test if the formComponent.getConvertedInput() is different from
> formComponent.getModelObject() at validation time (inside an IValidator
> implementation)
>
> On Mon, Jan 17, 2011 at 2:19 PM, Pedro Santos <pe...@gmail.com> wrote:
>
> > I guess you want to test if the raw input is different from the model
> > value.
> >
> >
> > On Mon, Jan 17, 2011 at 2:12 PM, eugenebalt <eu...@yahoo.com>
> wrote:
> >
> >>
> >> Is there a way in wicket to check if a field has been modified by the
> user
> >> before submitting the form?
> >>
> >> --
> >> View this message in context:
> >>
> http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
> >> Sent from the Users forum mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by Pedro Santos <pe...@gmail.com>.
or you can test if the formComponent.getConvertedInput() is different from
formComponent.getModelObject() at validation time (inside an IValidator
implementation)

On Mon, Jan 17, 2011 at 2:19 PM, Pedro Santos <pe...@gmail.com> wrote:

> I guess you want to test if the raw input is different from the model
> value.
>
>
> On Mon, Jan 17, 2011 at 2:12 PM, eugenebalt <eu...@yahoo.com> wrote:
>
>>
>> Is there a way in wicket to check if a field has been modified by the user
>> before submitting the form?
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Pedro Henrique Oliveira dos Santos

Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by Pedro Santos <pe...@gmail.com>.
I guess you want to test if the raw input is different from the model value.

On Mon, Jan 17, 2011 at 2:12 PM, eugenebalt <eu...@yahoo.com> wrote:

>
> Is there a way in wicket to check if a field has been modified by the user
> before submitting the form?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by jcgarciam <jc...@gmail.com>.
JavaScript Trick:

After Page Load, serialized your form elements into a global variable.
Before Submit, serialize your form elements again and compare it against
your previously serialized version.

Rinse and Repeat
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221280.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Check for User-Modified ("Dirty") Fields before Form Submission

Posted by jcgarciam <jc...@gmail.com>.
JavaScript Trick:

After Page Load, serialized your form elements into a global variable.
Before Submit, serialize your form elements again and compare
it against your previously serialized version.

Rinse and Repeat

On Mon, Jan 17, 2011 at 1:12 PM, eugenebalt [via Apache Wicket] <
ml-node+3221228-1217690326-65838@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> Is there a way in wicket to check if a field has been modified by the user
> before submitting the form?
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221228.html
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65838@n4.nabble.com<ml...@n4.nabble.com>
> To unsubscribe from Apache Wicket, click here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Check-for-User-Modified-Dirty-Fields-before-Form-Submission-tp3221228p3221278.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org