Hello Udo,
I found something like that, however, it does not
work. No message is displayed.
Do I use the wrong id when adding the message?
The message is generated in any case just for testing.
Thanks for any help!
Clemens
Client:
<tc:panel>
...
<tx:date id="vldtyBeg"
value="#{controller.selectedVldtyBeg}"
label="#{controller.keyLblValidityBegin}"
readonly="#{controller.forEditSelected}">
<f:convertDateTime pattern="dd.MM.yyyy"/>
</tx:date>
<tx:date id="vldtyEnd"
value="#{controller.selectedVldtyEnd}"
label="#{controller.keyLblValidityEnd}">
<f:convertDateTime pattern="dd.MM.yyyy"/>
</tx:date>
<tc:message for="vldtyEnd" id="msgForVldtyEnd"/>
...
</tc:panel>
Server:
FacesContext facesContext = FacesContext.getCurrentInstance();
String message = "EndDate smaller than BeginDate";
facesContext.addMessage("msgForVldtyEnd",
new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
-------- Original-Nachricht --------
Datum: Wed, 23 May 2007 07:47:08 +0200
Von: "Clemens Sietas" <[EMAIL PROTECTED]>
An: "MyFaces Discussion" <[email protected]>
Betreff: Re: [Tobago] tx:date EndDate not before BeginDate
> Hello Udo,
>
> thank you for the reply.
> I will try both options.
>
> Regards,
> Clemens
>
>
> > I only see 2 options, both standard JSF:
> >
> > 1. check "manually" in the action method, use
> facesContext.addMessage()
> > 2. write your own validator
> >
> > I don't know a more declarative way in the moment.
> >
> > Regards,
> >
> > Udo
> >
> > Clemens Sietas schrieb:
> > > Hello,
> > >
> > > I have another question regarding the datepicker.
> > > Can I easily ensure in JSF-coding that the
> > > selectedVldtyEnd cannot be selected with a smaller date
> > > than the selectedVldtyBeg?
> > > For example with <f:validate...>
> > >
> > > Regards,
> > > Clemens
> > >
> > > <tx:date id="vldtyBeg"
> > > value="#{controller.selectedVldtyBeg}"
> > > label="#{controller.keyLblValidityBegin}"
> > > readonly="#{controller.forEditSelected}">
> > > <f:convertDateTime pattern="dd.MM.yyyy"/>
> > > </tx:date>
> > > <tx:date id="vldtyEnd"
> > > value="#{controller.selectedVldtyEnd}"
> > > label="#{controller.keyLblValidityEnd}">
> > > <f:convertDateTime pattern="dd.MM.yyyy"/>
> > > </tx:date>
> > >
> > >
>
> --
> --------------------------------------------
> Clemens Sietas
> email: [EMAIL PROTECTED]
> --------------------------------------------
>
--
--------------------------------------------
Clemens Sietas
email: [EMAIL PROTECTED]
--------------------------------------------