voyent
inputText in dataTable footer does not get refreshed  XML
Forum Index -> Components
Author Message
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Hi there!
So I have this dataTable with a rowSelector. The column content is static (only outputText) but in the footer of each column I have an inputText which allows editing the currently selected row.
The problem is that the inputText fields do not get updated. The selection event gets to the server, the selectionListener is executed, I have forced the refreshing of the inputText fields (by setting their value and submittedValue to null and localValue to false), but the DOM update log doesn't show any update coming back to the browser.
Now, if instead of putting those fields in the footer of each column I move them below the table, everything works fine, but I wanted them to be nicely aligned with the content in the table ....
Code:
 
 		<ice:dataTable value="#{codeController.codeList}" var="row" styleClass="CodeTable"
 		rows="10" id="CodeTable" columnWidths="120px,640px">
 		<ice:column>
 			<ice:rowSelector value="#{row.selected}" multiple="false" selectionListener="#{codeController.selectionChanged}" />
 			<f:facet name="header">Code</f:facet>
 			<ice:outputText value="#{row.code}" />
 			<f:facet name="footer">
 				<ice:inputText value="#{codeController.code.code}" 
 					size="6" maxlength="4" label="Code" required="true" binding="#{codeController.txtCode}">
 					<f:validateLength maximum="4" />
 				</ice:inputText>
 			</f:facet>
 		</ice:column>
 		<ice:column>
 			<f:facet name="header">Description</f:facet>
 			<ice:outputText value="#{row.description}" />
 			<f:facet name="footer">
 				<ice:inputText value="#{codeController.code.description}" 
 					size="40" maxlength="120" label="Description" required="true" binding="#{codeController.txtDescription}" >
 					<f:validateLength maximum="4" />
 				</ice:inputText>
 			</f:facet>
 		</ice:column>
 	</ice:dataTable>
 

Code:
 	public void selectionChanged(RowSelectorEvent event) {
 		selectedIndex = event.getRow();
 		code = codeList.get(selectedIndex).clone();
 		forceRefresh();
 		FacesTools.getFacesContext().renderResponse();
 	}
 

Thanx



mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


Just for testing, do the values in the footer update if they're outputTexts instead of inputTexts?
[Email]
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Tomorrow I'll let you know ... now it's 9 PM in Romania and I don't have access to our svn from home :). For the time being I adopted the master/details approach, with the details separately from the dataTable. I usually do it like this, but things like in-place editing or editing in the footer look fancier.

Cheers!
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Yup, outputText functions correctly in the footer. And I repeat, outside the dataTable, the inputText also functions correctly. It's only inside the footer that they don't get refreshed, even when forced to do so.

Code:
	protected void forceRefresh() {
 		if (txtCod != null) {
 			FacesTools.forceRefresh(txtCod);
 			FacesTools.forceRefresh(txtEticheta);
 			FacesTools.forceRefresh(selActiv);
 		}
 	}
 

Code:
	public static final void forceRefresh(UIInput control) {
 		control.setSubmittedValue(null);
 		control.setValue(null);
 		control.setLocalValueSet(false);
 	}
 


Cheers!
ellen

Joined: 31/Jul/2008 00:00:00
Messages: 5
Offline


I am also having the same problem with the same behavior - inputText in a dataTable is not getting refreshed, but outputText is. Is this currently being tracked as a bug? I couldn't find it when I did a search.
kant003

Joined: 16/Dec/2008 00:00:00
Messages: 5
Offline


am also having the same problem, please solve this bug.
tezzzzz

Joined: 12/Sep/2010 12:28:37
Messages: 3
Offline


Can you provide the code for FacesTools.forceRefresh()
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team