You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Johnny Sutherland <jo...@basf-it-services.com> on 2007/06/01 10:45:59 UTC

Re: Possible bug in the columns tag with the convertDateTime tag

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.


&lt;t:dataTable id=&quot;edbcd&quot; var=&quot;data&quot;
preserveDataModel=&quot;false&quot; 

value=&quot;#{masterDataController.sortableList.dataModel}&quot;

sortColumn=&quot;#{masterDataController.sortableList.sort}&quot;

sortAscending=&quot;#{masterDataController.sortableList.ascending}&quot;

preserveSort=&quot;false&quot; renderedIfEmpty=&quot;false&quot;&gt; 
 &lt;t:columns var=&quot;columnInfo&quot;

  value=&quot;#{masterDataController.sortableList.columnInfos}&quot;&gt;

 &lt;h:inputText value=&quot;#{masterDataController}&quot;&gt;

  &lt;f:convertDateTime timeZone=&quot;#{columnInfo.timeZone}&quot;
pattern=&quot;#{columnInfo.pattern}&quot; 
  /&gt; (These values are not accessed)

  &lt;/h:inputText&gt;

 &lt;h:outputText value=&quot;#{columnInfo.timeZone}&quot; /&gt; 
  (These values will be displayed)

  &lt;h:outputText value=&quot;#{columnInfo.pattern}&quot; /&gt; 
  (These values will be displayed)

  &lt;/t:columns&gt;

  &lt;/t:dataTable&gt;





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: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10909069
Sent from the My Faces - Dev mailing list archive at Nabble.com.

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
In your current example (but not your first one),

<h:inputText value="#{masterDataController}">

That's obviously wrong.   My only other guess is that the converter is
never called because the value it's working with is never converted.

I would try reducing this problem to a simpler state and then
generally make it more complex until you see what breaks.

Ie,

public class Bean {
public String get/setInput();
public String getTimeZone();
public String getPattern();

<h:inputText value="#{bean.input}">
<f:convertDateTime timeZone="#{bean.timeZone}" pattern="#{bean.pattern}" />
</h:inputText>

Then try putting it in a dataTable, not changing anything.
Then try replacing each of the attributes, one at a time.

On 6/1/07, Johnny Sutherland <jo...@basf-it-services.com> 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: Re: Possible bug in the columns tag with the
> convertDateTime tag
>  Sent from the My Faces - Dev mailing list archive at Nabble.com.
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Thank you for your suggestion, I will try that.


Mike Kienenberger wrote:
> 
> Converters that evaluate at rendertime would be an excellent addition
> to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> existing converters.
> 
Hmm.   Not much to see here.

However, it looks like the converter type is being set at component
tree build time rather than render type.

So there is no data table row active at this point, and thus no variable.

Looking at ConvertDateTimeTagBase, I see that the value binding is
evaluated at converter creation time rather than converter-use time.

Same for timezone, pattern and everything else.

I'd say that's a bad design since we evaluate value bindings during
rendering for everything else.

Unfortunately, this design is part of the JSF spec.

http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/

If it were me, I'd write my own converter.   All you need to do is to
change the converter to take value bindings instead of evaluated value
binding results, and change the getters to return the evaluated value
bindings.   In fact, you can simply extend the existing converter to
add some set*ValueBinding() methods, and then, if the value binding
exists, evaluate it instead of using the constant object.

For the end user of the final tag, there shouldn't be any difference
-- the difference would only show up at the java code level.

Converters that evaluate at rendertime would be an excellent addition
to Tomahawk.   I don't currently see any Tomahawk equivalents of the
existing converters.

On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>
>         ConvertDateTimeTagBase.setConverterType(FacesContext,
> DateTimeConverter,
> String) line: 206
>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter() line:
> 89
>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
>         columnsTest.jsp line: 12
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
> HttpServletResponse)
> line: 98
>         testpage_jsp(HttpServlet).service(ServletRequest, ServletResponse)
> line:
> 803
>         JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
> boolean)
> line: 328

[...]

>         ServletExternalContextImpl.dispatch(String) line: 419
>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot,
> String) line:
> 236
>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot) line:
> 222
>         RenderResponseExecutor.execute(FacesContext) line: 41
>         LifecycleImpl.render(FacesContext) line: 132
>         FacesServlet.service(ServletRequest, ServletResponse) line: 140



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


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Daniel,

Sorry it's taken me so long to respond.

The best place to do this is to simply post it to the JIRA issue:

http://issues.apache.org/jira/browse/TOMAHAWK-1018

If it's still a work in progress, you can either post it to the
myfaces-dev list, or to the jira issue with a file name that indicates
the work-in-progress status of it (I'd recommend date-stamping the
file name in that case).


On 6/13/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Hey good news.
> The converter now works fine for me.
> I am going to write a patch for tomahawk but I think someone who has more
> knowlege about tomahawk should look over the code because I think that I
> have code in there which does not fit in your convention.
> Where can I post some of my code?
>
>
> Mike Kienenberger wrote:
> >
> > True, you'll need to copy these methods into your Converter (or base
> > converter) class.
> >
> > I did the same thing in Tomahawk for validators, and that's the best
> > model to use as an example.
> >
> >     org.apache.myfaces.validator.ValidatorBase
> >
> > http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/validator/ValidatorBase.java?view=markup
> >
> >
> > Actually, you're going to want almost everything in that class and
> > everything that's in there is probably just as useful for converters.
> > I'd make your converter inherit from or delegate to this class.   Or
> > you can simply copy everything in there to your converter.    You
> > probably don't need the ability to customize the converter messages
> > yet, but you might want that down the road.   I know we'd want that in
> > the Tomahawk version at some point.
> >
> > On 6/12/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >> Hmm... I ran into troubles again.
> >>
> >> The method getValueBinding(...) is not available in the converter-class.
> >> So
> >> I can't get the expression-strings.
> >> An alternative would be to save the expressions in the converter but I
> >> think
> >> that would be only a quick-and-dirty solution.
> >> Do you have an other idea?
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a11079062
> >> 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#a11099735
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Hey good news.
The converter now works fine for me. 
I am going to write a patch for tomahawk but I think someone who has more
knowlege about tomahawk should look over the code because I think that I
have code in there which does not fit in your convention.
Where can I post some of my code?


Mike Kienenberger wrote:
> 
> True, you'll need to copy these methods into your Converter (or base
> converter) class.
> 
> I did the same thing in Tomahawk for validators, and that's the best
> model to use as an example.
> 
>     org.apache.myfaces.validator.ValidatorBase
> 
> http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/validator/ValidatorBase.java?view=markup
> 
> 
> Actually, you're going to want almost everything in that class and
> everything that's in there is probably just as useful for converters.
> I'd make your converter inherit from or delegate to this class.   Or
> you can simply copy everything in there to your converter.    You
> probably don't need the ability to customize the converter messages
> yet, but you might want that down the road.   I know we'd want that in
> the Tomahawk version at some point.
> 
> On 6/12/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>> Hmm... I ran into troubles again.
>>
>> The method getValueBinding(...) is not available in the converter-class.
>> So
>> I can't get the expression-strings.
>> An alternative would be to save the expressions in the converter but I
>> think
>> that would be only a quick-and-dirty solution.
>> Do you have an other idea?
>> --
>> View this message in context:
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a11079062
>> 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#a11099735
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
True, you'll need to copy these methods into your Converter (or base
converter) class.

I did the same thing in Tomahawk for validators, and that's the best
model to use as an example.

    org.apache.myfaces.validator.ValidatorBase

http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/validator/ValidatorBase.java?view=markup


Actually, you're going to want almost everything in that class and
everything that's in there is probably just as useful for converters.
I'd make your converter inherit from or delegate to this class.   Or
you can simply copy everything in there to your converter.    You
probably don't need the ability to customize the converter messages
yet, but you might want that down the road.   I know we'd want that in
the Tomahawk version at some point.

On 6/12/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Hmm... I ran into troubles again.
>
> The method getValueBinding(...) is not available in the converter-class. So
> I can't get the expression-strings.
> An alternative would be to save the expressions in the converter but I think
> that would be only a quick-and-dirty solution.
> Do you have an other idea?
> --
> View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a11079062
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Hmm... I ran into troubles again.

The method getValueBinding(...) is not available in the converter-class. So
I can't get the expression-strings.
An alternative would be to save the expressions in the converter but I think
that would be only a quick-and-dirty solution. 
Do you have an other idea?
-- 
View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a11079062
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
If you really want to thank me,

1) Provide patches when you've got this all worked out

2) Create a wiki page on adding new value-binding attribute methods to
existing components/converters/validators, clean up the email I sent
out, and stuff it into the wiki page.

:-)


