[Tobago] Problem with immediate=true

2007-05-03 Thread Helmut Swaczinna

Hi,

I have a page with a reset button with immediate=true to reset the input 
fields of the page to standard values without submitting and validating 
entered values. But this doesn't work. The fields remains unschanchend.


Here's a simple example:

test.jsp

tc:page id=testPage3 width=300px height=200px
   tc:button label=Reset
 immediate=true
 action=#{controller.reset}/
 tc:in value=#{controller.value}/
/tc:page

Controller.java

private Integer value;

public String reset() {
   LOG.debug(reset);
   value = null;
   return null;
 }

 public Integer getValue() {
   LOG.debug(getValue:  + value);
   return value;
 }

 public void setValue(Integer value) {
   this.value = value;
 }

When you click the reset button the reset action is called but not the 
getValue method. I think this is a bug.

I'm using Tobago 1.0.11.

Regards
Helmut







Re: [Tobago] Problem with immediate=true

2007-05-03 Thread Udo Schnurpfeil

Hello Helmut,

immediate means, that the values will not validated and will not update 
the model.

But the submitted values are still in the component.

To fix your problem your reset() should return the correct outcome != 
null. In this case you will get a brand new UI-component-tree.


Hope that helps

Udo

Helmut Swaczinna schrieb:

Hi,

I have a page with a reset button with immediate=true to reset the 
input fields of the page to standard values without submitting and 
validating entered values. But this doesn't work. The fields remains 
unschanchend.


Here's a simple example:

test.jsp

tc:page id=testPage3 width=300px height=200px
   tc:button label=Reset
 immediate=true
 action=#{controller.reset}/
 tc:in value=#{controller.value}/
/tc:page

Controller.java

private Integer value;

public String reset() {
   LOG.debug(reset);
   value = null;
   return null;
 }

 public Integer getValue() {
   LOG.debug(getValue:  + value);
   return value;
 }

 public void setValue(Integer value) {
   this.value = value;
 }

When you click the reset button the reset action is called but not the 
getValue method. I think this is a bug.

I'm using Tobago 1.0.11.

Regards
Helmut