myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Herb <phy...@gmail.com>
Subject Re: Possible bug in the columns tag with the convertDateTime tag
Date Fri, 01 Jun 2007 21:51:46 GMT

Hi,
there is no bug with the column tag. Try out the columns tag.

columnInfo.timeZone is from the type "TimeZone" so it should be right.
I have debugged through some myfaces-code and seen that columnInfo.timeZone
and columnInfo.pattern are detected as EL-Expression but can not be resolved
and so the attributes are just set to null.

To reconstruct the error:
- Iterate with the columns tag through a list of objects
- Make use of a convertDateTime tag inside of the columns tag and use the
var-variable of the columns tag as an attribute of the convertDateTime
- Set a breakpoint to the getter of the var-variable which you are using in
the convertDateTime tag. You should now "see" that the getter is not called
from the convertDateTime tag.

Thank you for your help
Daniel


Paul Spencer-3 wrote:
> 
> Johnny,
> The following work for me using MyFaces 1.1.5:
> 
> ***
> * From JSP
> ***
>            <t:column id="dateColumn"
>              headerstyleClass="dataTableColumnHeader"
>              styleClass="dataColumn_String"
>              rendered="#{manager.summarizeByDay}">
>              <f:facet name="header">
>                <h:outputLabel for="date" value="Date" />
>              </f:facet>
>              <h:outputText id="date" value="#{row.date}">
>                <f:convertDateTime pattern="dd-MMM-yyyy"
>                  timeZone="#{applicationDefaults.timeZone}" />
>              </h:outputText>
>            </t:column>
> 
> ***
> * From applicationDefault bean
> ***
>      public TimeZone getTimeZone()
>      {
>          return timeZone;
>      }
> 
> Paul Spencer
> 
> Johnny Sutherland wrote:
>> Hi Mike
>> 
>> 
>> Thank you for replying so quickly.
>> 
>> 
>> I have tried both the TimeZone type and String for the timeZone
>> parameter.
>> The pattern has always been String.
>> 
>> Johnny
>> 
>> 
>> 
>> 
>> Mike Kienenberger wrote:
>>> What's the data type of #{columnInfo.timeZone}?  Both getters should
>>> be of type String.
>>>
>>> The docs read:
>>>
>>> Time zone in which to interpret any time information in the date
>>> String. Value must be either a VB expression that evaluates to a
>>> java.util.TimeVone instance, or a String that is a timezone ID as
>>> described in the javadocs for java.util.TimeZone.getTimeZone().
>>>
>>>
>>> On 6/1/07, Johnny Sutherland  wrote:
>>>>  You are correct. That was a typing error from me when writing the bug.
>>>> I
>>>> have entered the correct code below - unfortuntale the problem is still
>>>> the
>>>> same. We havce also discovered that the problem - the getter is not
>>>> called -
>>>> exists with all the tags from the JSF Core taglib.
>>>>
>>>>  The timeZone and pattern values are not being read from the columnInfo
>>>> object when the tag is within a columns tag in a dataTable.
>>>>
>>>>  The columnInfo is set by the columns tag but the getter is not called.
>>>> However, if we access the values via an outputText tag e.g. (These
>>>> values
>>>> are displayed) (These values are displayed) the getters are accessed
>>>> and
>>>> the
>>>> values displayed.
>>>>
>>>>    value="#{masterDataController.sortableList.dataModel}"
>>>>  sortColumn="#{masterDataController.sortableList.sort}"
>>>> sortAscending="#{masterDataController.sortableList.ascending}"
>>>>  preserveSort="false" renderedIfEmpty="false">
>>>>
>>>>    value="#{masterDataController.sortableList.columnInfos}">
>>>>
>>>>  
>>>>   pattern="#{columnInfo.pattern}" /> (These values are not accessed)
>>>>  
>>>>
>>>>   (These values will be
>>>> displayed)
>>>>   (These values will be
>>>> displayed)
>>>>  
>>>>  
>>>>
>>>> Mike Kienenberger wrote:
>>>>  What you posted isn't valid: You have: <-- should be '>' not '/>'
I
>>>> could
>>>> see how that might cause this tag to be ignored, provided it was parsed
>>>> at
>>>> all. On 5/31/07, Johnny Sutherland wrote: > The timeZone and pattern
>>>> values
>>>> are not being read from the columnInfo > object when the tag is within
>>>> a
>>>> columns tag in a dataTable. > > The columnInfo is set by the columns
>>>> tag
>>>> but
>>>> the getter is not called. > However, if we access the values via an
>>>> outputText tag e.g. (These values > are displayed) (These values are
>>>> displayed) > > the getters are accessed and the values displayed. >
>
>>>> Here
>>>> is a sample of the code. > >
>>>> headerClass="standardTableHeader" >
>>>> footerClass="standardText" > rowClasses="standardTable_Row1,
>>>> standardTable_Row2" var="data" > preserveDataModel="false" >
>>>> value="#{masterDataController.sortableList.dataModel}" >
>>>> rows="10" >
>>>> sortColumn="#{masterDataController.sortableList.sort}" >
>>>> sortAscending="#{masterDataController.sortableList.ascending}"
>>>>> preserveSort="false" renderedIfEmpty="false"> > > >
>>>> value="#{masterDataController.sortableList.columnInfos}" >
>>>> styleClass="#{masterDataController.sortableList.columnStyleClass}">
>>>>>>>> styleClass="tableHeader" immediate="false" >
>>>> action="#{masterDataController.sortableList.sort}"> > > > >
>>>> value="#{masterDataController.sortableList.columnValue}" >
>>>> rendered="#{!masterDataController.sortableList.dataModel.selected}"
>>>>> /> > > pattern="#{columnInfo.pattern}" /> (These values are
not
>>>> accessed)
>>>>>>>> (These values will be > displayed) > > (These values
will be >
>>>> displayed) > > > ________________________________ > View
>>>> this message in context: Possible bug in the columns tag with the >
>>>> convertDateTime tag > Sent from the My Faces - Dev mailing list archive
>>>> at
>>>> Nabble.com. >
>>>> ________________________________
>>>>  View this message in context: Re: Possible bug in the columns tag with
>>>> the
>>>> convertDateTime tag
>>>>
>>>>  Sent from the My Faces - Dev mailing list archive at Nabble.com.
>>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10921096
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Mime
View raw message