Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
10. Jul 2008, 00:30 CET | Link

I am trying to develop and page where a value is typed into field A, and on the blur event a service is called that updates field B via partial page update. I can get the blur event to trigger the correct method, and when I update a bean value the change is reflected in an outputText component, but if I use an inputText component the value is never updated. Here is my component that triggers the partial page update:

			<s:decorate id="zipDecoration" template="layout/editm.xhtml">
										<ui:define name="label"> ajax zip2</ui:define>
										<h:inputText size="9" maxlength="9" id="zip"
											value="#{rptphdmgbinderHome.instance.vehicleVin}"
											valueChangeListener="#{rptphdmgbinderHome.verifyVIN}">
											<a:support id="vinCheck" bypassUpdates="true" event="onblur"
												reRender="binderRemarksDecoration"
												ajaxSingle="true" />
										</h:inputText>
									</s:decorate>

Here is the method on my bean that gets called on the onblur event:

	public void verifyVIN(ValueChangeEvent e)
	{
		EditableValueHolder binderRemarks =(EditableValueHolder) e.getComponent().findComponent(":rptphdmgbinder:binderRemarksDecoration:binderRemarks");
		binderRemarks.setValue("zzz");
		getInstance().setBinderRemarks("zzz");
	}

Now, the method above is called, but the binderRemarks field on my form is not updated to 'zzz'. Similar experiements showed that if I used an outputText component instead of an inputText component the outputText component would be updated properly.

Here is the inputText I am trying to have updated:


									<s:decorate id="binderRemarksDecoration"
										template="layout/edit.xhtml">
										<ui:define name="label">Binder Remarks</ui:define>
										<h:inputText id="binderRemarks" 
											value="#{rptphdmgbinderHome.instance.binderRemarks}" />
									</s:decorate>

Can someone please give me an explanation as to why an inputText field will not get updated on a partial page update but an outputText component will?

1 Reply:
10. Jul 2008, 18:59 CET | Link

I will answer my own question. By trial and error I was able to make the inputText update by including the 'setSubmittedValue' in my method:

binderRemarks.setSubmittedValue("zzz");

I do not know if this is the only setter that needs called or if you need to call the setValue() as well. In any case, that did the trick.