You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fabiosakiyam <fa...@gmail.com> on 2011/11/25 14:20:08 UTC
Dynamic component?
Hello,
Sorry if this is already solved, but i couldn't find it, 'cause i don't
really know what is the name of this, that's why the subject is weird.
Ok so, im creating a new component (extends panel), and his .java is
something like this:
class Component {
getType().buildContainer();
}
It builds a container, depending on it's type. At the moment i have to 2
types only.
And the component .html is something like this:
<wicket:panel>
<div wicket:id="firstContainerName"/>
<div wicket:id="secondeContainerName"/>
</wicket:panel>
the first and second container have a .java and a .html as well, declaring
the fields, etc.
I want to know if it's possible to do what i'm trying at the component.html
, i mean, declaring all types of containers i have (but only 1 will be
built, at the getType().buildContainer()), and by declaring the wicket:id of
them, it will get the wicket:id from the fields declared at the container
too.
It's kinda confuse to explain, i hope someone understand.
Sorry for bad english.
Thanks.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-component-tp4107323p4107323.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: Dynamic component?
Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Fri, Nov 25, 2011 at 8:20 AM, Fabiosakiyam <fa...@gmail.com>wrote:
> Hello,
>
> Sorry if this is already solved, but i couldn't find it, 'cause i don't
> really know what is the name of this, that's why the subject is weird.
>
> Ok so, im creating a new component (extends panel), and his .java is
> something like this:
>
> class Component {
> getType().buildContainer();
> }
>
> It builds a container, depending on it's type. At the moment i have to 2
> types only.
> And the component .html is something like this:
>
> <wicket:panel>
> <div wicket:id="firstContainerName"/>
> <div wicket:id="secondeContainerName"/>
> </wicket:panel>
>
> the first and second container have a .java and a .html as well, declaring
> the fields, etc.
> I want to know if it's possible to do what i'm trying at the component.html
> , i mean, declaring all types of containers i have (but only 1 will be
> built, at the getType().buildContainer()), and by declaring the wicket:id
> of
> them, it will get the wicket:id from the fields declared at the container
> too.
>
> It's kinda confuse to explain, i hope someone understand.
> Sorry for bad english.
>
> Thanks.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dynamic-component-tp4107323p4107323.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
>
>
This is an XY problem [1]. You're asking "can I do this weird thing with a
panel". Hard to say. Why don't you explain to us what you're really
trying to accomplish. My bet is that there is a much better way of doing
it than what you're asking about above. That's the nature of XY problems.
[1] - http://www.perlmonks.org/?node_id=542341
--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket? Use Brix! http://brixcms.org*
Re: Dynamic component?
Posted by Fabiosakiyam <fa...@gmail.com>.
Thanks, using only 1 id for my panels worked. I tried this before, but i
wasnt using panels (containers instead).
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-component-tp4107323p4115163.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: Dynamic component?
Posted by James Carman <ja...@carmanconsulting.com>.
Just use one div and always use the same id (container for example).
On Nov 25, 2011 5:26 PM, "Fabiosakiyam" <fa...@gmail.com> wrote:
> Hello,
>
> Sorry if this is already solved, but i couldn't find it, 'cause i don't
> really know what is the name of this, that's why the subject is weird.
>
> Ok so, im creating a new component (extends panel), and his .java is
> something like this:
>
> class Component {
> getType().buildContainer();
> }
>
> It builds a container, depending on it's type. At the moment i have to 2
> types only.
> And the component .html is something like this:
>
> <wicket:panel>
> <div wicket:id="firstContainerName"/>
> <div wicket:id="secondeContainerName"/>
> </wicket:panel>
>
> the first and second container have a .java and a .html as well, declaring
> the fields, etc.
> I want to know if it's possible to do what i'm trying at the component.html
> , i mean, declaring all types of containers i have (but only 1 will be
> built, at the getType().buildContainer()), and by declaring the wicket:id
> of
> them, it will get the wicket:id from the fields declared at the container
> too.
>
> It's kinda confuse to explain, i hope someone understand.
> Sorry for bad english.
>
> Thanks.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Dynamic-component-tp4107323p4107323.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
>
>