On Wed, 05 Jan 2005 10:08:58 -0500, Gili <[EMAIL PROTECTED]> wrote:
> On Wed, 5 Jan 2005 10:19:27 +0100, Juergen Donnerstag wrote:
> 
> >You've two possibilities to pass parameters
> >a) <tag id="wicket-xxx" key="value">  which does not meet HTML DTD
> >b) <tag id="wicket-xxx">
> >         <wicket:param key="value"/>
> >         <wicket:param key2=value2/>
> >    </tag>
> >
> >   <tag id="wicket-xxx"/> <!-- you the open-close tag -->
> >         <wicket:param key="value"/>
> >
> >   should work as well.
> 
>        I thought that for presentation components you're supposed to
> say:
> 
> <wicket:component name="myID" class="myClass" key="value" .../>
> 

Yes with <wicket:component> you can do it that way as well, because it
is valid html. <wicket:param> was needed to provide the same feature
for <tag ..>  also.


> >All parameters will go into the attributes map accessible by the
> >component. No setter/getter is called (yet).
> 
>        How do you get at the attribute map? I don't see a method...
> 

Good point. They are obviously not populated from CompoentTag to
Component yet. Hmm, while thinking about it ... ComponentTag is
exposed to handleComponentTag() which is executed at the beginnging of
the render process and it is non-final protected and you may subclass
it for your component. Because the params are available only after
rendering that tag, it probably makes sense the way it currently
works. An improvement could still be to call setters during render.
But I'd like to leave that change for the near future. Most of us
won't have as much time as we had over christimas and I think there
are important things, like the documentation. In order not to loose
that idea though, may I suggest you open up a feature request for it.
Thanks.

> >>      Secondly, I assume that the model object is my component object
> >>i.e. RoundCornerPanel) unless I explicitly call setModel() and apply
> >>it to another object. Is this correct?
> >
> >Not sure what you mean. Thinking about a Label the model will most
> >likely be a String like "This is my Label". Using Model or
> >PropertyModel you have very flexible and dynamic means to retrieve the
> >label's text. But the Label itself is not the model.
> 
>        For LoginPanel, I see username/password being set directly on
> the Panel object and not on a separate object. I was asking what
> happens if there is no model object associated with a Wicket component
> (i.e. you call the constructor that doesn't set one)?
> 

Panel actually doesn't need a model. Panel doesn't have anything like
a label text or a list of element to be displayed in a table. A Panel
might have zero, one or many components and their model object might
be from a single model object. Though Panel is just lacking the
constructor. If you plan to subclass panel where a model object makes
sense, just call setModelObject().

Juergen


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to