voyent
Input components not updating after submitting empty value  XML
Forum Index -> Components
Author Message
edykory


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


Hi there,
The usage scenario is a little bit complex, but please follow this through:
1. The controller:
Code:
 public class TestController {
 	private String value;
 	
 	public String getValue() {
 		System.out.println("Getting value: [" + value + "]");
 		return value;
 	}
 	public void setValue(String value) {
 		System.out.println("Setting value: [" + value + "]");
 		this.value = value;
 	}
 	public String submit() {
 		System.out.println("Submitting");
 		value = "testValue ";
 		return null;
 	}
 }
 

2. The view
Code:
 	<ice:form>
 		<h:inputText value="#{testController.value}" />
 		<hr />
 		<ice:commandButton value="Submit" action="#{testController.submit}" />
 	</ice:form>
 

3. The behavior:
I
a. submit empty value => the value gets set on the bean to "testValue" and shows on the page (updates happen on icefaces log console)
b. submit again empty value => value get set on the bean to testValue, but doesn't show on the page (no updates come back, according to icefaces log console)

II
a. submit any non empty value => value gets set on the bean to "testValue" and shows on the page
b. submit an empty value => values gets set on the bean to "testValue" but doesn't show on the page (no updates happen)

III
replace "testValue" with "testValue" + new Date() ==> it behaves correctly

Conclusion: the problems comes from the fact that in I and II the "testValue" is always the same coupled with the fact that submitted value is empty.

Observation:
1. testController is extendedRequestScoped
2. If i use a plain jsf project (putting testController in the session scope) everything works normally, which makes me think that the problem comes from computing the diff on the server side.

Cheers

Eduard Korenschi
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team