myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helmut Swaczinna" <swaczi...@wlp-systems.de>
Subject Re: [Tobago] tx:date EndDate not before BeginDate
Date Wed, 23 May 2007 10:03:04 GMT
Hello Clemens,

you have to specify the id of input component not of the message component 
in addMessage().
For example

facesContext.addMessage("myPage:vldtyEnd",
           new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));


Regards
Helmut

----- Original Message ----- 
From: "Clemens Sietas" <siecle@gmx.de>
To: "MyFaces Discussion" <users@myfaces.apache.org>
Sent: Wednesday, May 23, 2007 11:42 AM
Subject: Re: [Tobago] tx:date EndDate not before BeginDate


> 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" <siecle@gmx.de>
> An: "MyFaces Discussion" <users@myfaces.apache.org>
> 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: siecle@gmx.de
>> --------------------------------------------
>>
>
> -- 
> --------------------------------------------
> Clemens Sietas
> email: siecle@gmx.de
> --------------------------------------------
>
>
> 



Mime
View raw message