On Wed, 2005-06-01 at 15:21 +0200, Messing, Elad wrote:
> Hello again Sylvain
> I kept looking for the <fd:message> widget you mentioned, and couldn't
> find any reference to it in the docs.
> Do you actually mean the <fd:output widget ?
>
> Thank you
> Elad
Yeah I am using it like:
<fd:output id="message">
<fd:datatype base="string"/>
<fd:label>Fehlermeldung:</fd:label>
</fd:output>
The following was a reply to the "[cforms] Alert is not defined" thread
that I started yesterday. It may be helpful for you.
On Tue, 2005-05-31 at 13:27 +0200, Bart Molenkamp wrote:
> Hi,
<snip/>
>
> There is a messages widget, to which you can add messages. I use it to
> display messages in a form when a user submits a form with a repeater
> that contains no rows (at least one row is required). The form
> definition:
> <fd:repeater id="evidence">
> <fd:validation>
> <fd:javascript>
> var success = widget.getSize() > 0;
>
> if (!success) {
> var messagesWidget = widget.lookupWidget("../messages");
> messagesWidget.addMessage(...);
> }
>
> return success;
> </fd:javascript>
> </fd:validation>
>
> You can do similair for add/remove events.
>
> HTH,
> Bart.
>
salu2
>
> -----Urspr�ngliche Nachricht-----
> Von: Sylvain Wallez [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 31. Mai 2005 21:08
> An: [email protected]
> Betreff: Re: CFORMS - Performing a Form level validation
>
> Messing, Elad wrote:
>
> > Hi all
> > I tried looking for a "definition" text on the preferred way
> > of performing a Form level validation.
> > What I mean is that I need to perform validation that is
> > relevant to the Form -not to specific widget. I.E. - I have a form
> > with 2 widgets, and I need to check that either 1 of them has a value
> > in it.
> >
> > So - I know I can have a validation in one of the widgets, and
> > in it write some javascript to check the other as well, and then
> > output the error to a "fi:validation-errors" tag - to show it in a
> > central place.
> >
> > But this seems like a work around rather than a real plan..
> >
>
> You can add a <fd:validation> on any widget, including a form. But not every
> widget can hold validation errors, as not every widget has a visual
> representation.
>
> So validation on non-visual widgets should set validation errors on one of
> their child widgets. Another option if there's no suitable widget to attach
> the error to is to add the error text to a <fd:message> widget.
>
> For more details, see the javadocs of
> o.a.c.forms.validation.WidgetValidator and form1.xml in the samples: the
> "contacts" repeater has a validator that checks row uniqueness and sets an
> error on the duplicate rows.
>
> > A second and related question will be - In my form with 2
> > widgets, each one of them has its own validation. So - they are not
> > required, but in case the user enters something into them, It should
> > be validated. After this validation, I will need to have the "Form
> > Level" validation I mentioned above.
> >
>
> That should occur automatically.
>
> Hope this helps,
> Sylvain
>
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]