On 6/7/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Wow, thank you very much for your last post.
> After I read the post I really think that it will be easy to patch.
> I will try that as soon as possible.
>
> Hopefully that I will not ask you again about that problem :)
> Thank you for your help.
>
>
> Mike Kienenberger wrote:
> >
> > No, you don't need to add any encode methods.
> >
> > Let's take convertDateTime type as an example.  Note that this one is
> > a little trickier than most since the default value isn't null -- the
> > default is Type.DATE.getName() so we can't simply call the
> > super.getType() method.  We'll also have to create our own local
> > storage for type.
> >
> > 1) Make a subclass of javax.faces.convert.DateTimeConverter (or copy it).
> >
> > 2) Create "protected String localType;"
> >
> > 3) Create String accessors for type.   These already exist in the
> > superclass for this attribute, so we will just override them below.
> >
> > 4) public String getType() would be changed to this:
> >
> >     public String getType() {
> >         if (localType != null) return localType;
> >         ValueBinding vb = getValueBinding("type");
> >         String evaluatedType = vb != null ?
> > org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getStringValue(getFacesContext(),
> > vb) : null;
> >         if (null == evaluatedType)  evaluatedType = Type.DATE.getName();
> >     }
> >
> > 5) public void setType() would be changed to this:
> >
> >     public void setType(String message) {
> >         localType = message;
> >     }
> >
> > 6) since we created our own variable, we'll need to deal with state
> > saving.
> >
> >       // STATE SAVE/RESTORE
> >       public void restoreState(FacesContext facesContext, Object state) {
> >               Object[] values = (Object[]) state;
> >               super.restoreState(facesContext, values[0]);
> >               _type = (String) values[1];
> >       }
> >
> >       public Object saveState(FacesContext facesContext) {
> >               Object[] values = new Object[2];
> >               values[0] = super.saveState(facesContext);
> >               values[1] = localType;
> >               return values;
> >       }
> >
> > Fortunately, the superclass never refers to _type directly, so the
> > converter is finished at this point.  If it did, we'd have been better
> > off copying the source code of the original rather than subclassing.
> >
> > Next you'll need to register the converter in faces-config.  Left as
> > an exercise to the reader.
> >
> > If you're using facelets, all you have to do is create a taglib entry
> > at this point.  Left as an exercise to the reader.
> >
> > If you're using jsp, you need to create a tag handler.
> >
> >
> > 1) Make a subclass of
> > org.apache.myfaces.shared_tomahawk.taglib.core.ConvertDateTimeTagBase
> > (or copy it).
> >
> > 2) Create "protected String localType;"
> >
> > 3)  Create setType to use our type instead of inaccessible private _type.
> >
> >    public void setType(String type)
> >     {
> >         localType = type;
> >     }
> >
> > 4) Extend createConverter to use our type instead of private _type.
> >
> >     protected Converter createConverter() throws JspException
> >     {
> >         DateTimeConverter converter =
> > (DateTimeConverter)super.createConverter();
> >
> >         FacesContext facesContext = FacesContext.getCurrentInstance();
> >
> >         if (localType != null)
> >         {
> >             if (UIComponentTag.isValueReference(localType))
> >             {
> >                 ValueBinding vb =
> > facesContext.getApplication().createValueBinding(localType);
> >                 converter.setValueBinding("type",vb);
> >             }
> >             else
> >             {
> >                 converter.setType(localType);
> >             }
> >         }
> >
> >         return converter;
> >     }
> >
> > 5)  extend release
> >
> >     public void release()
> >     {
> >         super.release();
> >         localType= null;
> >     }
> >
> > 6) Somehow define your converter id -- I'm not a jsp user so I can't
> > say for sure if this is the best way to do it, but this is how it's
> > done for the default DateTimeConverter.
> >
> >     public void setPageContext(PageContext context)
> >     {
> >         super.setPageContext(context);
> >         setConverterId(YOUR_CONVERTER_ID);
> >     }
> >
> > 7) Create a tld entry?  Left as an exercise for the reader.
> >
> > For converters, it may also be possible to simply override the default
> > date time registered converter which might make tld/faces-config setup
> > and using the converter in the page a bit easier.
> >
> > That should be it -- I cut and pasted the various pieces out of the
> > Tomahawk source code, so it's likely there are syntax errors and
> > possibly some other things I've overlooked.   However, it should give
> > you the general process you need to follow in order to write your own
> > converter and show you what steps you need to take for each attribute
> > to convert the remaining ones.   For String-typed attributes that
> > don't provide a non-null default (it looks like only "pattern" falls
> > into this category), you can simply call super.getPattern() and
> > super.setPattern() instead of creating localPattern variable.
> > Probably not worthwhile in this case -- I'd just create local
> > variables for all of them to be consistent.
> >
> > On 6/6/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >> Okay I opened up a a report.
> >> Currently I am trying to do the change by myself but it seems that I have
> >> not enought experience with jsf-tag-development.
> >> If I understood you right, I have to extend the ConvertDateTimeTag-Class
> >> and
> >> add a encodeBegin-method wherein the values are resolved over value
> >> binding.
> >> My Problem is that the ConvertDateTimeTag is normally not rendered so I
> >> can't override the encodeBegin-method.
> >> Sorry for all that questions but because of this problem we are currently
> >> stucked.
> >>
> >>
> >> Mike Kienenberger wrote:
> >> >
> >> > Yep.   Just open a JIRA issue and provide them, using unified diff
> >> > format for changes to existing files.  (You can drop the new files in
> >> > as is although having them in the diff format will make it slightly
> >> > easier to apply the patch).
> >> >
> >> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
> >> >>
> >> >>
> >> >> Mike Kienenberger wrote:
> >> >> >
> >> >> > Converters that evaluate at rendertime would be an excellent
> >> addition
> >> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> >> >> > existing converters.
> >> >> >
> >> >> Do you mean the existing converters? If so, that would be really nice.
> >> >> I had a likewise problem in the same project and had to do a
> >> workaround
> >> >> for
> >> >> it.
> >> >> I am wondering why nobody else had a problem like that.
> >> >>
> >> >> Thank you for your help.
> >> >>
> >> >>
> >> >> Mike Kienenberger wrote:
> >> >> >
> >> >> > Hmm.   Not much to see here.
> >> >> >
> >> >> > However, it looks like the converter type is being set at component
> >> >> > tree build time rather than render type.
> >> >> >
> >> >> > So there is no data table row active at this point, and thus no
> >> >> variable.
> >> >> >
> >> >> > Looking at ConvertDateTimeTagBase, I see that the value binding is
> >> >> > evaluated at converter creation time rather than converter-use time.
> >> >> >
> >> >> > Same for timezone, pattern and everything else.
> >> >> >
> >> >> > I'd say that's a bad design since we evaluate value bindings during
> >> >> > rendering for everything else.
> >> >> >
> >> >> > Unfortunately, this design is part of the JSF spec.
> >> >> >
> >> >> > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
> >> >> >
> >> >> > If it were me, I'd write my own converter.   All you need to do is
> >> to
> >> >> > change the converter to take value bindings instead of evaluated
> >> value
> >> >> > binding results, and change the getters to return the evaluated
> >> value
> >> >> > bindings.   In fact, you can simply extend the existing converter to
> >> >> > add some set*ValueBinding() methods, and then, if the value binding
> >> >> > exists, evaluate it instead of using the constant object.
> >> >> >
> >> >> > For the end user of the final tag, there shouldn't be any difference
> >> >> > -- the difference would only show up at the java code level.
> >> >> >
> >> >> > Converters that evaluate at rendertime would be an excellent
> >> addition
> >> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> >> >> > existing converters.
> >> >> >
> >> >> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
> >> >> >>
> >> >> >>         ConvertDateTimeTagBase.setConverterType(FacesContext,
> >> >> >> DateTimeConverter,
> >> >> >> String) line: 206
> >> >> >>
> >> ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
> >> >> >> line: 89
> >> >> >>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
> >> >> >>         columnsTest.jsp line: 12
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         columnsTest.jsp line: not available
> >> >> >>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
> >> >> >> HttpServletResponse)
> >> >> >> line: 98
> >> >> >>         testpage_jsp(HttpServlet).service(ServletRequest,
> >> >> >> ServletResponse) line:
> >> >> >> 803
> >> >> >>         JspServletWrapper.service(HttpServletRequest,
> >> >> >> HttpServletResponse, boolean)
> >> >> >> line: 328
> >> >> >
> >> >> > [...]
> >> >> >
> >> >> >>         ServletExternalContextImpl.dispatch(String) line: 419
> >> >> >>         JspTilesViewHandlerImpl.dispatch(ExternalContext,
> >> UIViewRoot,
> >> >> >> String) line:
> >> >> >> 236
> >> >> >>         JspTilesViewHandlerImpl.renderView(FacesContext,
> >> UIViewRoot)
> >> >> >> line: 222
> >> >> >>         RenderResponseExecutor.execute(FacesContext) line: 41
> >> >> >>         LifecycleImpl.render(FacesContext) line: 132
> >> >> >>         FacesServlet.service(ServletRequest, ServletResponse) line:
> >> >> 140
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10972746
> >> >> 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#a10984918
> >> 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#a11016632
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Wow, thank you very much for your last post.
After I read the post I really think that it will be easy to patch. 
I will try that as soon as possible.

Hopefully that I will not ask you again about that problem :)
Thank you for your help.


