You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Clemens Sietas <si...@gmx.de> on 2007/05/22 16:26:06 UTC

[Tobago] tx:date EndDate not before BeginDate

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
--------------------------------------------



Re: [Tobago] tc:message for tx:date solution

Posted by Arvid Hülsebus <ar...@atanion.com>.
I checked in a small page in the test example. If the id 
("page:validityEnd") is specified correctly (absolute id path from view 
root through all naming containers), the message gets displayed.

See:
http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/webapp/messages.jsp
http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SessionController.java

Regards,
Arvid

Volker Weber wrote:
> Hi Clemens,
>
> the id in addMessage() is still wrong.
>
> At least the id of the tc:page is missing.
>
> Please take a look into the generated html source for the correct id 
> of the
> <input ..> generated by the tc:date.
>
>
> Regards,
>    Volker
>
> 2007/5/25, Clemens Sietas <si...@gmx.de>:
>> Hello Helmut,
>>
>> thank you for your help!
>>
>> Now I have the following Client- and Server-Code (below).
>> The Message is always added (facesContext.addMessage)
>> in an action-method of my code just for testing.
>> However, I never get a message displayed.
>> Is there something wrong on the client or server.
>> To be honest I never got any message working before.
>> I did some testing with messages a few weeks ago.
>> I have no luck with the message functionality, although
>> it seems to be quite easy. Do you have any more help?
>>
>> Thank you in advance
>> Clemens
>>
>>
>> Client:
>> <f:subview id="dlgAddEdit">
>> ...
>> <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"/>
>> ...
>> </tc:panel>
>>
>>
>> Server:
>>
>>
>>     FacesContext facesContext = FacesContext.getCurrentInstance();
>>
>> String message = "vldtyEnd smaller than vldtyBeg";
>> facesContext.addMessage("dlgAddEdit:vldtyEnd",
>>            new FacesMessage(FacesMessage.SEVERITY_ERROR, message, 
>> message));
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > 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" <si...@gmx.de>
>> > To: "MyFaces Discussion" <us...@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" <si...@gmx.de>
>> > > An: "MyFaces Discussion" <us...@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
>> > > --------------------------------------------
>> > >
>> > >
>> > >
>> >
>>
>> -- 
>> --------------------------------------------
>> Clemens Sietas
>> email: siecle@gmx.de
>> --------------------------------------------
>>
>>
>>
>

Re: [Tobago] tc:message for tx:date solution

Posted by Clemens Sietas <si...@gmx.de>.
Hi Volker and Arvid,

thanks to both of you. Messages are now working fine!
Because of the id="page" in the overview.tag source file
my statement was always missing the "page".
The correct addressing for my code is: page:dlgAddEdit:vldtyEnd

    String message = "vldtyEnd smaller than vldtyBeg";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    facesContext.addMessage("page:dlgAddEdit:vldtyEnd",
               new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));

Regards
Clemens


-------- Original-Nachricht --------
Datum: Fri, 25 May 2007 10:19:54 +0200
Von: "Volker Weber" <v....@inexso.de>
An: "MyFaces Discussion" <us...@myfaces.apache.org>
Betreff: Re: [Tobago] tc:message for tx:date solution

> Hi Clemens,
> 
> the id in addMessage() is still wrong.
> 
> At least the id of the tc:page is missing.
> 
> Please take a look into the generated html source for the correct id of
> the
> <input ..> generated by the tc:date.
> 
> 
> Regards,
>     Volker
> 
> 2007/5/25, Clemens Sietas <si...@gmx.de>:
> > Hello Helmut,
> >
> > thank you for your help!
> >
> > Now I have the following Client- and Server-Code (below).
> > The Message is always added (facesContext.addMessage)
> > in an action-method of my code just for testing.
> > However, I never get a message displayed.
> > Is there something wrong on the client or server.
> > To be honest I never got any message working before.
> > I did some testing with messages a few weeks ago.
> > I have no luck with the message functionality, although
> > it seems to be quite easy. Do you have any more help?
> >
> > Thank you in advance
> > Clemens
> >
> >
> > Client:
> > <f:subview id="dlgAddEdit">
> > ...
> > <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"/>
> > ...
> > </tc:panel>
> >
> >
> > Server:
> >
> >
> >     FacesContext facesContext = FacesContext.getCurrentInstance();
> >
> > String message = "vldtyEnd smaller than vldtyBeg";
> > facesContext.addMessage("dlgAddEdit:vldtyEnd",
> >            new FacesMessage(FacesMessage.SEVERITY_ERROR, message,
> message));
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > 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" <si...@gmx.de>
> > > To: "MyFaces Discussion" <us...@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" <si...@gmx.de>
> > > > An: "MyFaces Discussion" <us...@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
> > > > --------------------------------------------
> > > >
> > > >
> > > >
> > >
> >
> > --
> > --------------------------------------------
> > Clemens Sietas
> > email: siecle@gmx.de
> > --------------------------------------------
> >
> >
> >

