Assingning value to a local e:variable and then display it.

Hi

I have three test buttons. When I click AssignValue button, I would like to assign value '999' to a variable hasFormValueChange.

then when I click button NextTest, i would like to alert assign value.

But this doesn't seem to be working. It is not assigning value 999'

please could some one help.

many thank

<div id="productFormButtons" class="buttonController">
        <div>  
        <b:button>
                Add
                <e:handler event="click" type="application/xml">
                        <e:call method="submit" with="../../../../form"/>
                </e:handler>
        </b:button>
                       
                       
        <e:variable name="hasFormValueChange" select="'false'" />
                       
        <b:button>
                NextTest
                <e:handler event="click" type="application/xml">
                        <c:alert select="$hasFormValueChange" />
                </e:handler>
        </b:button>
                       
        <b:button>
                AssignValue
                <e:handler event="click" type="application/xml">
                        <c:setAttribute name="hasFormValueChange" select="'999'" />
                </e:handler>
        </b:button>
                                               
        </div>
</div>
       

use set

<e:set variable="hasFormValueChange" select="'999'" />

Assingning value to a local e:variable and then display it.

hi ishfady,

When using XEL inside the handler, it is not necessary to put "type=application/xml" in the handler. e:variable also has to be declared inside a handler.

<b:button>NextTest
    <e:handler event="click">
        <e:variable name="hasFormValueChange" select="'false'" />
        <c:alert select="$hasFormValueChange" />
     </e:handler>
</b:button>

Cheers,

Yudi