You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dpmihai <dp...@yahoo.com> on 2013/03/13 14:08:30 UTC

Wicket 6 : Displaying content in an iframe

Hi.

I have a wicket 1.4 application where I just render a html inside an iframe.
I used the wiki from here:

https://cwiki.apache.org/WICKET/displaying-content-eg-pdf-excel-word-in-an-iframe.html

The idea was to create a DynamicWebResource. This class was extended from
WebResource which was extended from Resource which implemented
IResourceListener. So, as you see from wiki, the DocumentInlineFrame
onResourceRequested method just called
resourceListener.onResourceRequested();

I want to port this code to wicket 6.6.0 . So I created a ByteArrayResource
instead of DynamicWebResource with 

protected byte[] getData(final Attributes attributes)  to return my html
data.

But ByteArrayResource does not implement IResourceListener anymore, so I
have no clue how to modify DocumentInlineFrame component. I tried to make my
resource implementing IResourceListener and inside

public void onResourceRequested()  method I compute my data that must be
returned from 

protected byte[] getData(final Attributes attributes)  method.

But nothing happens.  getData() method is not called from
DocumentInlineFrame . Does anybody know how to do it?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-Displaying-content-in-an-iframe-tp4657207.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 6 : Displaying content in an iframe

Posted by dpmihai <dp...@yahoo.com>.
Thank you Ernesto.

I was doing respond(attributes); but inside resource onResourceRequested
instead  to do inside the frame :)
My mistake.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-6-Displaying-content-in-an-iframe-tp4657207p4657214.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 6 : Displaying content in an iframe

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

I have just migrated the example to 6.x. See the details in here

https://github.com/reiern70/antilia-bits/tree/master/content-iframe


On Wed, Mar 13, 2013 at 2:08 PM, dpmihai <dp...@yahoo.com> wrote:

> Hi.
>
> I have a wicket 1.4 application where I just render a html inside an
> iframe.
> I used the wiki from here:
>
>
> https://cwiki.apache.org/WICKET/displaying-content-eg-pdf-excel-word-in-an-iframe.html
>
> The idea was to create a DynamicWebResource. This class was extended from
> WebResource which was extended from Resource which implemented
> IResourceListener. So, as you see from wiki, the DocumentInlineFrame
> onResourceRequested method just called
> resourceListener.onResourceRequested();
>
> I want to port this code to wicket 6.6.0 . So I created a ByteArrayResource
> instead of DynamicWebResource with
>
> protected byte[] getData(final Attributes attributes)  to return my html
> data.
>
> But ByteArrayResource does not implement IResourceListener anymore, so I
> have no clue how to modify DocumentInlineFrame component. I tried to make
> my
> resource implementing IResourceListener and inside
>
> public void onResourceRequested()  method I compute my data that must be
> returned from
>
> protected byte[] getData(final Attributes attributes)  method.
>
> But nothing happens.  getData() method is not called from
> DocumentInlineFrame . Does anybody know how to do it?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-Displaying-content-in-an-iframe-tp4657207.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Re: Wicket 6 : Displaying content in an iframe

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

#mountResource("some/nice/path", new MyResourceReference() {
 @Override IResource getResource(Attributes attrs) {return new
MyResource(attrs)}
})

Use #urlFor(new MyResourceReference()) to create the value of iframe's src
attribute.
Simpler ?

You can also use InlineFrame that uses normal Wicket Page. But I guess this
doesn't work for you for some reason since you didn't use it in 1.4.



On Wed, Mar 13, 2013 at 2:08 PM, dpmihai <dp...@yahoo.com> wrote:

> Hi.
>
> I have a wicket 1.4 application where I just render a html inside an
> iframe.
> I used the wiki from here:
>
>
> https://cwiki.apache.org/WICKET/displaying-content-eg-pdf-excel-word-in-an-iframe.html
>
> The idea was to create a DynamicWebResource. This class was extended from
> WebResource which was extended from Resource which implemented
> IResourceListener. So, as you see from wiki, the DocumentInlineFrame
> onResourceRequested method just called
> resourceListener.onResourceRequested();
>
> I want to port this code to wicket 6.6.0 . So I created a ByteArrayResource
> instead of DynamicWebResource with
>
> protected byte[] getData(final Attributes attributes)  to return my html
> data.
>
> But ByteArrayResource does not implement IResourceListener anymore, so I
> have no clue how to modify DocumentInlineFrame component. I tried to make
> my
> resource implementing IResourceListener and inside
>
> public void onResourceRequested()  method I compute my data that must be
> returned from
>
> protected byte[] getData(final Attributes attributes)  method.
>
> But nothing happens.  getData() method is not called from
> DocumentInlineFrame . Does anybody know how to do it?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-6-Displaying-content-in-an-iframe-tp4657207.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>