To Igor and James:
>so if that is all it does why does it need to be a component?
>Why do you need it to be a component? Are you controlling the
>visibility of it via code?
#1, I need to add(IBehavior) to the img's to make change to their class
attribute, so I need them to be a component.
#2, I don't like img src attributes in template like this:
src="resources/com.mycompany.component.MyComponent/open.png"
src="resources/com.mycompany.component.MyComponent/close.png"
src="resources/com.mycompany.component.MyComponent/north.png"
src="resources/com.mycompany.component.MyComponent/sourth.png"
etc
This would break if I re-name the component or move it to a different
package. It would be better if they are:
src="open.png"
src="close.png"
src="north.png"
src="sourth.png"
etc
and change the src attribute to full paths in code. The little PackageImage
class solve this use case.
>so i would say, no, it takes 10 minutes to write one
I completely agree it's very trivial to create.... after getting help here
:) Still I commit error by holding on to Class reference (thanks for
pointing out). If there is such class built-in, then no chance for such
error and this use case is taken care of.
>i can come up with at least 10 trivial classes that have to do with images
off the top of my head
Well, this is the thing: you know Wicket inside out. Stuffs that are trivial
for you may not be so trivial to regular Wicket user. But I totally
understand your reluctance to add stuff to Wicket. It's like adding key
words to Java, the answer is almost always "no". So if not adding these
"little trivial" stuff, a wiki showing all the "little image" use cases
would be great.
Anyway, I am not happy with my little PackageImage class. I want to allow
application to override the image files to have different look and only
fallback to the built-in images, just like localization. How can this be
done?
On Mon, Mar 31, 2008 at 4:35 AM, James Carman <[EMAIL PROTECTED]>
wrote:
> On Mon, Mar 31, 2008 at 12:28 AM, Matthew Young <[EMAIL PROTECTED]> wrote:
> > >wicket:link doesnt touch components afaik
> >
> > :((((( I need it to be a component. My code is basically this:
> >
> > add(new WebMarkupContainer("img"));
>
> Why do you need it to be a component? Are you controlling the
> visibility of it via code?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>