jsni, parameter from java to javascript

38 views
Skip to first unread message

Diego

unread,
Aug 4, 2011, 9:41:25 AM8/4/11
to Google Web Toolkit
hello,

jsni help in a simple, do not understand how do I pass a variable
value from javascript variable to java ......

The method is this:


public static native void setSharePropertyButton(String nameShare,
String linkShare, String pictureShare, String captionShare, String
descriptionShare, String messageShare)/*-{

$wnd.FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'http://www.mydomain.com',
caption: 'This is the content of the "caption" field.',
description: 'This is the content of the "description" field, below
the caption.',
message: 'This is text in the message box a user can add to or
replace.'
});
}-*/;



I can not understand how I can, for example, take the value of the
variable name and assign it nameShare. (name: ????)

Thanks.
Diego

John Ho

unread,
Aug 4, 2011, 10:49:58 AM8/4/11
to google-we...@googlegroups.com
Unless I'm misreading what you're trying to accomplish, it sounds as though you just need to assign what you are passing in your method arguments.

public static native void setSharePropertyButton(String nameShare, String linkShare, String pictureShare, String captionShare, String descriptionShare, String messageShare) /*-{ 

$wnd.FB.ui({
method: 'feed', 
name: nameShare, 
link: linkShare
caption: captionShare, 
description: descriptionShare
message: messageShare
});
}-*/;
Reply all
Reply to author
Forward
0 new messages