myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: Detecting whether or not the user changed anything on a form
Date Fri, 13 Jul 2007 14:52:08 GMT
If at least one ValueChangeEvent is queued (by a UIInput component)
during the validation pahse, then something has changed.

On 7/13/07, Hannum, Daniel <Daniel_Hannum@premierinc.com> wrote:
>
>
>
>
> Hi,
>
>
>
> I have a form for editing a business entity. The form is prepopulated with
> the current values and the user can change everything and hit the submit
> button when their done. Fairly simple. What's tricky is that I'd like to
> only show a confirmation ("Changes saved") message if they actually changed
> something instead of just submitting the same values as before.
>
>
>
> The naïve way is to check each backing bean field against the field in the
> business entity, but that's unmaintainable when the object starts changing.
> Is there a framework-based way to detect this? I want to avoid having to
> enumerate every field when I check. I want to know that _at least one_ of
> the fields on the page has a submitted value different from the model value.
> (I think I got the terminology right)
>
>
>
> Maybe the answer lies in a phase listener that would somehow do that check,
> my experience with that is limited. Please let me know if this is possible
> or not.
>
>
>
> And I'm using MyFaces and Trinidad so hopefully it would only use mechanisms
> include in those projects.
>
>
>
> Thanks
>
> Dan
>
>
> ________________________________
>
>
>
>
>  ***Note:The information contained in this message may be privileged and
> confidential and protected from disclosure. If the reader of this message is
> not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are hereby notified
> that any dissemination, distribution or copying of this communication is
> strictly prohibited. If you have received this communication in error,
> please notify the Sender immediately by replying to the message and deleting
> it from your computer. Thank you. Premier Inc.

Mime
View raw message