-- 
--------------------------------------------
Clemens Sietas
email: siecle@gmx.de
--------------------------------------------



Re: [Tobago] tc:message for tx:date solution

Posted by Volker Weber <v....@inexso.de>.
Hi Clemens,

the id in addMessage() is still wrong.

At least the id of the tc:page is missing.

Please take a look into the generated html source for the correct id of the
<input ..> generated by the tc:date.


Regards,
    Volker

2007/5/25, Clemens Sietas <si...@gmx.de>:
> Hello Helmut,
>
> thank you for your help!
>
> Now I have the following Client- and Server-Code (below).
> The Message is always added (facesContext.addMessage)
> in an action-method of my code just for testing.
> However, I never get a message displayed.
> Is there something wrong on the client or server.
> To be honest I never got any message working before.
> I did some testing with messages a few weeks ago.
> I have no luck with the message functionality, although
> it seems to be quite easy. Do you have any more help?
>
> Thank you in advance
> Clemens
>
>
> Client:
> <f:subview id="dlgAddEdit">
> ...
> <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"/>
> ...
> </tc:panel>
>
>
> Server:
>
>
>     FacesContext facesContext = FacesContext.getCurrentInstance();
>
> String message = "vldtyEnd smaller than vldtyBeg";
> facesContext.addMessage("dlgAddEdit:vldtyEnd",
>            new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> > 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" <si...@gmx.de>
> > To: "MyFaces Discussion" <us...@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" <si...@gmx.de>
> > > An: "MyFaces Discussion" <us...@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
> > > --------------------------------------------
> > >
> > >
> > >
> >
>
> --
> --------------------------------------------
> Clemens Sietas
> email: siecle@gmx.de
> --------------------------------------------
>
>
>

[Tobago] tc:message for tx:date solution

Posted by Clemens Sietas <si...@gmx.de>.
Hello Helmut,

thank you for your help!

Now I have the following Client- and Server-Code (below).
The Message is always added (facesContext.addMessage)
in an action-method of my code just for testing.
However, I never get a message displayed.
Is there something wrong on the client or server.
To be honest I never got any message working before.
I did some testing with messages a few weeks ago.
I have no luck with the message functionality, although
it seems to be quite easy. Do you have any more help?

Thank you in advance
Clemens


Client:
<f:subview id="dlgAddEdit">
...
<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"/>
...
</tc:panel>


Server:


    FacesContext facesContext = FacesContext.getCurrentInstance();

String message = "vldtyEnd smaller than vldtyBeg";
facesContext.addMessage("dlgAddEdit:vldtyEnd",
           new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));














> 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" <si...@gmx.de>
> To: "MyFaces Discussion" <us...@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" <si...@gmx.de>
> > An: "MyFaces Discussion" <us...@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
> > --------------------------------------------
> >
> >
> > 
> 

-- 
--------------------------------------------
Clemens Sietas
email: siecle@gmx.de
--------------------------------------------



Re: [Tobago] tx:date EndDate not before BeginDate

Posted by Helmut Swaczinna <sw...@wlp-systems.de>.
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" <si...@gmx.de>
To: "MyFaces Discussion" <us...@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" <si...@gmx.de>
> An: "MyFaces Discussion" <us...@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
> --------------------------------------------
>
>
> 



Re: [Tobago] tx:date EndDate not before BeginDate

Posted by Clemens Sietas <si...@gmx.de>.
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" <si...@gmx.de>
An: "MyFaces Discussion" <us...@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
--------------------------------------------



Re: [Tobago] tx:date EndDate not before BeginDate

Posted by Clemens Sietas <si...@gmx.de>.
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
--------------------------------------------



Re: [Tobago] tx:date EndDate not before BeginDate

Posted by Udo Schnurpfeil <ud...@schnurpfeil.de>.
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>
>
>