You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Jacob Nordfalk <ja...@gmail.com> on 2009/04/20 11:10:55 UTC

[Trinidad] How to get to take the starting date of is't ?

Dear Trinidad developers,

First, thanks for a great library.


I am using the following, probably very familiar, construct:

       <tr:inputDate chooseId="fromDate" label="From date:"
value="#{userchoice.fromDate}">
             <f:convertDateTime timeZone="CET" pattern="dd-MM-yy"/>
       </tr:inputDate>
       <tr:chooseDate id="fromDate" />


It's a big annoyance for me that <tr:chooseDate /> can't be somehow made to
get the initial values of its associated <tr:inputDate/>.

tr:chooseDate always goes to the current date.

I have tried working around this issue with JavaScript

 <tr:document onload="document.show.fromDateyear.selectedIndex=#{userchoice.fromDate.year-100};
document.show.fromDatemonth.selectedIndex=#{userchoice.fromDate.month}; ">

but it doesent work too well, also not if I include
document.show.fromDateyear.onchange();
document.show.fromDatemonth.onchange();


Could someone please advice me on fixing the above?
As I'n not a Trinidad developer and the product is in production I am
looking for a Javascript workaround (rather than having to patch the
Trinidad code).

Thanks
Jacob Nordfalk


More info:
"> Currently, date picker init itself to the current date (unless there's a
DateTimeRangeValidator preventing it). This can be useful, but also
problematic when the date to be selected is decently old, like a birthdate
for instance. A decent workaround would be to add an attribute on the
component to fix the initial selected date of the date picker."
    [
https://issues.apache.org/jira/browse/TRINIDAD-458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700690#action_12700690]



-- 
Jacob Nordfalk
Venu al la plej granda kultura evento en esperantujo: Kultura
Esperanto-Festivalo - la 7a ĝis la 12a de julio 2009 - http://kef.saluton.dk
एस्पेरान्तो के हो?  http://www.esperanto.org.np/.

Re: [Trinidad] How to get to take the starting date of is't ?

Posted by Matthias Wessendorf <ma...@apache.org>.
On Mon, Apr 20, 2009 at 11:10 AM, Jacob Nordfalk
<ja...@gmail.com> wrote:
> Dear Trinidad developers,
>
> First, thanks for a great library.
>
>
> I am using the following, probably very familiar, construct:
>
>        <tr:inputDate chooseId="fromDate" label="From date:"
> value="#{userchoice.fromDate}">
>              <f:convertDateTime timeZone="CET" pattern="dd-MM-yy"/>
>        </tr:inputDate>
>        <tr:chooseDate id="fromDate" />
>
>
> It's a big annoyance for me that <tr:chooseDate /> can't be somehow made to
> get the initial values of its associated <tr:inputDate/>.
>
> tr:chooseDate always goes to the current date.
>
> I have tried working around this issue with JavaScript
>
>  <tr:document onload="document.show.
> fromDateyear.selectedIndex=#{userchoice.fromDate.year-100};
> document.show.fromDatemonth.selectedIndex=#{userchoice.fromDate.month}; ">
>
> but it doesent work too well, also not if I include
> document.show.fromDateyear.onchange();
> document.show.fromDatemonth.onchange();
>
>
> Could someone please advice me on fixing the above?
> As I'n not a Trinidad developer and the product is in production I am
> looking for a Javascript workaround (rather than having to patch the
> Trinidad code).

I commented in the bug, where to take a look in the java code (the
actual renderer).
I think a fix there, for this enhancement, would be the right way to
fix the problem.

-M

>
> Thanks
> Jacob Nordfalk
>
>
> More info:
> "> Currently, date picker init itself to the current date (unless there's a
> DateTimeRangeValidator preventing it). This can be useful, but also
> problematic when the date to be selected is decently old, like a birthdate
> for instance. A decent workaround would be to add an attribute on the
> component to fix the initial selected date of the date picker."
>     [
> https://issues.apache.org/jira/browse/TRINIDAD-458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700690#action_12700690
> ]
>
>
>
> --
> Jacob Nordfalk
> Venu al la plej granda kultura evento en esperantujo: Kultura
> Esperanto-Festivalo - la 7a ĝis la 12a de julio 2009 - http://kef.saluton.dk
> एस्पेरान्तो के हो?  http://www.esperanto.org.np/.
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf