Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    why setValue is being called twice?

    I need to override setValue method for a formitem. I see that is is being called twice once with null and once with the value from the server. Looks like first call is part of drawing the form and resetting (clearing) the forms. Will it always be called twice? Is there way to distinguish between the two calls?

    One more question:
    with in the overridden setValue, I am calling super.setValue but it agains call this function but again with that logic, it should be recursive but that is also not the case. I am confused a bit here how setValue works.
    Code:
    setValue : function(value) {
                    if(value && value.periodValue)
                    {
                       value = value.periodValue.preset.value;
                    }
                   this.Super("setValue", value);
             }
    I will appreciate your help.
    Last edited by asingla; 19 Apr 2012, 06:14.

    #2
    Hi Isomorphic,

    Please advice on this. I am not sure if what I am doing is the right way or not. Here I am just overriding the setValue method on a formitem (**not** defining any new class extending formitem). Is calling this.Super("setValue", value) is valid from this method?

    Please reply.
    Thanks

    Comment

    Working...
    X