| Summary: | Callback method in generated javascript should be wrapped with Delegate | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Yun Feng Ma <mayunf> | ||||
| Component: | EDT | Assignee: | Project Inbox <edt.javascriptgen-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | greer, jvincens | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 202583 [details]
Patch
Hi Scott and Joe,
Please review the patch. Thanks a lot.
Yun Feng, I've reviewed the code (but not tested it) and it looks good; can you test and commit the change, or do you need me to do that? Hi Scott, Thanks a lot for the review. The change has been in the stream now. Thanks. (In reply to comment #2) > Yun Feng, > > I've reviewed the code (but not tested it) and it looks good; can you test and > commit the change, or do you need me to do that? Yun Feng, Thanks...I didn't realize it was already committed....I'm going to mark this bug resolved -- please re-open if necessary...thanks. Verified with build 20111020. close it. |
Build Identifier: The callback methods in below cases need to be wrapped with Delegate: 1) widget Event handler, such as onClick event handler in Button. 2) Service call returning to method. Here is a test case for above two cases: handler demo9 type RUIhandler {initialUI = [ ui ],onConstructionFunction = start, cssFile="css/MyRUI9.css", title="demo9"} TextField TextField{}; Button Button{ text = "Click", onClick ::= Button_onClick }; //here the Button_onClick should be wrapped with Delegate in generated javascript ui Box{ children = [ Button, TextField ] }; function start() end function Button_onClick(event Event in) EchoService9 EchoService9{@bindservice {}}; call EchoService9.echo() returning to echo1; //here the echo1 should be wrapped with Delegate in generated javascript end function echo1( retResult string in) TextField.text = retResult; end end If Button_onClick is not wrapped with Delegate in generated javascript, when the Button is clicked, the "this" in method Button_onClick is not demo9, then method "echo1" can not be accessed in Button_onClick. If echo1 is not wrapped with Delegate in generated javascript, when the Service call returns and the callback method is invoked, the "this" in method echo1 is not demo9, then TextField can not be accessed. Reproducible: Always