Open GoogleCodeExporter opened 8 years ago
Hi, Thomas,
this is a good place to discuss issues.
And you can post you code to vital.fadeev@gmail.com
I do not use Google Web Toolkit, but will try to help you.
What is the problem?
Original comment by vital.fadeev
on 2 Dec 2010 at 9:19
Hi Vital,
thanx for taking the time...
Since this is a project under code.google.com I thought you'd use GWT as well ;)
Anyway, my problem is to integrate your .js Files into my "Java" Code. This is
what I try (it's actually using SmartGWT):
private IButton upload() {
IButton button = new IButton("Upload");
button.setID("uploader");
upclick();
return button;
}
private native void upclick() /*-{
var uploader = document.getElementById('uploader');
upclick({
element: uploader,
action: '/upload',
onstart:
function(filename) { alert('Start upload: ' + filename); },
oncomplete:
function(response_data) { alert(response_data); }
});
}-*/;
But when it comes to execute the code I get a JavaScriptException saying that
upclick() is not defined. My .html file includes this in its header section:
<script type="text/javascript" src="editor/upclick-min.js"></script>
Any ideas what I need to do to get all pieces together in "Java" code?
Original comment by tkloe...@googlemail.com
on 2 Dec 2010 at 9:35
I think need add next line into <head> of you host HTML page (before GWT):
...
<script type="text/javascript" src="/path_to/upclick.js"></script>
...
and code wiil be like this:
...
public class Hello implements EntryPoint {
public void onModuleLoad() {
Button button = new Button("Click me");
button.setID("uploader");
RootPanel.get().add(button);
var uploader = document.getElementById('uploader');
upclick({
element: uploader,
action: '/upload',
onstart:
function(filename) { alert('Start upload: ' + filename); },
oncomplete:
function(response_data) { alert(response_data); }
});
}
}
...
Original comment by vital.fadeev
on 2 Dec 2010 at 10:27
...
button.setID("uploader");
upclick();
return button;
...
I think need call upclick outside return
And can I see GWT generated javascript?
Original comment by vital.fadeev
on 2 Dec 2010 at 10:40
Vital,
thanx for your help!
I'm trying to put this into a test app, so it's easier to investigate, but it
will take a bit. I'll post everything when I have it...
Original comment by tkloe...@googlemail.com
on 2 Dec 2010 at 11:42
Vital,
I sent you a war file and my sources to your gmail address...
Thanks,
Thomas
Original comment by tkloe...@googlemail.com
on 2 Dec 2010 at 3:03
Check email.
Solution (not require button ID):
...
private IButton upload(Cell cell) {
if (!cell.hasValueMap()) return null;
IButton button = new IButton("Upload");
upclickIt(button);
return button;
}
private native void upclickIt(button) /*-{
upclick({
element: button,
action: '/upload',
onstart:
function(filename) { alert('Start upload: ' + filename); },
oncomplete:
function(response_data) { alert(response_data); }
});
}-*/;
...
Original comment by vital.fadeev
on 2 Dec 2010 at 3:40
what is the difference between upclick-min.js and upclick.js?
Do I need both?
Original comment by tkloe...@googlemail.com
on 2 Dec 2010 at 3:50
[deleted comment]
upclick-min.js is a packed version of upclick.js
Without comments and spaces.
Include in project upclick-min.js only.
Original comment by vital.fadeev
on 3 Dec 2010 at 3:36
Vitali,
thanks for your help, I will look into the "GWT Java syntax" issue...
Original comment by tkloe...@googlemail.com
on 3 Dec 2010 at 7:56
[deleted comment]
can u explain me how to post the argument to server from action url in php
Original comment by pramodz...@gmail.com
on 19 Sep 2011 at 7:37
Hi,
I am getting error on IIS ImportXL:78Uncaught ReferenceError: upclick is not
defined
but not if i directly run it from source code or on local host
Original comment by I.shaikh...@gmail.com
on 2 Dec 2011 at 7:08
Original issue reported on code.google.com by
tkloe...@googlemail.com
on 1 Dec 2010 at 4:29