Mike Kienenberger wrote:
> 
> No, you don't need to add any encode methods.
> 
> Let's take convertDateTime type as an example.  Note that this one is
> a little trickier than most since the default value isn't null -- the
> default is Type.DATE.getName() so we can't simply call the
> super.getType() method.  We'll also have to create our own local
> storage for type.
> 
> 1) Make a subclass of javax.faces.convert.DateTimeConverter (or copy it).
> 
> 2) Create "protected String localType;"
> 
> 3) Create String accessors for type.   These already exist in the
> superclass for this attribute, so we will just override them below.
> 
> 4) public String getType() would be changed to this:
> 
>     public String getType() {
>         if (localType != null) return localType;
>         ValueBinding vb = getValueBinding("type");
>         String evaluatedType = vb != null ?
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getStringValue(getFacesContext(),
> vb) : null;
>         if (null == evaluatedType)  evaluatedType = Type.DATE.getName();
>     }
> 
> 5) public void setType() would be changed to this:
> 
>     public void setType(String message) {
>         localType = message;
>     }
> 
> 6) since we created our own variable, we'll need to deal with state
> saving.
> 
> 	// STATE SAVE/RESTORE
> 	public void restoreState(FacesContext facesContext, Object state) {
> 		Object[] values = (Object[]) state;
> 		super.restoreState(facesContext, values[0]);
> 		_type = (String) values[1];
> 	}
> 
> 	public Object saveState(FacesContext facesContext) {
> 		Object[] values = new Object[2];
> 		values[0] = super.saveState(facesContext);
> 		values[1] = localType;
> 		return values;
> 	}
> 
> Fortunately, the superclass never refers to _type directly, so the
> converter is finished at this point.  If it did, we'd have been better
> off copying the source code of the original rather than subclassing.
> 
> Next you'll need to register the converter in faces-config.  Left as
> an exercise to the reader.
> 
> If you're using facelets, all you have to do is create a taglib entry
> at this point.  Left as an exercise to the reader.
> 
> If you're using jsp, you need to create a tag handler.
> 
> 
> 1) Make a subclass of
> org.apache.myfaces.shared_tomahawk.taglib.core.ConvertDateTimeTagBase
> (or copy it).
> 
> 2) Create "protected String localType;"
> 
> 3)  Create setType to use our type instead of inaccessible private _type.
> 
>    public void setType(String type)
>     {
>         localType = type;
>     }
> 
> 4) Extend createConverter to use our type instead of private _type.
> 
>     protected Converter createConverter() throws JspException
>     {
>         DateTimeConverter converter =
> (DateTimeConverter)super.createConverter();
> 
>         FacesContext facesContext = FacesContext.getCurrentInstance();
> 
>         if (localType != null)
>         {
>             if (UIComponentTag.isValueReference(localType))
>             {
>                 ValueBinding vb =
> facesContext.getApplication().createValueBinding(localType);
>                 converter.setValueBinding("type",vb);
>             }
>             else
>             {
>                 converter.setType(localType);
>             }
>         }
> 
>         return converter;
>     }
> 
> 5)  extend release
> 
>     public void release()
>     {
>         super.release();
>         localType= null;
>     }
> 
> 6) Somehow define your converter id -- I'm not a jsp user so I can't
> say for sure if this is the best way to do it, but this is how it's
> done for the default DateTimeConverter.
> 
>     public void setPageContext(PageContext context)
>     {
>         super.setPageContext(context);
>         setConverterId(YOUR_CONVERTER_ID);
>     }
> 
> 7) Create a tld entry?  Left as an exercise for the reader.
> 
> For converters, it may also be possible to simply override the default
> date time registered converter which might make tld/faces-config setup
> and using the converter in the page a bit easier.
> 
> That should be it -- I cut and pasted the various pieces out of the
> Tomahawk source code, so it's likely there are syntax errors and
> possibly some other things I've overlooked.   However, it should give
> you the general process you need to follow in order to write your own
> converter and show you what steps you need to take for each attribute
> to convert the remaining ones.   For String-typed attributes that
> don't provide a non-null default (it looks like only "pattern" falls
> into this category), you can simply call super.getPattern() and
> super.setPattern() instead of creating localPattern variable.
> Probably not worthwhile in this case -- I'd just create local
> variables for all of them to be consistent.
> 
> On 6/6/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>> Okay I opened up a a report.
>> Currently I am trying to do the change by myself but it seems that I have
>> not enought experience with jsf-tag-development.
>> If I understood you right, I have to extend the ConvertDateTimeTag-Class
>> and
>> add a encodeBegin-method wherein the values are resolved over value
>> binding.
>> My Problem is that the ConvertDateTimeTag is normally not rendered so I
>> can't override the encodeBegin-method.
>> Sorry for all that questions but because of this problem we are currently
>> stucked.
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > Yep.   Just open a JIRA issue and provide them, using unified diff
>> > format for changes to existing files.  (You can drop the new files in
>> > as is although having them in the diff format will make it slightly
>> > easier to apply the patch).
>> >
>> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>> >>
>> >>
>> >> Mike Kienenberger wrote:
>> >> >
>> >> > Converters that evaluate at rendertime would be an excellent
>> addition
>> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
>> >> > existing converters.
>> >> >
>> >> Do you mean the existing converters? If so, that would be really nice.
>> >> I had a likewise problem in the same project and had to do a
>> workaround
>> >> for
>> >> it.
>> >> I am wondering why nobody else had a problem like that.
>> >>
>> >> Thank you for your help.
>> >>
>> >>
>> >> Mike Kienenberger wrote:
>> >> >
>> >> > Hmm.   Not much to see here.
>> >> >
>> >> > However, it looks like the converter type is being set at component
>> >> > tree build time rather than render type.
>> >> >
>> >> > So there is no data table row active at this point, and thus no
>> >> variable.
>> >> >
>> >> > Looking at ConvertDateTimeTagBase, I see that the value binding is
>> >> > evaluated at converter creation time rather than converter-use time.
>> >> >
>> >> > Same for timezone, pattern and everything else.
>> >> >
>> >> > I'd say that's a bad design since we evaluate value bindings during
>> >> > rendering for everything else.
>> >> >
>> >> > Unfortunately, this design is part of the JSF spec.
>> >> >
>> >> > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
>> >> >
>> >> > If it were me, I'd write my own converter.   All you need to do is
>> to
>> >> > change the converter to take value bindings instead of evaluated
>> value
>> >> > binding results, and change the getters to return the evaluated
>> value
>> >> > bindings.   In fact, you can simply extend the existing converter to
>> >> > add some set*ValueBinding() methods, and then, if the value binding
>> >> > exists, evaluate it instead of using the constant object.
>> >> >
>> >> > For the end user of the final tag, there shouldn't be any difference
>> >> > -- the difference would only show up at the java code level.
>> >> >
>> >> > Converters that evaluate at rendertime would be an excellent
>> addition
>> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
>> >> > existing converters.
>> >> >
>> >> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>> >> >>
>> >> >>         ConvertDateTimeTagBase.setConverterType(FacesContext,
>> >> >> DateTimeConverter,
>> >> >> String) line: 206
>> >> >>        
>> ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
>> >> >> line: 89
>> >> >>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
>> >> >>         columnsTest.jsp line: 12
>> >> >>         columnsTest.jsp line: not available
>> >> >>         columnsTest.jsp line: not available
>> >> >>         columnsTest.jsp line: not available
>> >> >>         columnsTest.jsp line: not available
>> >> >>         columnsTest.jsp line: not available
>> >> >>         columnsTest.jsp line: not available
>> >> >>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
>> >> >> HttpServletResponse)
>> >> >> line: 98
>> >> >>         testpage_jsp(HttpServlet).service(ServletRequest,
>> >> >> ServletResponse) line:
>> >> >> 803
>> >> >>         JspServletWrapper.service(HttpServletRequest,
>> >> >> HttpServletResponse, boolean)
>> >> >> line: 328
>> >> >
>> >> > [...]
>> >> >
>> >> >>         ServletExternalContextImpl.dispatch(String) line: 419
>> >> >>         JspTilesViewHandlerImpl.dispatch(ExternalContext,
>> UIViewRoot,
>> >> >> String) line:
>> >> >> 236
>> >> >>         JspTilesViewHandlerImpl.renderView(FacesContext,
>> UIViewRoot)
>> >> >> line: 222
>> >> >>         RenderResponseExecutor.execute(FacesContext) line: 41
>> >> >>         LifecycleImpl.render(FacesContext) line: 132
>> >> >>         FacesServlet.service(ServletRequest, ServletResponse) line:
>> >> 140
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10972746
>> >> 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#a10984918
>> 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#a11016632
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
No, you don't need to add any encode methods.

Let's take convertDateTime type as an example.  Note that this one is
a little trickier than most since the default value isn't null -- the
default is Type.DATE.getName() so we can't simply call the
super.getType() method.  We'll also have to create our own local
storage for type.

1) Make a subclass of javax.faces.convert.DateTimeConverter (or copy it).

2) Create "protected String localType;"

3) Create String accessors for type.   These already exist in the
superclass for this attribute, so we will just override them below.

4) public String getType() would be changed to this:

    public String getType() {
        if (localType != null) return localType;
        ValueBinding vb = getValueBinding("type");
        String evaluatedType = vb != null ?
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getStringValue(getFacesContext(),
vb) : null;
        if (null == evaluatedType)  evaluatedType = Type.DATE.getName();
    }

5) public void setType() would be changed to this:

    public void setType(String message) {
        localType = message;
    }

6) since we created our own variable, we'll need to deal with state saving.

	// STATE SAVE/RESTORE
	public void restoreState(FacesContext facesContext, Object state) {
		Object[] values = (Object[]) state;
		super.restoreState(facesContext, values[0]);
		_type = (String) values[1];
	}

	public Object saveState(FacesContext facesContext) {
		Object[] values = new Object[2];
		values[0] = super.saveState(facesContext);
		values[1] = localType;
		return values;
	}

Fortunately, the superclass never refers to _type directly, so the
converter is finished at this point.  If it did, we'd have been better
off copying the source code of the original rather than subclassing.

Next you'll need to register the converter in faces-config.  Left as
an exercise to the reader.

If you're using facelets, all you have to do is create a taglib entry
at this point.  Left as an exercise to the reader.

If you're using jsp, you need to create a tag handler.


1) Make a subclass of
org.apache.myfaces.shared_tomahawk.taglib.core.ConvertDateTimeTagBase
(or copy it).

2) Create "protected String localType;"

3)  Create setType to use our type instead of inaccessible private _type.

   public void setType(String type)
    {
        localType = type;
    }

4) Extend createConverter to use our type instead of private _type.

    protected Converter createConverter() throws JspException
    {
        DateTimeConverter converter =
(DateTimeConverter)super.createConverter();

        FacesContext facesContext = FacesContext.getCurrentInstance();

        if (localType != null)
        {
            if (UIComponentTag.isValueReference(localType))
            {
                ValueBinding vb =
facesContext.getApplication().createValueBinding(localType);
                converter.setValueBinding("type",vb);
            }
            else
            {
                converter.setType(localType);
            }
        }

        return converter;
    }

5)  extend release

    public void release()
    {
        super.release();
        localType= null;
    }

6) Somehow define your converter id -- I'm not a jsp user so I can't
say for sure if this is the best way to do it, but this is how it's
done for the default DateTimeConverter.

    public void setPageContext(PageContext context)
    {
        super.setPageContext(context);
        setConverterId(YOUR_CONVERTER_ID);
    }

7) Create a tld entry?  Left as an exercise for the reader.

For converters, it may also be possible to simply override the default
date time registered converter which might make tld/faces-config setup
and using the converter in the page a bit easier.

That should be it -- I cut and pasted the various pieces out of the
Tomahawk source code, so it's likely there are syntax errors and
possibly some other things I've overlooked.   However, it should give
you the general process you need to follow in order to write your own
converter and show you what steps you need to take for each attribute
to convert the remaining ones.   For String-typed attributes that
don't provide a non-null default (it looks like only "pattern" falls
into this category), you can simply call super.getPattern() and
super.setPattern() instead of creating localPattern variable.
Probably not worthwhile in this case -- I'd just create local
variables for all of them to be consistent.

