|
|
Re: embedding HTML and convert normal link as SWT Link [message #109228 is a reply to message #108900] |
Wed, 15 October 2008 07:45 |
Ittay 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 |
Stefan 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
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03082 seconds