I was just yesterday going after the same thing, untill I did some
testing and found that you can use JSNI to set objects on the window
without having to worry about their name:
package com.testproject.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
public class Test implements EntryPoint {
/**
* This is the entry point method. Initialize you GWT module here.
*/
public void onModuleLoad() {
// Creates an object on the window called "objectName" and with
a
value of "objectValue"
// Equal to window.objectName = "objectValue";
setWindowObject("objectName", "objectValue");
// Creates a function on the window object with the name of
"functionName"
// Equal to window.functionName = function(){
// window.alert("Function called");
// };
setWindowFunction("functionName");
}
public static native String setWindowObject(String objName, Object
objValue) /*-{
$wnd[objName] = objValue;
}-*/;
public static native String setWindowFunction(String funcName) /*-{
$wnd[funcName] = function(){
$wnd.alert("Function called");
};
}-*/;
}
This is fairly easy and from the functions you set you can call java
functions and classes, look in JSNI to find more about this.
but I wasn't able to overcome setting objects maybe with a little more
looking and knowing more java would help to find a solution, something
like a Vector or an array.
Hope this helped.
On 20 יוני, 18:22, cabo087 <[email protected]> wrote:
> Hello all,
>
> I use javascript and PHP to build my websites.
> In some PHP pages i call some javascript methods and it works.
>
> Now i want to use GWT and PHP to develop my websites.
> How can i call GWT methods from a php file? (like calling javascript)
> Do i need to make native methods that can be called in php code?
>
> Please help me out.
>
> thank you
>
> Elvin
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.