On 6/6/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Okay I opened up a a report.
> Currently I am trying to do the change by myself but it seems that I have
> not enought experience with jsf-tag-development.
> If I understood you right, I have to extend the ConvertDateTimeTag-Class and
> add a encodeBegin-method wherein the values are resolved over value binding.
> My Problem is that the ConvertDateTimeTag is normally not rendered so I
> can't override the encodeBegin-method.
> Sorry for all that questions but because of this problem we are currently
> stucked.
>
>
> Mike Kienenberger wrote:
> >
> > Yep.   Just open a JIRA issue and provide them, using unified diff
> > format for changes to existing files.  (You can drop the new files in
> > as is although having them in the diff format will make it slightly
> > easier to apply the patch).
> >
> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >>
> >> Mike Kienenberger wrote:
> >> >
> >> > Converters that evaluate at rendertime would be an excellent addition
> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> >> > existing converters.
> >> >
> >> Do you mean the existing converters? If so, that would be really nice.
> >> I had a likewise problem in the same project and had to do a workaround
> >> for
> >> it.
> >> I am wondering why nobody else had a problem like that.
> >>
> >> Thank you for your help.
> >>
> >>
> >> Mike Kienenberger wrote:
> >> >
> >> > Hmm.   Not much to see here.
> >> >
> >> > However, it looks like the converter type is being set at component
> >> > tree build time rather than render type.
> >> >
> >> > So there is no data table row active at this point, and thus no
> >> variable.
> >> >
> >> > Looking at ConvertDateTimeTagBase, I see that the value binding is
> >> > evaluated at converter creation time rather than converter-use time.
> >> >
> >> > Same for timezone, pattern and everything else.
> >> >
> >> > I'd say that's a bad design since we evaluate value bindings during
> >> > rendering for everything else.
> >> >
> >> > Unfortunately, this design is part of the JSF spec.
> >> >
> >> > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
> >> >
> >> > If it were me, I'd write my own converter.   All you need to do is to
> >> > change the converter to take value bindings instead of evaluated value
> >> > binding results, and change the getters to return the evaluated value
> >> > bindings.   In fact, you can simply extend the existing converter to
> >> > add some set*ValueBinding() methods, and then, if the value binding
> >> > exists, evaluate it instead of using the constant object.
> >> >
> >> > For the end user of the final tag, there shouldn't be any difference
> >> > -- the difference would only show up at the java code level.
> >> >
> >> > Converters that evaluate at rendertime would be an excellent addition
> >> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> >> > existing converters.
> >> >
> >> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
> >> >>
> >> >>         ConvertDateTimeTagBase.setConverterType(FacesContext,
> >> >> DateTimeConverter,
> >> >> String) line: 206
> >> >>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
> >> >> line: 89
> >> >>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
> >> >>         columnsTest.jsp line: 12
> >> >>         columnsTest.jsp line: not available
> >> >>         columnsTest.jsp line: not available
> >> >>         columnsTest.jsp line: not available
> >> >>         columnsTest.jsp line: not available
> >> >>         columnsTest.jsp line: not available
> >> >>         columnsTest.jsp line: not available
> >> >>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
> >> >> HttpServletResponse)
> >> >> line: 98
> >> >>         testpage_jsp(HttpServlet).service(ServletRequest,
> >> >> ServletResponse) line:
> >> >> 803
> >> >>         JspServletWrapper.service(HttpServletRequest,
> >> >> HttpServletResponse, boolean)
> >> >> line: 328
> >> >
> >> > [...]
> >> >
> >> >>         ServletExternalContextImpl.dispatch(String) line: 419
> >> >>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot,
> >> >> String) line:
> >> >> 236
> >> >>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot)
> >> >> line: 222
> >> >>         RenderResponseExecutor.execute(FacesContext) line: 41
> >> >>         LifecycleImpl.render(FacesContext) line: 132
> >> >>         FacesServlet.service(ServletRequest, ServletResponse) line:
> >> 140
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10972746
> >> 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#a10984918
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Okay I opened up a a report.
Currently I am trying to do the change by myself but it seems that I have
not enought experience with jsf-tag-development.
If I understood you right, I have to extend the ConvertDateTimeTag-Class and
add a encodeBegin-method wherein the values are resolved over value binding.
My Problem is that the ConvertDateTimeTag is normally not rendered so I
can't override the encodeBegin-method.
Sorry for all that questions but because of this problem we are currently
stucked. 


Mike Kienenberger wrote:
> 
> Yep.   Just open a JIRA issue and provide them, using unified diff
> format for changes to existing files.  (You can drop the new files in
> as is although having them in the diff format will make it slightly
> easier to apply the patch).
> 
> On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > Converters that evaluate at rendertime would be an excellent addition
>> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
>> > existing converters.
>> >
>> Do you mean the existing converters? If so, that would be really nice.
>> I had a likewise problem in the same project and had to do a workaround
>> for
>> it.
>> I am wondering why nobody else had a problem like that.
>>
>> Thank you for your help.
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > Hmm.   Not much to see here.
>> >
>> > However, it looks like the converter type is being set at component
>> > tree build time rather than render type.
>> >
>> > So there is no data table row active at this point, and thus no
>> variable.
>> >
>> > Looking at ConvertDateTimeTagBase, I see that the value binding is
>> > evaluated at converter creation time rather than converter-use time.
>> >
>> > Same for timezone, pattern and everything else.
>> >
>> > I'd say that's a bad design since we evaluate value bindings during
>> > rendering for everything else.
>> >
>> > Unfortunately, this design is part of the JSF spec.
>> >
>> > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
>> >
>> > If it were me, I'd write my own converter.   All you need to do is to
>> > change the converter to take value bindings instead of evaluated value
>> > binding results, and change the getters to return the evaluated value
>> > bindings.   In fact, you can simply extend the existing converter to
>> > add some set*ValueBinding() methods, and then, if the value binding
>> > exists, evaluate it instead of using the constant object.
>> >
>> > For the end user of the final tag, there shouldn't be any difference
>> > -- the difference would only show up at the java code level.
>> >
>> > Converters that evaluate at rendertime would be an excellent addition
>> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
>> > existing converters.
>> >
>> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>> >>
>> >>         ConvertDateTimeTagBase.setConverterType(FacesContext,
>> >> DateTimeConverter,
>> >> String) line: 206
>> >>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
>> >> line: 89
>> >>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
>> >>         columnsTest.jsp line: 12
>> >>         columnsTest.jsp line: not available
>> >>         columnsTest.jsp line: not available
>> >>         columnsTest.jsp line: not available
>> >>         columnsTest.jsp line: not available
>> >>         columnsTest.jsp line: not available
>> >>         columnsTest.jsp line: not available
>> >>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
>> >> HttpServletResponse)
>> >> line: 98
>> >>         testpage_jsp(HttpServlet).service(ServletRequest,
>> >> ServletResponse) line:
>> >> 803
>> >>         JspServletWrapper.service(HttpServletRequest,
>> >> HttpServletResponse, boolean)
>> >> line: 328
>> >
>> > [...]
>> >
>> >>         ServletExternalContextImpl.dispatch(String) line: 419
>> >>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot,
>> >> String) line:
>> >> 236
>> >>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot)
>> >> line: 222
>> >>         RenderResponseExecutor.execute(FacesContext) line: 41
>> >>         LifecycleImpl.render(FacesContext) line: 132
>> >>         FacesServlet.service(ServletRequest, ServletResponse) line:
>> 140
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10972746
>> 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#a10984918
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Yep.   Just open a JIRA issue and provide them, using unified diff
format for changes to existing files.  (You can drop the new files in
as is although having them in the diff format will make it slightly
easier to apply the patch).

On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>
>
> Mike Kienenberger wrote:
> >
> > Converters that evaluate at rendertime would be an excellent addition
> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> > existing converters.
> >
> Do you mean the existing converters? If so, that would be really nice.
> I had a likewise problem in the same project and had to do a workaround for
> it.
> I am wondering why nobody else had a problem like that.
>
> Thank you for your help.
>
>
> Mike Kienenberger wrote:
> >
> > Hmm.   Not much to see here.
> >
> > However, it looks like the converter type is being set at component
> > tree build time rather than render type.
> >
> > So there is no data table row active at this point, and thus no variable.
> >
> > Looking at ConvertDateTimeTagBase, I see that the value binding is
> > evaluated at converter creation time rather than converter-use time.
> >
> > Same for timezone, pattern and everything else.
> >
> > I'd say that's a bad design since we evaluate value bindings during
> > rendering for everything else.
> >
> > Unfortunately, this design is part of the JSF spec.
> >
> > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
> >
> > If it were me, I'd write my own converter.   All you need to do is to
> > change the converter to take value bindings instead of evaluated value
> > binding results, and change the getters to return the evaluated value
> > bindings.   In fact, you can simply extend the existing converter to
> > add some set*ValueBinding() methods, and then, if the value binding
> > exists, evaluate it instead of using the constant object.
> >
> > For the end user of the final tag, there shouldn't be any difference
> > -- the difference would only show up at the java code level.
> >
> > Converters that evaluate at rendertime would be an excellent addition
> > to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> > existing converters.
> >
> > On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >>         ConvertDateTimeTagBase.setConverterType(FacesContext,
> >> DateTimeConverter,
> >> String) line: 206
> >>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
> >> line: 89
> >>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
> >>         columnsTest.jsp line: 12
> >>         columnsTest.jsp line: not available
> >>         columnsTest.jsp line: not available
> >>         columnsTest.jsp line: not available
> >>         columnsTest.jsp line: not available
> >>         columnsTest.jsp line: not available
> >>         columnsTest.jsp line: not available
> >>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
> >> HttpServletResponse)
> >> line: 98
> >>         testpage_jsp(HttpServlet).service(ServletRequest,
> >> ServletResponse) line:
> >> 803
> >>         JspServletWrapper.service(HttpServletRequest,
> >> HttpServletResponse, boolean)
> >> line: 328
> >
> > [...]
> >
> >>         ServletExternalContextImpl.dispatch(String) line: 419
> >>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot,
> >> String) line:
> >> 236
> >>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot)
> >> line: 222
> >>         RenderResponseExecutor.execute(FacesContext) line: 41
> >>         LifecycleImpl.render(FacesContext) line: 132
> >>         FacesServlet.service(ServletRequest, ServletResponse) line: 140
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10972746
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.

Mike Kienenberger wrote:
> 
> Converters that evaluate at rendertime would be an excellent addition
> to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> existing converters.
> 
Do you mean the existing converters? If so, that would be really nice.
I had a likewise problem in the same project and had to do a workaround for
it.
I am wondering why nobody else had a problem like that.

Thank you for your help.


