You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stefan Lindner <li...@visionet.de> on 2010/03/29 20:06:17 UTC

How to render any Component

How can I implement a Loop or ListView that can display any wicket
component?

Let's have a HTML lik this

	<div wicket:id="loop"><div wicket:id="item"/></div>

How can I write a Loop like

	add(new Loop("loop", 10) {
		protected void populateItem(LoopItem item) {
			item.add( new
<AnyWicketComponentE.G.Image>("item") );
		}
	);

An Image will always throw an Exception like "...must be applied to a
tag of type 'img', not ...".

How can I write my HTML so that I can display an Image, a Label or
anything else, just on demand?

Of course, I can place a Panel there but this means I must construct a
panel with markup etc.

I playes around with <wicket:fragment> but this also did not work.

Or is this impossible?

The background: I want to create a list of Links where the visual part
of the link can be a Label, an Image or somthing else.


Stefan

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


Re: How to render any Component

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!

I got a hint from Michał, see also this:

http://www.wickettraining.com/ws-sites/minis-parent/minis/xref/org/wicketstuff/minis/apanel/RenderersList.html
http://www.wickettraining.com/ws-sites/minis-parent/minis/xref/org/wicketstuff/minis/apanel/

Mix that with mashupcontainer and bam, you can fly ;)

**
Martin

2010/3/30 Stefan Lindner <li...@visionet.de>:
> Hi Martin,
>
> this would be very helpful. Until then I will use a workaround and check the type of Component.
>
> Stefan.
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Gesendet: Montag, 29. März 2010 22:05
> An: users@wicket.apache.org
> Betreff: Re: How to render any Component
>
> Well, I hope one day (1.5?) it will be part of wicket ;) We are trying
> to invent some nifty behavior that allows a panel to digest markupless
> components.
>
> **
> Martin
>
> 2010/3/29 Stefan Lindner <li...@visionet.de>:
>> Hi Martin,
>>
>> ok, no easy way, no wicket-builtin tools. Thanks for the proposal.
>>
>> Stefan
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
>> Gesendet: Montag, 29. März 2010 20:13
>> An: users@wicket.apache.org
>> Betreff: Re: How to render any Component
>>
>> Hi!
>>
>> Here:
>> http://code.google.com/p/wicket-mashup/
>>
>> **
>> Martin
>>
>> 2010/3/29 Stefan Lindner <li...@visionet.de>:
>>> How can I implement a Loop or ListView that can display any wicket
>>> component?
>>>
>>> Let's have a HTML lik this
>>>
>>>        <div wicket:id="loop"><div wicket:id="item"/></div>
>>>
>>> How can I write a Loop like
>>>
>>>        add(new Loop("loop", 10) {
>>>                protected void populateItem(LoopItem item) {
>>>                        item.add( new
>>> <AnyWicketComponentE.G.Image>("item") );
>>>                }
>>>        );
>>>
>>> An Image will always throw an Exception like "...must be applied to a
>>> tag of type 'img', not ...".
>>>
>>> How can I write my HTML so that I can display an Image, a Label or
>>> anything else, just on demand?
>>>
>>> Of course, I can place a Panel there but this means I must construct a
>>> panel with markup etc.
>>>
>>> I playes around with <wicket:fragment> but this also did not work.
>>>
>>> Or is this impossible?
>>>
>>> The background: I want to create a list of Links where the visual part
>>> of the link can be a Label, an Image or somthing else.
>>>
>>>
>>> Stefan
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


AW: How to render any Component

Posted by Stefan Lindner <li...@visionet.de>.
Hi Martin,

this would be very helpful. Until then I will use a workaround and check the type of Component.

Stefan.

-----Ursprüngliche Nachricht-----
Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Gesendet: Montag, 29. März 2010 22:05
An: users@wicket.apache.org
Betreff: Re: How to render any Component

Well, I hope one day (1.5?) it will be part of wicket ;) We are trying
to invent some nifty behavior that allows a panel to digest markupless
components.

**
Martin

2010/3/29 Stefan Lindner <li...@visionet.de>:
> Hi Martin,
>
> ok, no easy way, no wicket-builtin tools. Thanks for the proposal.
>
> Stefan
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Gesendet: Montag, 29. März 2010 20:13
> An: users@wicket.apache.org
> Betreff: Re: How to render any Component
>
> Hi!
>
> Here:
> http://code.google.com/p/wicket-mashup/
>
> **
> Martin
>
> 2010/3/29 Stefan Lindner <li...@visionet.de>:
>> How can I implement a Loop or ListView that can display any wicket
>> component?
>>
>> Let's have a HTML lik this
>>
>>        <div wicket:id="loop"><div wicket:id="item"/></div>
>>
>> How can I write a Loop like
>>
>>        add(new Loop("loop", 10) {
>>                protected void populateItem(LoopItem item) {
>>                        item.add( new
>> <AnyWicketComponentE.G.Image>("item") );
>>                }
>>        );
>>
>> An Image will always throw an Exception like "...must be applied to a
>> tag of type 'img', not ...".
>>
>> How can I write my HTML so that I can display an Image, a Label or
>> anything else, just on demand?
>>
>> Of course, I can place a Panel there but this means I must construct a
>> panel with markup etc.
>>
>> I playes around with <wicket:fragment> but this also did not work.
>>
>> Or is this impossible?
>>
>> The background: I want to create a list of Links where the visual part
>> of the link can be a Label, an Image or somthing else.
>>
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


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


Re: How to render any Component

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Well, I hope one day (1.5?) it will be part of wicket ;) We are trying
to invent some nifty behavior that allows a panel to digest markupless
components.

