03 December 2010

TROUBLESHOOTING: Cannot set field value in its own ValueChangeListener

You have a field which has  a ValueChangeListener, and we want based on a condition to change set its own value to another one.

Let’s say that attr1 has value 5 and user change it to 10.
VCL of attr1 is called and inside it, there is a condition and the value is set back to 5, that is VO.setAttr1(5)
If we put a logger in VO we ll see that the setter method of attr1 is called in the following order.

  • set(5)
  • set(10)

This means that the 1st one is called from the VCL and the second one is called because of the user interaction.
The result is that the modification in the VCL will not take place. 

No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...