ValueChangeListeners and Validators does not fire under dataTable

Hi all,

I'm very new to JSF and I'm having a really hard time with it performing a simple task as trying to get only the rows that were changed under dataTable using inputText:

this is the part of the page that displays the data:

<h:form binding="#{b_application_params.outerForm}" id="outerForm">

<h:messages layout="table" styleClass="error"

showDetail="true"/>

<h2>Application parameters</h2>

<table width="100%" cellpadding="3" cellspacing="3" border="0" class="outerBg">

<tr>

<td width="10%">choose:</td>

<td>

<h:selectOneMenu immediate="true" id="catagoryList"

tabindex="1" required="true"

binding="#{b_application_params.catagoryList}">

<f:selectItems value="#{b_application_params.siCatagoryList}"

binding="#{b_application_params.selectItems1}"

id="selectItems1"/>

</h:selectOneMenu>

</td>

</tr>

</table>

<p align="left">

<h:commandButton value="show"

binding="#{b_application_params.btnShowParams}"

id="btnShowParams"

styleClass="form_btn"

action="#{b_application_params.displayApplicationParams}"/>

</h:form>

<h:form binding="#{b_application_params.innerForm}" id="innerForm">

<h:messages layout="table" styleClass="error"

showDetail="true"/>

<h:dataTable var="appParam"

binding="#{b_application_params.paramTable}"

id="paramTable"

value="#{b_application_params.parameters}"

headerClass="table_header"

rowClasses="tbldrk, tbllght"

style="width: 100%;"

cellpadding="1"

cellspacing="1">

<h:column>

<f:facet name="header">

<h:outputText style="width: 10%;"/>

</f:facet>

<h:selectBooleanCheckbox/>

</h:column>

<h:column>

<f:facet name="header">

<h:outputText value="param name" style="width: 40%;"/>

</f:facet>

<h:outputText id="appDescription" value="#{appParam.description}"/>

</h:column>

<h:column>

<f:facet name="header">

<h:outputText value="param value" style="width: 50%;"/>

</f:facet>

<h:inputText value="#{appParam.value}" dir="ltr"

required="true" id="appValue"

valueChangeListener="#{b_application_params.appParam_valueChangeListener}">

</h:inputText>

</h:column>

</h:dataTable>

<p align="left">

<h:commandButton value="submit"

binding="#{b_application_params.saveDataBtn}"

id="saveDataBtn"

styleClass="form_btn" type="submit"/>

</h:form>

Selecting a value fromcatagoryList and clicking on theshow button will display a tableData with 3 columns;

1. empty check boxes (I only add it cause i tried to find a work around solution).

2. param name - output text.

3. param value - input text - that can be modified.

After editing the required data the user then clicking thesubmit button to save the data. As you can see theparam value has a binding to a valueChangeListener method

publicvoid appParam_valueChangeListener(ValueChangeEvent valueChangeEvent)throws AbortProcessingException{

System.out.println("appParam_valueChangeListener");

}

that never been fired when I'm submitting the form.

I searched the forums and tried to use all kind o other solutions but I just can't figure it out.( The managed bean is defined in the request scope. )

Message was edited by: removed onchange attribute

Shachar

[5529 byte] By [Shachara] at [2007-11-26 15:45:10]
# 1
I don't see a problem in the code quickly. First thing to try is to change the scope to session. If this will solve the problem, then you may take a look to the data loading logic.
BalusCa at 2007-7-8 22:04:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thank you for your replay (and sorry for my late response). Changing the scope of the bean to Session Scope solved the problem, but storing all the information on the session brings with it other issues(memory, performance and more).

Is there a way to enjoy the ChangeListenerEvents with out storing the data on the session?

Shachar

Shachara at 2007-7-8 22:04:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Do something like in the b_application_params bean:public List getParameters() {

if (parameters == null) {

loadParameters();

}

return parameters;

}

Also see http://balusc.xs4all.nl/srv/dev-jep-dat.html

BalusCa at 2007-7-8 22:04:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thx...
Shachara at 2007-7-8 22:04:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...