Mike Kienenberger wrote:
> 
> Hmm.   Not much to see here.
> 
> However, it looks like the converter type is being set at component
> tree build time rather than render type.
> 
> So there is no data table row active at this point, and thus no variable.
> 
> Looking at ConvertDateTimeTagBase, I see that the value binding is
> evaluated at converter creation time rather than converter-use time.
> 
> Same for timezone, pattern and everything else.
> 
> I'd say that's a bad design since we evaluate value bindings during
> rendering for everything else.
> 
> Unfortunately, this design is part of the JSF spec.
> 
> http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/
> 
> If it were me, I'd write my own converter.   All you need to do is to
> change the converter to take value bindings instead of evaluated value
> binding results, and change the getters to return the evaluated value
> bindings.   In fact, you can simply extend the existing converter to
> add some set*ValueBinding() methods, and then, if the value binding
> exists, evaluate it instead of using the constant object.
> 
> For the end user of the final tag, there shouldn't be any difference
> -- the difference would only show up at the java code level.
> 
> Converters that evaluate at rendertime would be an excellent addition
> to Tomahawk.   I don't currently see any Tomahawk equivalents of the
> existing converters.
> 
> On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>>         ConvertDateTimeTagBase.setConverterType(FacesContext,
>> DateTimeConverter,
>> String) line: 206
>>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter()
>> line: 89
>>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
>>         columnsTest.jsp line: 12
>>         columnsTest.jsp line: not available
>>         columnsTest.jsp line: not available
>>         columnsTest.jsp line: not available
>>         columnsTest.jsp line: not available
>>         columnsTest.jsp line: not available
>>         columnsTest.jsp line: not available
>>         testpage_jsp(HttpJspBase).service(HttpServletRequest,
>> HttpServletResponse)
>> line: 98
>>         testpage_jsp(HttpServlet).service(ServletRequest,
>> ServletResponse) line:
>> 803
>>         JspServletWrapper.service(HttpServletRequest,
>> HttpServletResponse, boolean)
>> line: 328
> 
> [...]
> 
>>         ServletExternalContextImpl.dispatch(String) line: 419
>>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot,
>> String) line:
>> 236
>>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot)
>> line: 222
>>         RenderResponseExecutor.execute(FacesContext) line: 41
>>         LifecycleImpl.render(FacesContext) line: 132
>>         FacesServlet.service(ServletRequest, ServletResponse) line: 140
> 
> 

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


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Hmm.   Not much to see here.

However, it looks like the converter type is being set at component
tree build time rather than render type.

So there is no data table row active at this point, and thus no variable.

Looking at ConvertDateTimeTagBase, I see that the value binding is
evaluated at converter creation time rather than converter-use time.

Same for timezone, pattern and everything else.

I'd say that's a bad design since we evaluate value bindings during
rendering for everything else.

Unfortunately, this design is part of the JSF spec.

http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/

If it were me, I'd write my own converter.   All you need to do is to
change the converter to take value bindings instead of evaluated value
binding results, and change the getters to return the evaluated value
bindings.   In fact, you can simply extend the existing converter to
add some set*ValueBinding() methods, and then, if the value binding
exists, evaluate it instead of using the constant object.

For the end user of the final tag, there shouldn't be any difference
-- the difference would only show up at the java code level.

Converters that evaluate at rendertime would be an excellent addition
to Tomahawk.   I don't currently see any Tomahawk equivalents of the
existing converters.

On 6/5/07, Daniel Herb <ph...@gmail.com> wrote:
>
>         ConvertDateTimeTagBase.setConverterType(FacesContext, DateTimeConverter,
> String) line: 206
>         ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter() line: 89
>         ConvertDateTimeTag(ConverterTag).doStartTag() line: 66
>         columnsTest.jsp line: 12
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         columnsTest.jsp line: not available
>         testpage_jsp(HttpJspBase).service(HttpServletRequest, HttpServletResponse)
> line: 98
>         testpage_jsp(HttpServlet).service(ServletRequest, ServletResponse) line:
> 803
>         JspServletWrapper.service(HttpServletRequest, HttpServletResponse, boolean)
> line: 328

[...]

>         ServletExternalContextImpl.dispatch(String) line: 419
>         JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot, String) line:
> 236
>         JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot) line: 222
>         RenderResponseExecutor.execute(FacesContext) line: 41
>         LifecycleImpl.render(FacesContext) line: 132
>         FacesServlet.service(ServletRequest, ServletResponse) line: 140

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
	ConvertDateTimeTagBase.setConverterType(FacesContext, DateTimeConverter,
String) line: 206	
	ConvertDateTimeTag(ConvertDateTimeTagBase).createConverter() line: 89	
	ConvertDateTimeTag(ConverterTag).doStartTag() line: 66	
	columnsTest.jsp line: 12
	columnsTest.jsp line: not available	
	columnsTest.jsp line: not available	
	columnsTest.jsp line: not available	
	columnsTest.jsp line: not available	
	columnsTest.jsp line: not available	
	columnsTest.jsp line: not available	
	testpage_jsp(HttpJspBase).service(HttpServletRequest, HttpServletResponse)
line: 98	
	testpage_jsp(HttpServlet).service(ServletRequest, ServletResponse) line:
803	
	JspServletWrapper.service(HttpServletRequest, HttpServletResponse, boolean)
line: 328	
	JspServlet.serviceJspFile(HttpServletRequest, HttpServletResponse, String,
Throwable, boolean) line: 315	
	JspServlet.service(HttpServletRequest, HttpServletResponse) line: 265	
	JspServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 803	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 269	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 264	
	FilterSecurityInterceptor.invoke(FilterInvocation) line: 107	
	FilterSecurityInterceptor.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 72	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	ExceptionTranslationFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 110	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	SecurityContextHolderAwareRequestFilter.doFilter(ServletRequest,
ServletResponse, FilterChain) line: 81	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	

AuthenticationProcessingFilter(AbstractProcessingFilter).doFilter(ServletRequest,
ServletResponse, FilterChain) line: 217	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	HttpSessionContextIntegrationFilter.doFilter(ServletRequest,
ServletResponse, FilterChain) line: 153	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	FilterChainProxy.doFilter(ServletRequest, ServletResponse, FilterChain)
line: 148	
	FilterToBeanProxy.doFilter(ServletRequest, ServletResponse, FilterChain)
line: 98	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 215	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188	
	ApplicationDispatcher.invoke(ServletRequest, ServletResponse,
ApplicationDispatcher$State) line: 691	
	ApplicationDispatcher.processRequest(ServletRequest, ServletResponse,
ApplicationDispatcher$State) line: 469	
	ApplicationDispatcher.doForward(ServletRequest, ServletResponse) line: 403	
	ApplicationDispatcher.forward(ServletRequest, ServletResponse) line: 301	
	ServletExternalContextImpl.dispatch(String) line: 419	
	JspTilesViewHandlerImpl.dispatch(ExternalContext, UIViewRoot, String) line:
236	
	JspTilesViewHandlerImpl.renderView(FacesContext, UIViewRoot) line: 222	
	RenderResponseExecutor.execute(FacesContext) line: 41	
	LifecycleImpl.render(FacesContext) line: 132	
	FacesServlet.service(ServletRequest, ServletResponse) line: 140	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 269	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 264	
	FilterSecurityInterceptor.invoke(FilterInvocation) line: 107	
	FilterSecurityInterceptor.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 72	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	ExceptionTranslationFilter.doFilter(ServletRequest, ServletResponse,
FilterChain) line: 110	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	SecurityContextHolderAwareRequestFilter.doFilter(ServletRequest,
ServletResponse, FilterChain) line: 81	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	

AuthenticationProcessingFilter(AbstractProcessingFilter).doFilter(ServletRequest,
ServletResponse, FilterChain) line: 217	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	HttpSessionContextIntegrationFilter.doFilter(ServletRequest,
ServletResponse, FilterChain) line: 229	
	FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest,
ServletResponse) line: 274	
	FilterChainProxy.doFilter(ServletRequest, ServletResponse, FilterChain)
line: 148	
	FilterToBeanProxy.doFilter(ServletRequest, ServletResponse, FilterChain)
line: 98	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 215	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188	
	ExtensionsFilter.doFilter(ServletRequest, ServletResponse, FilterChain)
line: 147	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse)
line: 215	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 188	
	StandardWrapperValve.invoke(Request, Response) line: 210	
	StandardContextValve.invoke(Request, Response) line: 174	
	StandardHostValve.invoke(Request, Response) line: 127	
	ErrorReportValve.invoke(Request, Response) line: 117	
	StandardEngineValve.invoke(Request, Response) line: 108	
	CoyoteAdapter.service(Request, Response) line: 151	
	Http11Processor.process(InputStream, OutputStream) line: 870	

Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection,
Object[]) line: 665	
	PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 528	
	LeaderFollowerWorkerThread.runIt(Object[]) line: 81	
	ThreadPool$ControlRunnable.run() line: 685	
	ThreadWithAttributes(Thread).run() line: 595	



