Monday, April 11, 2016

@JsFunction transmitted from java to javascript using JsInterop

Hello all,

This is my scenario:
I do have a javascript object representing the context menu (menu displayed
when you do a right click on an element); using @JsType(isNative=true) I do
have access to this object from java.
The context menu object contains a list of items and each item have:
- a string (representing the text displayed in context menu, like "copy",
"paste", etc)
- a function (representing the action that should take place when the item
is clicked, like "copy action", "paste action")

What I want is to add new items to the context menu from java side; I have
access to the items list and I can add items there.
The problem is that I don't know how to add the function in the item object.
Each item object would be a JavaScriptObject that contains 2 fields, a
string and a function.

Does anyone tried this, to set from java a function marked with @JsFunction
to a javascript object?
Thank you.



--
View this message in context: http://google-web-toolkit.2317884.n4.nabble.com/JsFunction-transmitted-from-java-to-javascript-using-JsInterop-tp15596.html
Sent from the Google Web Toolkit mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment