You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Dushyant Agarwal (JIRA)" <de...@myfaces.apache.org> on 2008/07/04 12:35:33 UTC

[jira] Created: (TRINIDAD-1141) Unable to set DateTimeConverter with tr:inputDate component from the backing bean

Unable to set DateTimeConverter with tr:inputDate component from the backing bean
---------------------------------------------------------------------------------

                 Key: TRINIDAD-1141
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1141
             Project: MyFaces Trinidad
          Issue Type: Improvement
          Components: Components
    Affects Versions: 1.2.4-core
         Environment: WinXP,SP2, 2GB RAM , COre2 Duo Processor(2.86)
            Reporter: Dushyant Agarwal
             Fix For: 1.2.4-core


 I have JSF page which contains a tr:inputDate component as given
 below:-

 <tr:inputDate
  binding="#{BB.inputDate1}"/>
 As well as there is a commandButton
 <tr:commandButton action="#{BB.action}"/>

 In the Backing bean the action method is as follows:-
 public String action(){

 DateTimeConverter converter = new DateTimeConverter();//the
 Trinidad
 DateTime Converter

  converter.setPattern("dd/MM/yyyy");
 inputDate1.setConverter(converter);
 return null;

 }

Then I tried using

<tr:inputDate converter="#{BB.dateConverter}" />

public Converter getDateConverter() {
  DateTimeConverter converter = new DateTimeConverter();//the Trinidad
DateTime Converter
  converter.setPattern("dd/MM/yyyy");
  return converter;
}

 While running the JSF page, on clicking the button the converter
 does
 get
 applied, But after the Page gets rendered if the user again clicks
 on
 the
 calendar button to select a new date then a javascript error
 appears
[Got this info on using firebug for debugging]

