You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Al...@interactivedata.com on 2007/01/19 13:07:22 UTC
Hello all,
Does anyone know if you can programatically change the value of a
<t:inputDate> field? I am trying to set the value of a <t:inputDate>
component so that it displays the date on screen. I can only get it to
display current date and time.
I have the followng backing bean :-
public class test {
private Date effectiveDateFrom;
public Date getEffectiveDateFrom()
{
return effectiveDateFrom;
}
public void setEffectiveDateFrom(Date effectiveDateFrom)
{
this.effectiveDateFrom = effectiveDateFrom;
}
}
Here is the jsp code :-
<t:inputDate value="#{test.effectiveDateFrom}" type="both"
popupCalendar="true" />
This will happily display the current date and time when the screen is
entered as the value of effectiveDateFrom is set to null but if I try and
set it to another value it ignores the new value and still displays the
current time e.g.
public void setTestDate {
effectiveDateFrom = new Date(11629202495000);
}
On screen I still get the current time on refresh.
Has anyone programatically changed the value of a <t:inputDate>? If so
could someone let me know what I am doing wrong.
Many Thanks in advance.
Alex...
-----------------------------------------
This message (including any files transmitted with it) may contain
confidential and/or proprietary information, is the property of
Interactive Data Corporation and/or its subsidiaries, and is
directed only to the addressee(s). If you are not the designated
recipient or have reason to believe you received this message in
error, please delete this message from your system and notify the
sender immediately. An unintended recipient's disclosure,
copying, distribution, or use of this message or any attachments is
prohibited and may be unlawful
Re:
Posted by Al...@interactivedata.com.
Thanks for your help Mario, I now understand why my problem has occured.
Alex...
Mario Ivankovits <ma...@ops.co.at>
19/01/2007 13:44
Please respond to
"MyFaces Discussion" <us...@myfaces.apache.org>
To
MyFaces Discussion <us...@myfaces.apache.org>
cc
Subject
Re: <t:inputDate>
Hi Alex!
> I have a Drop down list and a valueChangeListener on the drop down
> list which calls setTestDate :-
>
> public void dropDownChanged(ValueChangeEvent event)
> {
> setTestDate();
A normal ValueChangeEvent will be sent BEFORE the model update. So your
changed date will be reset to the current displayed value.
Use the our sandbox component s:valueChangeNotifier instead. This
component uses the same method signature, but will fire after the model
update so you can do with your beans whatever your would like to and
have the changes reflected in the UI.
Ciao,
Mario
-----------------------------------------
This message (including any files transmitted with it) may contain
confidential and/or proprietary information, is the property of
Interactive Data Corporation and/or its subsidiaries, and is
directed only to the addressee(s). If you are not the designated
recipient or have reason to believe you received this message in
error, please delete this message from your system and notify the
sender immediately. An unintended recipient's disclosure,
copying, distribution, or use of this message or any attachments is
prohibited and may be unlawful
Re:
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Alex!
> I have a Drop down list and a valueChangeListener on the drop down
> list which calls setTestDate :-
>
> public void dropDownChanged(ValueChangeEvent event)
> {
> setTestDate();
A normal ValueChangeEvent will be sent BEFORE the model update. So your
changed date will be reset to the current displayed value.
Use the our sandbox component s:valueChangeNotifier instead. This
component uses the same method signature, but will fire after the model
update so you can do with your beans whatever your would like to and
have the changes reflected in the UI.
Ciao,
Mario
Re:
Posted by Al...@interactivedata.com.
I have a Drop down list and a valueChangeListener on the drop down list
which calls setTestDate :-
public void dropDownChanged(ValueChangeEvent event)
{
setTestDate();
}
This is code just to test the theory that is why it is pretty basic but I
cannot change the date programatically.
Many Thanks...
"Volker Weber" <we...@googlemail.com>
19/01/2007 12:21
Please respond to
"MyFaces Discussion" <us...@myfaces.apache.org>
To
"MyFaces Discussion" <us...@myfaces.apache.org>
cc
Subject
Re: <t:inputDate>
Hi Alex,
where did you call setTestDate()?
2007/1/19, Alex.Trusler@interactivedata.com
<Al...@interactivedata.com>:
>
> Hello all,
>
> Does anyone know if you can programatically change the value of a
> <t:inputDate> field? I am trying to set the value of a <t:inputDate>
> component so that it displays the date on screen. I can only get it to
> display current date and time.
>
> I have the followng backing bean :-
>
> public class test {
> private Date effectiveDateFrom;
>
> public Date getEffectiveDateFrom()
> {
> return effectiveDateFrom;
> }
>
> public void setEffectiveDateFrom(Date effectiveDateFrom)
> {
> this.effectiveDateFrom = effectiveDateFrom;
> }
> }
>
> Here is the jsp code :-
>
> <t:inputDate value="#{test.effectiveDateFrom}" type="both"
> popupCalendar="true" />
>
> This will happily display the current date and time when the screen is
> entered as the value of effectiveDateFrom is set to null but if I try
and
> set it to another value it ignores the new value and still displays the
> current time e.g.
>
> public void setTestDate {
> effectiveDateFrom = new Date(11629202495000);
> }
>
> On screen I still get the current time on refresh.
>
> Has anyone programatically changed the value of a <t:inputDate>? If so
could
> someone let me know what I am doing wrong.
>
> Many Thanks in advance.
>
> Alex...
>
>
> ________________________________
>
>
>
>
>
>
> This message (including any files transmitted with it) may contain
> confidential and/or proprietary information, is the property of
> Interactive Data Corporation and/or its subsidiaries, and is
> directed only to the addressee(s). If you are not the designated
> recipient or have reason to believe you received this message in
> error, please delete this message from your system and notify the
> sender immediately. An unintended recipient's disclosure,
> copying, distribution, or use of this message or any attachments is
> prohibited and may be unlawful
>
Re:
Posted by Volker Weber <we...@googlemail.com>.
Hi Alex,
where did you call setTestDate()?
2007/1/19, Alex.Trusler@interactivedata.com <Al...@interactivedata.com>:
>
> Hello all,
>
> Does anyone know if you can programatically change the value of a
> <t:inputDate> field? I am trying to set the value of a <t:inputDate>
> component so that it displays the date on screen. I can only get it to
> display current date and time.
>
> I have the followng backing bean :-
>
> public class test {
> private Date effectiveDateFrom;
>
> public Date getEffectiveDateFrom()
> {
> return effectiveDateFrom;
> }
>
> public void setEffectiveDateFrom(Date effectiveDateFrom)
> {
> this.effectiveDateFrom = effectiveDateFrom;
> }
> }
>
> Here is the jsp code :-
>
> <t:inputDate value="#{test.effectiveDateFrom}" type="both"
> popupCalendar="true" />
>
> This will happily display the current date and time when the screen is
> entered as the value of effectiveDateFrom is set to null but if I try and
> set it to another value it ignores the new value and still displays the
> current time e.g.
>
> public void setTestDate {
> effectiveDateFrom = new Date(11629202495000);
> }
>
> On screen I still get the current time on refresh.
>
> Has anyone programatically changed the value of a <t:inputDate>? If so could
> someone let me know what I am doing wrong.
>
> Many Thanks in advance.
>
> Alex...
>
>
> ________________________________
>
>
>
>
>
>
> This message (including any files transmitted with it) may contain
> confidential and/or proprietary information, is the property of
> Interactive Data Corporation and/or its subsidiaries, and is
> directed only to the addressee(s). If you are not the designated
> recipient or have reason to believe you received this message in
> error, please delete this message from your system and notify the
> sender immediately. An unintended recipient's disclosure,
> copying, distribution, or use of this message or any attachments is
> prohibited and may be unlawful
>