[
http://issues.apache.org/jira/browse/MYFACES-853?page=comments#action_12362805
]
Dave commented on MYFACES-853:
------------------------------
I tested the latest build today for dataList.
<commandLink> works.
but <inputText> did not work. the setter method (setTitle) was never called
during model update.
-------------TestBean.java --------------
import java.util.ArrayList;
import java.util.List;
public class TestBean {
private String name;
private List<Book> books;
public TestBean() {
books = new ArrayList<Book>();
for (int i=0; i<10; i++) {
books.add(new Book("Title" + i, "Author" + i));
}
}
public List<Book> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
this.books = books;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String clickLink() {
System.out.println("Clicked" );
return null;
}
}
-----------------Book.java -----------------
public class Book {
private String title;
private String author;
public Book() {
}
public Book(String title, String author) {
this.title = title;
this.author = author;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String clickLink() {
System.out.println("Click: " + getTitle());
return null;
}
}
---------------------test.jsp --------------------------
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ 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"%>
<HTML>
<head>
</head>
<f:view>
<%-- test dataList --%>
<h:form>
<t:dataList id="books"
var="book"
value="#{testBean.books}"
layout="simple"
rowCountVar="rowCount"
rowIndexVar="rowIndex">
<h:commandLink value="#{book.title}"
action="#{book.clickLink}"/>
<f:verbatim> </f:verbatim>
<h:inputText value="#{book.title}"/>
<f:verbatim> </f:verbatim>
</t:dataList>
<h:commandButton value="Submit" />
</h:form>
</f:view>
</HTML>
> commandLink not working inside dataList
> ---------------------------------------
>
> Key: MYFACES-853
> URL: http://issues.apache.org/jira/browse/MYFACES-853
> Project: MyFaces
> Type: Bug
> Versions: 1.1.1
> Environment: WinXP,tomcat 5.5.9,myfaces-1.1.1,JDK 1.5
> Reporter: Alexander Traeder
> Assignee: Martin Marinschek
> Fix For: Nightly
> Attachments: api.txt, tomahawk.txt, tomahawk2.txt
>
> in following code fragement the action-method "testService.listenOnSelect"
> is never called:
> <%@ 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"%>
> <f:subview id="test">
> <h:form id="testform">
> <h:panelGrid columns="1">
> <t:dataList id="datalist" style="standardList"
> var="test"
> value="#{testService.entries}"
> rowCountVar="rowCount"
> rowIndexVar="rowIndex"
> layout="unorderedList">
> <h:commandLink id="test_ref"
> value="#{rowIndex + 1}" action="#{testService.listenOnSelect}" />
>
> </t:dataList>
> </h:panelGrid>
> </h:form>
> </f:subview>
> after some testing i also tried the nightly build but with the same result
> also tried the following (working in other scenarios):
> <h:commandLink id="testref" immediate="true"
> value="#{rowIndex + 1}" action="">
> <t:updateActionListener
> property="#{rowCount}" value="#{testService.searchRow}" />
> </h:commandLink>
> any ideas?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira