Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » browser.setText(browser.setText)
browser.setText [message #723086] Wed, 07 September 2011 15:25 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

tried to create a browser inside my rap application by using an example like below and that works fine

final Browser browser = new Browser(this, SWT.NONE);
b.addProgressListener(new ProgressListener() {
@Override
public void completed(ProgressEvent event) {
browser .execute("alert(\"Start My Browser\");");
}
@Override
public void changed(ProgressEvent event) {
}
});

It shows an empty page and gives an alert.

Now I want to add some contents to the page

final String test = "<html> <body><h1>My First Heading</h1><p>My first paragraph.</p> </body> </html>";
browser.setText(test);

But whatever i try and change, I never see some text. So the question is how to programmatically add some contents to the browser?

Re: browser.setText [message #723106 is a reply to message #723086] Wed, 07 September 2011 15:40 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi bertin,
html snippet you posted works for me with Controls Demo. Could you post
your complete code. Are you using layout manager? Does your browser have
a non zero bounds?
Best,
Ivan

On 9/7/2011 6:25 PM, bertin wrote:
> Hi,
>
> tried to create a browser inside my rap application by using an
> example like below and that works fine
>
> final Browser browser = new Browser(this, SWT.NONE);
> b.addProgressListener(new ProgressListener() {
> @Override
> public void completed(ProgressEvent event) {
> browser .execute("alert(\"Start My Browser\");");
> }
> @Override
> public void changed(ProgressEvent event) {
> }
> });
>
> It shows an empty page and gives an alert.
>
> Now I want to add some contents to the page
> final String test = "<html> <body><h1>My First Heading</h1><p>My first
> paragraph.</p> </body> </html>";
> browser.setText(test);
>
> But whatever i try and change, I never see some text. So the question
> is how to programmatically add some contents to the browser?
>
>
Re: browser.setText [message #723125 is a reply to message #723106] Wed, 07 September 2011 17:37 Go to previous messageGo to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

Like Ivan said, your browser widget probably has either zero width/height or the default 50x50. Make sure you are setting a layout (GridLayout, FillLayout, etc) on the parent composite.
Re: browser.setText [message #723147 is a reply to message #723125] Wed, 07 September 2011 20:13 Go to previous message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Thanks,

ik works after setting a layoutManager
Previous Topic:Differences in RAP 1.4 und 1.5 M1
Next Topic:Wrapping Canvas in ScrolledComposite
Goto Forum:
  


Current Time: Fri Apr 26 08:44:14 GMT 2024

Powered by FUDForum. Page generated in 0.03002 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top