Mike Kienenberger wrote:
> 
> In Eclipse, if you're stopped at a breakpoint, you can then copy the
> stack trace from the debug view.   I'm not sure how it works in other
> IDEs, but that's probably your best bet.
> 
> I suppose the other quick-fix would be to change the EL expression to
> "#{someBean.property}" and simply have that bean property getter throw
> the stack trace.
> 
> On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>> Thank you for your fast replying.
>>
>> Maybe a dumb question but how can I make a stacktrace without the
>> write-privilege in the tomahawk? I thought can copy the source-code
>> directly
>> in my project but something seems to be wrong.
>>
>> Is there an easy way to do a stacktrace within tomahawk?
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > I wasn't clear (or wasn't reading your post closely enough).
>> >
>> > Post the stack track for the execution of the following call:
>> >
>> > ============================
>> > Further you can set a breakpoint to the line 197 in the file
>> >
>> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
>> > - This method is called correctly (value is the EL-Expression
>> > "#{columnData.dateString}").
>> > - The method detects correctly that the value is an EL-Expression
>> > - The correct value for the EL-Expression can't be found so the vale
>> for
>> > the
>> > attribute is set to null.
>> > ============================
>> >
>> >
>> > On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
>> >>
>> >> Hi ,
>> >> thank you for answering.
>> >>
>> >>
>> >> Mike Kienenberger wrote:
>> >> >
>> >> > Can you post a stack trace from when getDateString() is called?
>> >> >
>> >> But the problem is that getDateString() is not called, so I can't make
>> a
>> >> stacktrace.
>> >> As written in my last post the getDateString method can't be resolved
>> by
>> >> the
>> >> "ELVariableResolver".
>> >> Maybe I misunderstood you.
>> >>
>> >>
>> >> Mike Kienenberger wrote:
>> >> >
>> >> > Can you post a stack trace from when getDateString() is called?
>> >> >
>> >> > Perhaps the converter is caching the value during component tree
>> build
>> >> > time or being called when the table row index is not set.
>> >> >
>> >> >
>> >> > On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
>> >> >>
>> >> >> After some further testing I am relative sure that is it a bug from
>> >> >> myfaces.
>> >> >> I hope with this post I can clearly descibe the problem.
>> >> >>
>> >> >> I have set up a complete fresh
>> >> >> System:
>> >> >> - Tomcat 5.0.28
>> >> >> - MyFaces/Tomahawk 1.1.5
>> >> >>
>> >> >> Bugdescription:
>> >> >> The getter of the Attribute "date" is not called by the
>> >> convertDateTime
>> >> >> when
>> >> >> you are using the var-variable which was set by the columns-tag.
>> >> >> (Test that by setting a breakpoint in the getter-Method of the
>> >> >> "date"-attribute)
>> >> >> Also try to add the following line after the inputText-tag to
>> confirm
>> >> >> that
>> >> >> the var-variable works correctly for other tags:
>> >> >> <h:outputText value="#{columnData.dateString}"></h:outputText>
>> >> >>
>> >> >> It seems that all tags within "http://java.sun.com/jsf/core" can't
>> >> access
>> >> >> the var-variable which was set by the colums-tag. (That was not
>> >> >> completely
>> >> >> tested but it seems so)
>> >> >>
>> >> >> Further you can set a breakpoint to the line 197 in the file
>> >> >>
>> >>
>> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
>> >> >> - This method is called correctly (value is the EL-Expression
>> >> >> "#{columnData.dateString}").
>> >> >> - The method detects correctly that the value is an EL-Expression
>> >> >> - The correct value for the EL-Expression can't be found so the
>> vale
>> >> for
>> >> >> the
>> >> >> attribute is set to null.
>> >> >>
>> >> >> Here are my testfiles:
>> >> >> -ListItem.java-
>> >> >> public class ListItem {
>> >> >>         private String dateString;
>> >> >>         public ListItem()
>> >> >>         {
>> >> >>                 dateString = "date";
>> >> >>         }
>> >> >>         public String getDateString() {
>> >> >>                 return dateString;
>> >> >>         }
>> >> >>
>> >> >>         public void setDateString(String tollerString) {
>> >> >>                 this.dateString = tollerString;
>> >> >>         }
>> >> >> }
>> >> >>
>> >> >> -MyBean.java-
>> >> >> import java.util.ArrayList;
>> >> >> import java.util.List;
>> >> >> public class MyBean {
>> >> >>         private List justAList;
>> >> >>         public MyBean()
>> >> >>         {
>> >> >>                 justAList = new ArrayList<ListItem>();
>> >> >>                 justAList.add(new ListItem());
>> >> >>         }
>> >> >>         public List getJustAList() {
>> >> >>                 return justAList;
>> >> >>         }
>> >> >>         public void setJustAList(List justAList) {
>> >> >>                 this.justAList = justAList;
>> >> >>         }
>> >> >> }
>> >> >>
>> >> >> -columnsTest.jsp-
>> >> >> <%@ page language="java" pageEncoding="ISO-8859-1"%>
>> >> >> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>> >> >> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>> >> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>> >> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> >> >> <html>
>> >> >> <body>
>> >> >>         <f:view>
>> >> >>                 <t:dataTable value="#{myBean.justAList}"
>> >> var="rowData">
>> >> >>                         <t:columns value="#{myBean.justAList}"
>> >> >> var="columnData" >
>> >> >>                                 <h:inputText>
>> >> >>                                         <f:convertDateTime
>> >> >> type="#{columnData.dateString}" />
>> >> >>                                 </h:inputText>
>> >> >>                         </t:columns>
>> >> >>                 </t:dataTable>
>> >> >>         </f:view>
>> >> >> </body>
>> >> >> </html>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
>> >> >> 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#a10955982
>> >> 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#a10957369
>> 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#a10963463
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
In Eclipse, if you're stopped at a breakpoint, you can then copy the
stack trace from the debug view.   I'm not sure how it works in other
IDEs, but that's probably your best bet.

I suppose the other quick-fix would be to change the EL expression to
"#{someBean.property}" and simply have that bean property getter throw
the stack trace.

On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Thank you for your fast replying.
>
> Maybe a dumb question but how can I make a stacktrace without the
> write-privilege in the tomahawk? I thought can copy the source-code directly
> in my project but something seems to be wrong.
>
> Is there an easy way to do a stacktrace within tomahawk?
>
>
> Mike Kienenberger wrote:
> >
> > I wasn't clear (or wasn't reading your post closely enough).
> >
> > Post the stack track for the execution of the following call:
> >
> > ============================
> > Further you can set a breakpoint to the line 197 in the file
> > "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
> > - This method is called correctly (value is the EL-Expression
> > "#{columnData.dateString}").
> > - The method detects correctly that the value is an EL-Expression
> > - The correct value for the EL-Expression can't be found so the vale for
> > the
> > attribute is set to null.
> > ============================
> >
> >
> > On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >> Hi ,
> >> thank you for answering.
> >>
> >>
> >> Mike Kienenberger wrote:
> >> >
> >> > Can you post a stack trace from when getDateString() is called?
> >> >
> >> But the problem is that getDateString() is not called, so I can't make a
> >> stacktrace.
> >> As written in my last post the getDateString method can't be resolved by
> >> the
> >> "ELVariableResolver".
> >> Maybe I misunderstood you.
> >>
> >>
> >> Mike Kienenberger wrote:
> >> >
> >> > Can you post a stack trace from when getDateString() is called?
> >> >
> >> > Perhaps the converter is caching the value during component tree build
> >> > time or being called when the table row index is not set.
> >> >
> >> >
> >> > On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
> >> >>
> >> >> After some further testing I am relative sure that is it a bug from
> >> >> myfaces.
> >> >> I hope with this post I can clearly descibe the problem.
> >> >>
> >> >> I have set up a complete fresh
> >> >> System:
> >> >> - Tomcat 5.0.28
> >> >> - MyFaces/Tomahawk 1.1.5
> >> >>
> >> >> Bugdescription:
> >> >> The getter of the Attribute "date" is not called by the
> >> convertDateTime
> >> >> when
> >> >> you are using the var-variable which was set by the columns-tag.
> >> >> (Test that by setting a breakpoint in the getter-Method of the
> >> >> "date"-attribute)
> >> >> Also try to add the following line after the inputText-tag to confirm
> >> >> that
> >> >> the var-variable works correctly for other tags:
> >> >> <h:outputText value="#{columnData.dateString}"></h:outputText>
> >> >>
> >> >> It seems that all tags within "http://java.sun.com/jsf/core" can't
> >> access
> >> >> the var-variable which was set by the colums-tag. (That was not
> >> >> completely
> >> >> tested but it seems so)
> >> >>
> >> >> Further you can set a breakpoint to the line 197 in the file
> >> >>
> >> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
> >> >> - This method is called correctly (value is the EL-Expression
> >> >> "#{columnData.dateString}").
> >> >> - The method detects correctly that the value is an EL-Expression
> >> >> - The correct value for the EL-Expression can't be found so the vale
> >> for
> >> >> the
> >> >> attribute is set to null.
> >> >>
> >> >> Here are my testfiles:
> >> >> -ListItem.java-
> >> >> public class ListItem {
> >> >>         private String dateString;
> >> >>         public ListItem()
> >> >>         {
> >> >>                 dateString = "date";
> >> >>         }
> >> >>         public String getDateString() {
> >> >>                 return dateString;
> >> >>         }
> >> >>
> >> >>         public void setDateString(String tollerString) {
> >> >>                 this.dateString = tollerString;
> >> >>         }
> >> >> }
> >> >>
> >> >> -MyBean.java-
> >> >> import java.util.ArrayList;
> >> >> import java.util.List;
> >> >> public class MyBean {
> >> >>         private List justAList;
> >> >>         public MyBean()
> >> >>         {
> >> >>                 justAList = new ArrayList<ListItem>();
> >> >>                 justAList.add(new ListItem());
> >> >>         }
> >> >>         public List getJustAList() {
> >> >>                 return justAList;
> >> >>         }
> >> >>         public void setJustAList(List justAList) {
> >> >>                 this.justAList = justAList;
> >> >>         }
> >> >> }
> >> >>
> >> >> -columnsTest.jsp-
> >> >> <%@ page language="java" pageEncoding="ISO-8859-1"%>
> >> >> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> >> >> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> >> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> >> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> >> >> <html>
> >> >> <body>
> >> >>         <f:view>
> >> >>                 <t:dataTable value="#{myBean.justAList}"
> >> var="rowData">
> >> >>                         <t:columns value="#{myBean.justAList}"
> >> >> var="columnData" >
> >> >>                                 <h:inputText>
> >> >>                                         <f:convertDateTime
> >> >> type="#{columnData.dateString}" />
> >> >>                                 </h:inputText>
> >> >>                         </t:columns>
> >> >>                 </t:dataTable>
> >> >>         </f:view>
> >> >> </body>
> >> >> </html>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
> >> >> 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#a10955982
> >> 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#a10957369
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Thank you for your fast replying.

Maybe a dumb question but how can I make a stacktrace without the
write-privilege in the tomahawk? I thought can copy the source-code directly
in my project but something seems to be wrong.

Is there an easy way to do a stacktrace within tomahawk?


