-
1. Re: h:inputText inside rich:datatable
ilya_shaikovsky Aug 19, 2009 11:21 AM (in response to nmaric)why do you need the binding in general?
binding to component should be request scoped. -
2. Re: h:inputText inside rich:datatable
nmaric Aug 19, 2009 11:41 AM (in response to nmaric)i use it for rowIndex 'cause i have to have button to reset particular row to default values, before changing. also, have to add new rows and some other things that is already implemented into HtmlDataTable
i changed scope to request, but still the same -
3. Re: h:inputText inside rich:datatable
ilya_shaikovsky Aug 20, 2009 3:40 AM (in response to nmaric)also remove immediate from command link.
-
4. Re: h:inputText inside rich:datatable
nmaric Aug 20, 2009 3:51 AM (in response to nmaric)good morning.
i removed binding from table but still there is no changes.
i am stuckand can't see what i am doing wrong. please help.
here is all code:
datatable.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="/WEB-INF/my_custom_tags.tld" prefix="custom"%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Inputtext inside datatable
<f:view>
<h:form id="mainForm">
<a4j:region>
<rich:dataTable id="objects" value="#{myBean.list}" var="obj">
<rich:column>
<h:inputText id="input_value" value="#{obj.value}" />
</rich:column>
</rich:dataTable>
<a4j:commandLink id="continueLink" immediate="true" action="#{myBean.onContinue}">
<h:graphicImage value="/images/butt-continue.gif" />
</a4j:commandLink>
</a4j:region>
</h:form>
</f:view>
MyBean.java
class MyBean{
private List list = null;
public List getList() {
if (list == null) {
list = new ArrayList();
SomeObject obj = new SomeObject();
obj.setValue("1");
list.add(obj);
obj = new SomeObject();
obj.setValue("2");
list.add(obj);
obj = new SomeObject();
obj.setValue("3");
list.add(obj);
}
return list;
}
public String onContinue () {
for (SomeObject obj : list) {
System.out.println("obj.getValue()...." + obj.getValue());
}
return null;
}
}
SomeObject.java
class SomeObject {
private String type;
private String value;
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setValue(String value) {
this.value = value;
}
public String getValue() {
return value;
}
} -
5. Re: h:inputText inside rich:datatable
ilya_shaikovsky Aug 20, 2009 3:54 AM (in response to nmaric)see my previous comment.
-
6. Re: h:inputText inside rich:datatable
nmaric Aug 20, 2009 4:51 AM (in response to nmaric)that's it!!!
it works!!
now i noticed some other bugs :) but at least i can go forward.
i used immediate 'cause link didn't work at all without it. but now i see that problem isn't in link, the problem is somewhere inside datatable.
thanks, again :)