Hi

 

We have an existing code in which the _javascript_ code (which paints the screen using HTML) invokes another _javascript_ function by passing a parameter “this”. This parameter is a reference tothe current object, which could be a button. The destination _javascript_ function then extracts the id attribute of the parameter.

 

Existing Code:

<input type="button" class="button" id="next" multdrcrdet_ONCLICK17(this,this);">

 

Pseudo code of _javascript_:

function multdrcrdet_ONCLICK17(obj,p1)

{

            var tmpBtnId = Obj.id;

            if (tmpBtnId == 'Save' || tmpBtnId == 'Post') {

                        // do something

            }

            else {

                        // do something else

            }

}

 

We are changing this functionality to use Flex. So now the screen is being painted using Flex and we are trying to invoke the same destination _javascript_ function. We need to know a way to pass the object reference i.e. button reference so that the _javascript_ function doesnot need to change. The workaround that we are doing currently is that we are passing the id attribute of the button from flex and we have modified the _javascript_ function to use the parameter passed to it rather than to extract the id attribute out of the parameter.

 

As we do not know how to pass a reference we are invoking the multdrcrdet_ONCLICK17(\’next\’) and changedthe _javascript_ function to use the obj directly rather than doing obj.id  we do not want to change the _javascript_ function

 

 

Is there a way in which we can pass a reference of the button from flex to _javascript_ function so that it does not need to be changed at all and it can extract the id attribute and continue in its functionality?

 

Thanks

 

Srikanth

 

Reply via email to