Mike Kienenberger wrote:
> 
> I wasn't clear (or wasn't reading your post closely enough).
> 
> Post the stack track for the execution of the following call:
> 
> ============================
> Further you can set a breakpoint to the line 197 in the file
> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
> - This method is called correctly (value is the EL-Expression
> "#{columnData.dateString}").
> - The method detects correctly that the value is an EL-Expression
> - The correct value for the EL-Expression can't be found so the vale for
> the
> attribute is set to null.
> ============================
> 
> 
> On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>> Hi ,
>> thank you for answering.
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > Can you post a stack trace from when getDateString() is called?
>> >
>> But the problem is that getDateString() is not called, so I can't make a
>> stacktrace.
>> As written in my last post the getDateString method can't be resolved by
>> the
>> "ELVariableResolver".
>> Maybe I misunderstood you.
>>
>>
>> Mike Kienenberger wrote:
>> >
>> > Can you post a stack trace from when getDateString() is called?
>> >
>> > Perhaps the converter is caching the value during component tree build
>> > time or being called when the table row index is not set.
>> >
>> >
>> > On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
>> >>
>> >> After some further testing I am relative sure that is it a bug from
>> >> myfaces.
>> >> I hope with this post I can clearly descibe the problem.
>> >>
>> >> I have set up a complete fresh
>> >> System:
>> >> - Tomcat 5.0.28
>> >> - MyFaces/Tomahawk 1.1.5
>> >>
>> >> Bugdescription:
>> >> The getter of the Attribute "date" is not called by the
>> convertDateTime
>> >> when
>> >> you are using the var-variable which was set by the columns-tag.
>> >> (Test that by setting a breakpoint in the getter-Method of the
>> >> "date"-attribute)
>> >> Also try to add the following line after the inputText-tag to confirm
>> >> that
>> >> the var-variable works correctly for other tags:
>> >> <h:outputText value="#{columnData.dateString}"></h:outputText>
>> >>
>> >> It seems that all tags within "http://java.sun.com/jsf/core" can't
>> access
>> >> the var-variable which was set by the colums-tag. (That was not
>> >> completely
>> >> tested but it seems so)
>> >>
>> >> Further you can set a breakpoint to the line 197 in the file
>> >>
>> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
>> >> - This method is called correctly (value is the EL-Expression
>> >> "#{columnData.dateString}").
>> >> - The method detects correctly that the value is an EL-Expression
>> >> - The correct value for the EL-Expression can't be found so the vale
>> for
>> >> the
>> >> attribute is set to null.
>> >>
>> >> Here are my testfiles:
>> >> -ListItem.java-
>> >> public class ListItem {
>> >>         private String dateString;
>> >>         public ListItem()
>> >>         {
>> >>                 dateString = "date";
>> >>         }
>> >>         public String getDateString() {
>> >>                 return dateString;
>> >>         }
>> >>
>> >>         public void setDateString(String tollerString) {
>> >>                 this.dateString = tollerString;
>> >>         }
>> >> }
>> >>
>> >> -MyBean.java-
>> >> import java.util.ArrayList;
>> >> import java.util.List;
>> >> public class MyBean {
>> >>         private List justAList;
>> >>         public MyBean()
>> >>         {
>> >>                 justAList = new ArrayList<ListItem>();
>> >>                 justAList.add(new ListItem());
>> >>         }
>> >>         public List getJustAList() {
>> >>                 return justAList;
>> >>         }
>> >>         public void setJustAList(List justAList) {
>> >>                 this.justAList = justAList;
>> >>         }
>> >> }
>> >>
>> >> -columnsTest.jsp-
>> >> <%@ page language="java" pageEncoding="ISO-8859-1"%>
>> >> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>> >> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> >> <html>
>> >> <body>
>> >>         <f:view>
>> >>                 <t:dataTable value="#{myBean.justAList}"
>> var="rowData">
>> >>                         <t:columns value="#{myBean.justAList}"
>> >> var="columnData" >
>> >>                                 <h:inputText>
>> >>                                         <f:convertDateTime
>> >> type="#{columnData.dateString}" />
>> >>                                 </h:inputText>
>> >>                         </t:columns>
>> >>                 </t:dataTable>
>> >>         </f:view>
>> >> </body>
>> >> </html>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
>> >> 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#a10955982
>> 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#a10957369
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
I wasn't clear (or wasn't reading your post closely enough).

Post the stack track for the execution of the following call:

============================
Further you can set a breakpoint to the line 197 in the file
"org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
- This method is called correctly (value is the EL-Expression
"#{columnData.dateString}").
- The method detects correctly that the value is an EL-Expression
- The correct value for the EL-Expression can't be found so the vale for the
attribute is set to null.
============================


On 6/4/07, Daniel Herb <ph...@gmail.com> wrote:
>
> Hi ,
> thank you for answering.
>
>
> Mike Kienenberger wrote:
> >
> > Can you post a stack trace from when getDateString() is called?
> >
> But the problem is that getDateString() is not called, so I can't make a
> stacktrace.
> As written in my last post the getDateString method can't be resolved by the
> "ELVariableResolver".
> Maybe I misunderstood you.
>
>
> Mike Kienenberger wrote:
> >
> > Can you post a stack trace from when getDateString() is called?
> >
> > Perhaps the converter is caching the value during component tree build
> > time or being called when the table row index is not set.
> >
> >
> > On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
> >>
> >> After some further testing I am relative sure that is it a bug from
> >> myfaces.
> >> I hope with this post I can clearly descibe the problem.
> >>
> >> I have set up a complete fresh
> >> System:
> >> - Tomcat 5.0.28
> >> - MyFaces/Tomahawk 1.1.5
> >>
> >> Bugdescription:
> >> The getter of the Attribute "date" is not called by the convertDateTime
> >> when
> >> you are using the var-variable which was set by the columns-tag.
> >> (Test that by setting a breakpoint in the getter-Method of the
> >> "date"-attribute)
> >> Also try to add the following line after the inputText-tag to confirm
> >> that
> >> the var-variable works correctly for other tags:
> >> <h:outputText value="#{columnData.dateString}"></h:outputText>
> >>
> >> It seems that all tags within "http://java.sun.com/jsf/core" can't access
> >> the var-variable which was set by the colums-tag. (That was not
> >> completely
> >> tested but it seems so)
> >>
> >> Further you can set a breakpoint to the line 197 in the file
> >> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
> >> - This method is called correctly (value is the EL-Expression
> >> "#{columnData.dateString}").
> >> - The method detects correctly that the value is an EL-Expression
> >> - The correct value for the EL-Expression can't be found so the vale for
> >> the
> >> attribute is set to null.
> >>
> >> Here are my testfiles:
> >> -ListItem.java-
> >> public class ListItem {
> >>         private String dateString;
> >>         public ListItem()
> >>         {
> >>                 dateString = "date";
> >>         }
> >>         public String getDateString() {
> >>                 return dateString;
> >>         }
> >>
> >>         public void setDateString(String tollerString) {
> >>                 this.dateString = tollerString;
> >>         }
> >> }
> >>
> >> -MyBean.java-
> >> import java.util.ArrayList;
> >> import java.util.List;
> >> public class MyBean {
> >>         private List justAList;
> >>         public MyBean()
> >>         {
> >>                 justAList = new ArrayList<ListItem>();
> >>                 justAList.add(new ListItem());
> >>         }
> >>         public List getJustAList() {
> >>                 return justAList;
> >>         }
> >>         public void setJustAList(List justAList) {
> >>                 this.justAList = justAList;
> >>         }
> >> }
> >>
> >> -columnsTest.jsp-
> >> <%@ page language="java" pageEncoding="ISO-8859-1"%>
> >> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> >> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> >> <html>
> >> <body>
> >>         <f:view>
> >>                 <t:dataTable value="#{myBean.justAList}" var="rowData">
> >>                         <t:columns value="#{myBean.justAList}"
> >> var="columnData" >
> >>                                 <h:inputText>
> >>                                         <f:convertDateTime
> >> type="#{columnData.dateString}" />
> >>                                 </h:inputText>
> >>                         </t:columns>
> >>                 </t:dataTable>
> >>         </f:view>
> >> </body>
> >> </html>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
> >> 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#a10955982
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
Hi ,
thank you for answering.


Mike Kienenberger wrote:
> 
> Can you post a stack trace from when getDateString() is called?
> 
But the problem is that getDateString() is not called, so I can't make a
stacktrace.
As written in my last post the getDateString method can't be resolved by the
"ELVariableResolver".
Maybe I misunderstood you.


Mike Kienenberger wrote:
> 
> Can you post a stack trace from when getDateString() is called?
> 
> Perhaps the converter is caching the value during component tree build
> time or being called when the table row index is not set.
> 
> 
> On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
>>
>> After some further testing I am relative sure that is it a bug from
>> myfaces.
>> I hope with this post I can clearly descibe the problem.
>>
>> I have set up a complete fresh
>> System:
>> - Tomcat 5.0.28
>> - MyFaces/Tomahawk 1.1.5
>>
>> Bugdescription:
>> The getter of the Attribute "date" is not called by the convertDateTime
>> when
>> you are using the var-variable which was set by the columns-tag.
>> (Test that by setting a breakpoint in the getter-Method of the
>> "date"-attribute)
>> Also try to add the following line after the inputText-tag to confirm
>> that
>> the var-variable works correctly for other tags:
>> <h:outputText value="#{columnData.dateString}"></h:outputText>
>>
>> It seems that all tags within "http://java.sun.com/jsf/core" can't access
>> the var-variable which was set by the colums-tag. (That was not
>> completely
>> tested but it seems so)
>>
>> Further you can set a breakpoint to the line 197 in the file
>> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
>> - This method is called correctly (value is the EL-Expression
>> "#{columnData.dateString}").
>> - The method detects correctly that the value is an EL-Expression
>> - The correct value for the EL-Expression can't be found so the vale for
>> the
>> attribute is set to null.
>>
>> Here are my testfiles:
>> -ListItem.java-
>> public class ListItem {
>>         private String dateString;
>>         public ListItem()
>>         {
>>                 dateString = "date";
>>         }
>>         public String getDateString() {
>>                 return dateString;
>>         }
>>
>>         public void setDateString(String tollerString) {
>>                 this.dateString = tollerString;
>>         }
>> }
>>
>> -MyBean.java-
>> import java.util.ArrayList;
>> import java.util.List;
>> public class MyBean {
>>         private List justAList;
>>         public MyBean()
>>         {
>>                 justAList = new ArrayList<ListItem>();
>>                 justAList.add(new ListItem());
>>         }
>>         public List getJustAList() {
>>                 return justAList;
>>         }
>>         public void setJustAList(List justAList) {
>>                 this.justAList = justAList;
>>         }
>> }
>>
>> -columnsTest.jsp-
>> <%@ page language="java" pageEncoding="ISO-8859-1"%>
>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <body>
>>         <f:view>
>>                 <t:dataTable value="#{myBean.justAList}" var="rowData">
>>                         <t:columns value="#{myBean.justAList}"
>> var="columnData" >
>>                                 <h:inputText>
>>                                         <f:convertDateTime
>> type="#{columnData.dateString}" />
>>                                 </h:inputText>
>>                         </t:columns>
>>                 </t:dataTable>
>>         </f:view>
>> </body>
>> </html>
>> --
>> View this message in context:
>> http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
>> 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#a10955982
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Can you post a stack trace from when getDateString() is called?

