Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » embedding HTML and convert normal link as SWT Link
embedding HTML and convert normal link as SWT Link [message #108874] Mon, 13 October 2008 06:32 Go to next message
Ittay  is currently offline Ittay Friend
Messages: 15
Registered: July 2009
Junior Member
Hi,

I have two questions:
1. What is the best way to embed an HTML snippet?

2. How can I convert the links in the snippet to SWT (RWT) Link widgets
(and still embed the snippet)

Thank you,
Ittay
Re: embedding HTML and convert normal link as SWT Link [message #108900 is a reply to message #108874] Mon, 13 October 2008 07:12 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi,

the best way to embed HTML is using the SWT Browser widget. However, as
the content is rendered into an IFrame, you cannot directly access the
surounding application or use widgets inside.

If you want to react to clicks on the links inside your HTML, you can
use ServiceHandlers and UICallbacks (see other threads in newsgroup for
details).

Regards,
Stefan.


Ittay schrieb:
> Hi,
>
> I have two questions:
> 1. What is the best way to embed an HTML snippet?
>
> 2. How can I convert the links in the snippet to SWT (RWT) Link widgets
> (and still embed the snippet)
>
> Thank you,
> Ittay
>
Re: embedding HTML and convert normal link as SWT Link [message #109228 is a reply to message #108900] Wed, 15 October 2008 07:45 Go to previous messageGo to next message
Ittay  is currently offline Ittay Friend
Messages: 15
Registered: July 2009
Junior Member
Stefan Roeck wrote:

> Hi,

> the best way to embed HTML is using the SWT Browser widget. However, as
> the content is rendered into an IFrame, you cannot directly access the
> surounding application or use widgets inside.

What about if I create a custom widget which renders inside a <div>?

> If you want to react to clicks on the links inside your HTML, you can
> use ServiceHandlers and UICallbacks (see other threads in newsgroup for
> details).

That is the server side of things. What about rendering those links so
they trigger the right javascript? In particluar, I'd like to render them
as if they are mapped to actions, so that when clicked, they will trigger
the server side Action that will do the work.

In order to achieve this, I need a way of creating a Link widget and then
ask that Link widget (actually its LCA) to return me the text of its
rendering so I can put it instead of the link in the html. The widget will
also render the listeners. How can I do that? As far as I could see, the
JSWriter always tries to write to the HTML response

Thanks,
Ittay

> Regards,
> Stefan.


> Ittay schrieb:
>> Hi,
>>
>> I have two questions:
>> 1. What is the best way to embed an HTML snippet?
>>
>> 2. How can I convert the links in the snippet to SWT (RWT) Link widgets
>> (and still embed the snippet)
>>
>> Thank you,
>> Ittay
>>
Re: embedding HTML and convert normal link as SWT Link [message #109277 is a reply to message #109228] Thu, 16 October 2008 07:22 Go to previous message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi,

of course you can try to write your own custom widget. However, this is
the more complex task comparing to my suggestion above.

If you want to render abitrary HTML the best way to do this is using an
IFrame (as the Browser-Widget does). However, then you have the problem
that communication from within the IFrame to the rest of the app via
JavaScript is complicated.

What is your Use Case? Maybe there's an easier solution for this...

Regards,
Stefan.


Ittay schrieb:
> Stefan Roeck wrote:
>
>> Hi,
>
>> the best way to embed HTML is using the SWT Browser widget. However,
>> as the content is rendered into an IFrame, you cannot directly access
>> the surounding application or use widgets inside.
>
> What about if I create a custom widget which renders inside a <div>?
>
>> If you want to react to clicks on the links inside your HTML, you can
>> use ServiceHandlers and UICallbacks (see other threads in newsgroup
>> for details).
>
> That is the server side of things. What about rendering those links so
> they trigger the right javascript? In particluar, I'd like to render
> them as if they are mapped to actions, so that when clicked, they will
> trigger the server side Action that will do the work.
> In order to achieve this, I need a way of creating a Link widget and
> then ask that Link widget (actually its LCA) to return me the text of
> its rendering so I can put it instead of the link in the html. The
> widget will also render the listeners. How can I do that? As far as I
> could see, the JSWriter always tries to write to the HTML response
>
> Thanks,
> Ittay
>
>> Regards,
>> Stefan.
>
>
>> Ittay schrieb:
>>> Hi,
>>>
>>> I have two questions:
>>> 1. What is the best way to embed an HTML snippet?
>>>
>>> 2. How can I convert the links in the snippet to SWT (RWT) Link
>>> widgets (and still embed the snippet)
>>>
>>> Thank you,
>>> Ittay
>>>
>
>
Previous Topic:Missing required Bundle, wrong version number?
Next Topic:Graphical Problem with DateTime widget
Goto Forum:
  


Current Time: Thu Sep 26 09:27:14 GMT 2024

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

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

Back to the top