_getDateFieldFormat(input#inputDate1.af_inputDate_content)
_dfsv(input#inputDate1.af_inputDate_content,1217411811404)
 returnCalendarvalue(Window,undefined)
_checkUnload(undefined)
_selectdate(1217356200000)
onclick(click client X=1842, client Y =1842)
Common1_2_4.js line 2170

This error appear in the popup window where the calendar gets rendered
 
 How can I set
  the above mentioned
 converter
 on the inputDate cpmponent from the backing bean.

 The scope of the BB bean request.

 pl. consider that I strictly need to set the converter from  the
 backing bean.(Beacause sometimes the component gets generated dynamically. so
 no way to put tr:convertDateTime  )

Thanks,
Dushyant


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TRINIDAD-1141) Unable to set DateTimeConverter with tr:inputDate component from the backing bean

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf reopened TRINIDAD-1141:
------------------------------------------


> Unable to set DateTimeConverter with tr:inputDate component from the backing bean
> ---------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1141
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1141
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Components
>    Affects Versions: 1.2.4-core
>         Environment: WinXP,SP2, 2GB RAM , COre2 Duo Processor(2.86)
>            Reporter: Dushyant Agarwal
>
>  I have JSF page which contains a tr:inputDate component as given
>  below:-
>  <tr:inputDate
>   binding="#{BB.inputDate1}"/>
>  As well as there is a commandButton
>  <tr:commandButton action="#{BB.action}"/>
>  In the Backing bean the action method is as follows:-
>  public String action(){
>  DateTimeConverter converter = new DateTimeConverter();//the
>  Trinidad
>  DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>  inputDate1.setConverter(converter);
>  return null;
>  }
> Then I tried using
> <tr:inputDate converter="#{BB.dateConverter}" />
> public Converter getDateConverter() {
>   DateTimeConverter converter = new DateTimeConverter();//the Trinidad
> DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>   return converter;
> }
>  While running the JSF page, on clicking the button the converter
>  does
>  get
>  applied, But after the Page gets rendered if the user again clicks
>  on
>  the
>  calendar button to select a new date then a javascript error
>  appears
> [Got this info on using firebug for debugging]
> _getDateFieldFormat(input#inputDate1.af_inputDate_content)
> _dfsv(input#inputDate1.af_inputDate_content,1217411811404)
>  returnCalendarvalue(Window,undefined)
> _checkUnload(undefined)
> _selectdate(1217356200000)
> onclick(click client X=1842, client Y =1842)
> Common1_2_4.js line 2170
> This error appear in the popup window where the calendar gets rendered
>  
>  How can I set
>   the above mentioned
>  converter
>  on the inputDate cpmponent from the backing bean.
>  The scope of the BB bean request.
>  pl. consider that I strictly need to set the converter from  the
>  backing bean.(Beacause sometimes the component gets generated dynamically. so
>  no way to put tr:convertDateTime  )
> Thanks,
> Dushyant

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1141) Unable to set DateTimeConverter with tr:inputDate component from the backing bean

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1141.
------------------------------------------

    Resolution: Invalid

not a bug at all

> Unable to set DateTimeConverter with tr:inputDate component from the backing bean
> ---------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1141
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1141
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Components
>    Affects Versions: 1.2.4-core
>         Environment: WinXP,SP2, 2GB RAM , COre2 Duo Processor(2.86)
>            Reporter: Dushyant Agarwal
>
>  I have JSF page which contains a tr:inputDate component as given
>  below:-
>  <tr:inputDate
>   binding="#{BB.inputDate1}"/>
>  As well as there is a commandButton
>  <tr:commandButton action="#{BB.action}"/>
>  In the Backing bean the action method is as follows:-
>  public String action(){
>  DateTimeConverter converter = new DateTimeConverter();//the
>  Trinidad
>  DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>  inputDate1.setConverter(converter);
>  return null;
>  }
> Then I tried using
> <tr:inputDate converter="#{BB.dateConverter}" />
> public Converter getDateConverter() {
>   DateTimeConverter converter = new DateTimeConverter();//the Trinidad
> DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>   return converter;
> }
>  While running the JSF page, on clicking the button the converter
>  does
>  get
>  applied, But after the Page gets rendered if the user again clicks
>  on
>  the
>  calendar button to select a new date then a javascript error
>  appears
> [Got this info on using firebug for debugging]
> _getDateFieldFormat(input#inputDate1.af_inputDate_content)
> _dfsv(input#inputDate1.af_inputDate_content,1217411811404)
>  returnCalendarvalue(Window,undefined)
> _checkUnload(undefined)
> _selectdate(1217356200000)
> onclick(click client X=1842, client Y =1842)
> Common1_2_4.js line 2170
> This error appear in the popup window where the calendar gets rendered
>  
>  How can I set
>   the above mentioned
>  converter
>  on the inputDate cpmponent from the backing bean.
>  The scope of the BB bean request.
>  pl. consider that I strictly need to set the converter from  the
>  backing bean.(Beacause sometimes the component gets generated dynamically. so
>  no way to put tr:convertDateTime  )
> Thanks,
> Dushyant

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1141) Unable to set DateTimeConverter with tr:inputDate component from the backing bean

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1141.
------------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.2.4-core)

Not a bug.
Works fine with the recent trunk.

Do this in your action:

DateTimeConverter converter = (DateTimeConverter) FacesContext.getCurrentInstance().getApplication().createConverter(Date.class);
converter.setPattern("dd/MM/yyyy");
date.setConverter(converter);

Trinidad itself registers the "correct" DateTimeConverter for the classes Date and calendar.
So, using this syntax is much more safe.

I guess you were using the one from the API JAR, but actually that guy that provides the client-side JS, is an extended DateTimeConverter,
that extends the one from the API. And... to not have dependency to -IMPL in your app, this is the second reason to use the .createConverter() method,
offered by the JSF spec itself.

> Unable to set DateTimeConverter with tr:inputDate component from the backing bean
> ---------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1141
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1141
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Components
>    Affects Versions: 1.2.4-core
>         Environment: WinXP,SP2, 2GB RAM , COre2 Duo Processor(2.86)
>            Reporter: Dushyant Agarwal
>
>  I have JSF page which contains a tr:inputDate component as given
>  below:-
>  <tr:inputDate
>   binding="#{BB.inputDate1}"/>
>  As well as there is a commandButton
>  <tr:commandButton action="#{BB.action}"/>
>  In the Backing bean the action method is as follows:-
>  public String action(){
>  DateTimeConverter converter = new DateTimeConverter();//the
>  Trinidad
>  DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>  inputDate1.setConverter(converter);
>  return null;
>  }
> Then I tried using
> <tr:inputDate converter="#{BB.dateConverter}" />
> public Converter getDateConverter() {
>   DateTimeConverter converter = new DateTimeConverter();//the Trinidad
> DateTime Converter
>   converter.setPattern("dd/MM/yyyy");
>   return converter;
> }
>  While running the JSF page, on clicking the button the converter
>  does
>  get
>  applied, But after the Page gets rendered if the user again clicks
>  on
>  the
>  calendar button to select a new date then a javascript error
>  appears
> [Got this info on using firebug for debugging]
> _getDateFieldFormat(input#inputDate1.af_inputDate_content)
> _dfsv(input#inputDate1.af_inputDate_content,1217411811404)
>  returnCalendarvalue(Window,undefined)
> _checkUnload(undefined)
> _selectdate(1217356200000)
> onclick(click client X=1842, client Y =1842)
> Common1_2_4.js line 2170
> This error appear in the popup window where the calendar gets rendered
>  
>  How can I set
>   the above mentioned
>  converter
>  on the inputDate cpmponent from the backing bean.
>  The scope of the BB bean request.
>  pl. consider that I strictly need to set the converter from  the
>  backing bean.(Beacause sometimes the component gets generated dynamically. so
>  no way to put tr:convertDateTime  )
> Thanks,
> Dushyant

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.