**
Martin

2010/3/29 Stefan Lindner <li...@visionet.de>:
> Hi Martin,
>
> ok, no easy way, no wicket-builtin tools. Thanks for the proposal.
>
> Stefan
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com]
> Gesendet: Montag, 29. März 2010 20:13
> An: users@wicket.apache.org
> Betreff: Re: How to render any Component
>
> Hi!
>
> Here:
> http://code.google.com/p/wicket-mashup/
>
> **
> Martin
>
> 2010/3/29 Stefan Lindner <li...@visionet.de>:
>> How can I implement a Loop or ListView that can display any wicket
>> component?
>>
>> Let's have a HTML lik this
>>
>>        <div wicket:id="loop"><div wicket:id="item"/></div>
>>
>> How can I write a Loop like
>>
>>        add(new Loop("loop", 10) {
>>                protected void populateItem(LoopItem item) {
>>                        item.add( new
>> <AnyWicketComponentE.G.Image>("item") );
>>                }
>>        );
>>
>> An Image will always throw an Exception like "...must be applied to a
>> tag of type 'img', not ...".
>>
>> How can I write my HTML so that I can display an Image, a Label or
>> anything else, just on demand?
>>
>> Of course, I can place a Panel there but this means I must construct a
>> panel with markup etc.
>>
>> I playes around with <wicket:fragment> but this also did not work.
>>
>> Or is this impossible?
>>
>> The background: I want to create a list of Links where the visual part
>> of the link can be a Label, an Image or somthing else.
>>
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


AW: How to render any Component

Posted by Stefan Lindner <li...@visionet.de>.
Hi Martin,

ok, no easy way, no wicket-builtin tools. Thanks for the proposal.

Stefan

-----Ursprüngliche Nachricht-----
Von: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Gesendet: Montag, 29. März 2010 20:13
An: users@wicket.apache.org
Betreff: Re: How to render any Component

Hi!

Here:
http://code.google.com/p/wicket-mashup/

**
Martin

2010/3/29 Stefan Lindner <li...@visionet.de>:
> How can I implement a Loop or ListView that can display any wicket
> component?
>
> Let's have a HTML lik this
>
>        <div wicket:id="loop"><div wicket:id="item"/></div>
>
> How can I write a Loop like
>
>        add(new Loop("loop", 10) {
>                protected void populateItem(LoopItem item) {
>                        item.add( new
> <AnyWicketComponentE.G.Image>("item") );
>                }
>        );
>
> An Image will always throw an Exception like "...must be applied to a
> tag of type 'img', not ...".
>
> How can I write my HTML so that I can display an Image, a Label or
> anything else, just on demand?
>
> Of course, I can place a Panel there but this means I must construct a
> panel with markup etc.
>
> I playes around with <wicket:fragment> but this also did not work.
>
> Or is this impossible?
>
> The background: I want to create a list of Links where the visual part
> of the link can be a Label, an Image or somthing else.
>
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


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


Re: How to render any Component

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!

Here:
http://code.google.com/p/wicket-mashup/

**
Martin

2010/3/29 Stefan Lindner <li...@visionet.de>:
> How can I implement a Loop or ListView that can display any wicket
> component?
>
> Let's have a HTML lik this
>
>        <div wicket:id="loop"><div wicket:id="item"/></div>
>
> How can I write a Loop like
>
>        add(new Loop("loop", 10) {
>                protected void populateItem(LoopItem item) {
>                        item.add( new
> <AnyWicketComponentE.G.Image>("item") );
>                }
>        );
>
> An Image will always throw an Exception like "...must be applied to a
> tag of type 'img', not ...".
>
> How can I write my HTML so that I can display an Image, a Label or
> anything else, just on demand?
>
> Of course, I can place a Panel there but this means I must construct a
> panel with markup etc.
>
> I playes around with <wicket:fragment> but this also did not work.
>
> Or is this impossible?
>
> The background: I want to create a list of Links where the visual part
> of the link can be a Label, an Image or somthing else.
>
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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