Hi,
Here is a very simple example, using BoxBorder from wicket:
(works very well until you add img tag). What is wrong with this code ?
TestPage.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<span wicket:id="box">
this is inside box: <input wicket:id="text" type="text"/><br/>
<img wicket:id="img" src="test.png"/>
</span>
</body>
</html>
TestPage.java:
package syncrontech.examples.blastfurnace.wicket;
import wicket.markup.html.WebPage;
import wicket.markup.html.border.BoxBorder;
import wicket.markup.html.form.TextField;
import wicket.markup.html.image.Image;
public class TestPage extends WebPage
{
public TestPage()
{
BoxBorder b = new BoxBorder("box");
add(b);
b.add(new TextField("text"));
b.add(new Image("img"));
}
}
Ari S.
----- Original Message -----
From: "Eelco Hillenius" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, October 04, 2005 9:17 AM
Subject: Re: [Wicket-user] Image inside Border doesn't work correctly
>I agree. My approach is to think in reusable components that in this
> case have packaged images. Hence actually I view those images as an
> implementation detail and I don't want parent components to have to
> know about what resources a component needs.
>
> You (Ari) are right that this conflicts with previewability though.
> This is one of the things where it would help to have IDE support.
>
> Eelco
>
>
> On 10/4/05, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
>> As a general rule of thumb I prefer the current approach. But in order
>> to solve your problem, why don't you just use the parent component
>> (getParent()) to achieve hat you want?
>>
>> Juergen
>>
>> On 10/4/05, Ari Suutari <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > > It hasn't changed since the beginning. I wonder how it breaks existing
code?
>> >
>> > Sorry, I didn't mean that it would break existing code, I meant that
it breaks
>> > a html file which works as plain html (ie. the image is in the same
directory
>> > as html file).
>> >
>> > I myself haven't noticed this before, since I used to have all related
>> > classes in same package. After moving generic stuff to separate
>> > package the problem came visible.
>> >
>> > How I think it should work is that the stuff injected by <wicket:body>
>> > shouldn't use the package/path of border component but instead
>> > the package/path of surrounding component (which would be page
>> > in simple cases or a panel in more complex ones).
>> >
>> > Ari S.
>> >
>> > >
>> > > Juergen
>> > >
>> > > On 10/4/05, Ari Suutari <[EMAIL PROTECTED]> wrote:
>> > >> > Well, Wicket defines the "correct" place as the same package as the
component.
>> > >>
>> > >> But this is wrong:
>> > >>
>> > >> - it breaks working html
>> > >> - although the border is a component, the stuff inside is not part
of it.
>> > >>
>> > >> Ari S.
>> > >>
>> > >> >
>> > >> > On 10/3/05, Ari Suutari <[EMAIL PROTECTED]> wrote:
>> > >> >> Hi,
>> > >> >>
>> > >> >> Assume following html:
>> > >> >>
>> > >> >> <span wicket:id="border">
>> > >> >> <img wicket:id="img" src="test.png"/>
>> > >> >> </span>
>> > >> >>
>> > >> >> Now, If the application is in package syncrontech.test except that
>> > >> >> border is syncrontech.borders.NiceBorder (I have a separate package
>> > >> >> for common thingies) wicket is unable to find test.png during
runtime, instead
>> > >> >> I get:
>> > >> >>
>> > >> >>
>> > >> >> wicket.WicketRuntimeException: Unable to find package resource [path = syncrontech/borders/test.png, style = null,
>> > >> >> locale
>> > >> >> =
>> > >> >> fi]
>> > >> >>
>> > >> >> Ie. it looks for image in wrong place (correct place is
syncrontech/test/test.png).
>> > >> >>
>> > >> >> I'm using wicket 1.1-rc1.
>> > >> >>
>> > >> >> Ari S.
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >> -------------------------------------------------------
>> > >> >> This SF.Net email is sponsored by:
>> > >> >> Power Architecture Resource Center: Free content, downloads,
discussions,
>> > >> >> and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > >> >> _______________________________________________
>> > >> >> Wicket-user mailing list
>> > >> >> [email protected]
>> > >> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
>> > >> >>
>> > >> >
>> > >> >
>> > >> > -------------------------------------------------------
>> > >> > This SF.Net email is sponsored by:
>> > >> > Power Architecture Resource Center: Free content, downloads,
discussions,
>> > >> > and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > >> > _______________________________________________
>> > >> > Wicket-user mailing list
>> > >> > [email protected]
>> > >> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> > >> >
>> > >> >
>> > >>
>> > >>
>> > >> -------------------------------------------------------
>> > >> This SF.Net email is sponsored by:
>> > >> Power Architecture Resource Center: Free content, downloads,
discussions,
>> > >> and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > >> _______________________________________________
>> > >> Wicket-user mailing list
>> > >> [email protected]
>> > >> https://lists.sourceforge.net/lists/listinfo/wicket-user
>> > >>
>> > >
>> > >
>> > > -------------------------------------------------------
>> > > This SF.Net email is sponsored by:
>> > > Power Architecture Resource Center: Free content, downloads, discussions,
>> > > and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > > _______________________________________________
>> > > Wicket-user mailing list
>> > > [email protected]
>> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> > >
>> > >
>> >
>> >
>> >
>> > -------------------------------------------------------
>> > This SF.Net email is sponsored by:
>> > Power Architecture Resource Center: Free content, downloads, discussions,
>> > and more. http://solutions.newsforge.com/ibmarch.tmpl
>> > _______________________________________________
>> > Wicket-user mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by:
>> Power Architecture Resource Center: Free content, downloads, discussions,
>> and more. http://solutions.newsforge.com/ibmarch.tmpl
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user