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 <[EMAIL PROTECTED]> 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.


Reply via email to