Hello guys,
I’m trying to display this code bellow with smartgwt and no luck so far.
<object width=“400px” height=“300px” type=“application/pdf” data=“http://127.0.0.1:8888/foobar/web/downloadReport” />
I tried something like this:
Element elem = DOM.createElement(“object”);
ObjectElement objectElement = ObjectElement.as(elem);
objectElement.setWidth(“400”);
objectElement.setHeight(“300”);
objectElement.setData(“http://127.0.0.1:8888/foobar/web/downloadReport”);
objectElement.setType(“‘application/pdf’”);
Canvas reportCanvas = new Canvas(elem);
reportCanvas.draw();
any help?
Almost work with this code:
Canvas reportCanvas = new Canvas();
reportCanvas.getElement().appendChild(objectElement);
mainContent.addMember(reportCanvas);
the only problem now is that my canvas are drawing in wrong position. Like x=0 and y=0.
any tips?
well,
works like this:
HTMLPane pane = new HTMLPane();
pane.setContents("<object width="600" height="500"
type="application/pdf" data="http://127.0.0.1:8888/foobar/downloadReport\“/>” );
mainContent.addMember(pane);
Canvas have the same method so you can do with a simple canvas too.
The only weird thing happening now is that my url got called twice.
anyone? please…