Perhaps the converter is caching the value during component tree build
time or being called when the table row index is not set.


On 6/2/07, Daniel Herb <ph...@gmail.com> wrote:
>
> After some further testing I am relative sure that is it a bug from myfaces.
> I hope with this post I can clearly descibe the problem.
>
> I have set up a complete fresh
> System:
> - Tomcat 5.0.28
> - MyFaces/Tomahawk 1.1.5
>
> Bugdescription:
> The getter of the Attribute "date" is not called by the convertDateTime when
> you are using the var-variable which was set by the columns-tag.
> (Test that by setting a breakpoint in the getter-Method of the
> "date"-attribute)
> Also try to add the following line after the inputText-tag to confirm that
> the var-variable works correctly for other tags:
> <h:outputText value="#{columnData.dateString}"></h:outputText>
>
> It seems that all tags within "http://java.sun.com/jsf/core" can't access
> the var-variable which was set by the colums-tag. (That was not completely
> tested but it seems so)
>
> Further you can set a breakpoint to the line 197 in the file
> "org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
> - This method is called correctly (value is the EL-Expression
> "#{columnData.dateString}").
> - The method detects correctly that the value is an EL-Expression
> - The correct value for the EL-Expression can't be found so the vale for the
> attribute is set to null.
>
> Here are my testfiles:
> -ListItem.java-
> public class ListItem {
>         private String dateString;
>         public ListItem()
>         {
>                 dateString = "date";
>         }
>         public String getDateString() {
>                 return dateString;
>         }
>
>         public void setDateString(String tollerString) {
>                 this.dateString = tollerString;
>         }
> }
>
> -MyBean.java-
> import java.util.ArrayList;
> import java.util.List;
> public class MyBean {
>         private List justAList;
>         public MyBean()
>         {
>                 justAList = new ArrayList<ListItem>();
>                 justAList.add(new ListItem());
>         }
>         public List getJustAList() {
>                 return justAList;
>         }
>         public void setJustAList(List justAList) {
>                 this.justAList = justAList;
>         }
> }
>
> -columnsTest.jsp-
> <%@ page language="java" pageEncoding="ISO-8859-1"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <body>
>         <f:view>
>                 <t:dataTable value="#{myBean.justAList}" var="rowData">
>                         <t:columns value="#{myBean.justAList}" var="columnData" >
>                                 <h:inputText>
>                                         <f:convertDateTime type="#{columnData.dateString}" />
>                                 </h:inputText>
>                         </t:columns>
>                 </t:dataTable>
>         </f:view>
> </body>
> </html>
> --
> View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
After some further testing I am relative sure that is it a bug from myfaces. 
I hope with this post I can clearly descibe the problem.

I have set up a complete fresh 
System:
- Tomcat 5.0.28
- MyFaces/Tomahawk 1.1.5

Bugdescription:
The getter of the Attribute "date" is not called by the convertDateTime when
you are using the var-variable which was set by the columns-tag. 
(Test that by setting a breakpoint in the getter-Method of the
"date"-attribute)
Also try to add the following line after the inputText-tag to confirm that
the var-variable works correctly for other tags:
<h:outputText value="#{columnData.dateString}"></h:outputText>

It seems that all tags within "http://java.sun.com/jsf/core" can't access
the var-variable which was set by the colums-tag. (That was not completely
tested but it seems so)

Further you can set a breakpoint to the line 197 in the file
"org.apache.myfaces.shared_impl.taglib.core.ConvertDateTimeTagBase.class".
- This method is called correctly (value is the EL-Expression
"#{columnData.dateString}"). 
- The method detects correctly that the value is an EL-Expression
- The correct value for the EL-Expression can't be found so the vale for the
attribute is set to null.

Here are my testfiles:
-ListItem.java-
public class ListItem {
	private String dateString;
	public ListItem()
	{
		dateString = "date";
	}
	public String getDateString() {
		return dateString;
	}

	public void setDateString(String tollerString) {
		this.dateString = tollerString;
	}
}

-MyBean.java-
import java.util.ArrayList;
import java.util.List;
public class MyBean {
	private List justAList;
	public MyBean()
	{
		justAList = new ArrayList<ListItem>();
		justAList.add(new ListItem());
	}
	public List getJustAList() {
		return justAList;
	}
	public void setJustAList(List justAList) {
		this.justAList = justAList;
	}
}

-columnsTest.jsp-
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
	<f:view>
		<t:dataTable value="#{myBean.justAList}" var="rowData">
			<t:columns value="#{myBean.justAList}" var="columnData" >
				<h:inputText>
					<f:convertDateTime type="#{columnData.dateString}" />
				</h:inputText>
			</t:columns>
		</t:dataTable>
	</f:view>
</body>
</html>
-- 
View this message in context: http://www.nabble.com/Possible-bug-in-the-columns-tag-with-the-convertDateTime-tag-tf3845423.html#a10933120
Sent from the My Faces - Dev mailing list archive at Nabble.com.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Daniel Herb <ph...@gmail.com>.
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.


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Paul Spencer <pa...@apache.org>.
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.
>>>
>>
> 


Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Johnny Sutherland <jo...@basf-it-services.com>.
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#a10913960
Sent from the My Faces - Dev mailing list archive at Nabble.com.

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
Duh.  Thanks, Volker, you're right.   I completely interpreted that
the wrong way.

On 6/1/07, Volker Weber <v....@inexso.de> wrote:
> Hi,
>
> this docs i would read like this:
>
> The argument of 'timeZone' should be a String or a valueBinding that evaluates
> to a TimeZone instance.
>
> The getter of timeZone should NOT of type String, but of type
> java.util.TimeZone.
>
>
> Regards,
>     Volker
>
>
>
> 2007/6/1, Mike Kienenberger <mk...@gmail.com>:
> > 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 <jo...@basf-it-services.com> 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.
> > >
> > >  <t:dataTable id="edbcd" var="data" preserveDataModel="false"
> > >  value="#{masterDataController.sortableList.dataModel}"
> > >  sortColumn="#{masterDataController.sortableList.sort}"
> > > sortAscending="#{masterDataController.sortableList.ascending}"
> > >  preserveSort="false" renderedIfEmpty="false">
> > >
> > >  <t:columns var="columnInfo"
> > >  value="#{masterDataController.sortableList.columnInfos}">
> > >
> > >  <h:inputText value="#{masterDataController}">
> > >  <f:convertDateTime timeZone="#{columnInfo.timeZone}"
> > > pattern="#{columnInfo.pattern}" /> (These values are not accessed)
> > >  </h:inputText>
> > >
> > >  <h:outputText value="#{columnInfo.timeZone}" /> (These values will be
> > > displayed)
> > >  <h:outputText value="#{columnInfo.pattern}" /> (These values will be
> > > displayed)
> > >  </t:columns>
> > >  </t:dataTable>
> > >
> > > 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.
> > >
> >
>

Re: Possible bug in the columns tag with the convertDateTime tag

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

this docs i would read like this:

The argument of 'timeZone' should be a String or a valueBinding that evaluates
to a TimeZone instance.

The getter of timeZone should NOT of type String, but of type
java.util.TimeZone.


Regards,
    Volker



2007/6/1, Mike Kienenberger <mk...@gmail.com>:
> 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 <jo...@basf-it-services.com> 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.
> >
> >  <t:dataTable id="edbcd" var="data" preserveDataModel="false"
> >  value="#{masterDataController.sortableList.dataModel}"
> >  sortColumn="#{masterDataController.sortableList.sort}"
> > sortAscending="#{masterDataController.sortableList.ascending}"
> >  preserveSort="false" renderedIfEmpty="false">
> >
> >  <t:columns var="columnInfo"
> >  value="#{masterDataController.sortableList.columnInfos}">
> >
> >  <h:inputText value="#{masterDataController}">
> >  <f:convertDateTime timeZone="#{columnInfo.timeZone}"
> > pattern="#{columnInfo.pattern}" /> (These values are not accessed)
> >  </h:inputText>
> >
> >  <h:outputText value="#{columnInfo.timeZone}" /> (These values will be
> > displayed)
> >  <h:outputText value="#{columnInfo.pattern}" /> (These values will be
> > displayed)
> >  </t:columns>
> >  </t:dataTable>
> >
> > 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.
> >
>

Re: Possible bug in the columns tag with the convertDateTime tag

Posted by Mike Kienenberger <mk...@gmail.com>.
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 <jo...@basf-it-services.com> 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.
>
>  <t:dataTable id="edbcd" var="data" preserveDataModel="false"
>  value="#{masterDataController.sortableList.dataModel}"
>  sortColumn="#{masterDataController.sortableList.sort}"
> sortAscending="#{masterDataController.sortableList.ascending}"
>  preserveSort="false" renderedIfEmpty="false">
>
>  <t:columns var="columnInfo"
>  value="#{masterDataController.sortableList.columnInfos}">
>
>  <h:inputText value="#{masterDataController}">
>  <f:convertDateTime timeZone="#{columnInfo.timeZone}"
> pattern="#{columnInfo.pattern}" /> (These values are not accessed)
>  </h:inputText>
>
>  <h:outputText value="#{columnInfo.timeZone}" /> (These values will be
> displayed)
>  <h:outputText value="#{columnInfo.pattern}" /> (These values will be
> displayed)
>  </t:columns>
>  </t:dataTable>
>
> 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.
>