This content has been marked as final. Show 4 replies
When you use the <mx:Component> tag you create a new scope. Its as if all of the content of the <mx:Component> were in another file. If you used a separate file for your renderer you wouldn't expect click() function to be recognized, right?
You can modify your renderer like this to make it work:
<mx:LinkButton label="edit" click = "outerDocument.click1();">
Another option is to take advantage of the bubbling feature of the click event. Instead of putting the click handler on the LinkButton, put it on the DataGrid itself. Any click on the DataGrid will then trigger the event handler.
The drawback to that is that EVERY click will call the event handler - either the LinkButton's click on a click on the header. Your event handler just has to examine the event data to determine what control originated the event.
In this case, using outerDocument.click() is far easier, but you might need the bubbling property of the event at some point in the future.
<mx:LinkButton label="edit" click = "outerDocument.click1();"> is not working again.
i am getting an error stating "attempted access of inaccessible method through a reference with static type"
can u plss help me out soon.
Make sure click1() is declared public.
Thank you tracy n peter got the correct answer..
Forgot to see that the function is public or not..
outerDocument.click() worked out..
Thanks once again.