Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
you have to version properties if you want back button support public void setExternalSrc(boolean externalSrc) { if (externalSrc!=this.externalSrc) { final boolean old=this.externalSrc; addStatChange(new Change() { void undo() { this.externalSrc=old; }}); } this.externalSrc = externalSrc; } } -igor - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
* Juergen Donnerstag: > That is added by default So, the links are already transformed automagically without the need to do anything more? I have to check that. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
That is added by default Juergen On 11/19/06, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: > * Juergen Donnerstag: > > > ApplicationSettings.getContextPath() and PrependContextPathHandler > > Thanks Juergen, > > PrependContextPathHandler seems to be what we are looking for > indeed. But what does it mean «This is a markup inline filter > which by default is added to the list of markup filters.» It > suggests that I don't have to do anything to use it, but the next > sentence indicates how to use it... > -- > Jean-Baptiste Quenot > aka John Banana Qwerty > http://caraldi.com/jbq/ > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
Hi all, I know I'm not addressing the exact issue, but just my two cents: I needed to dynamically specify the src attribute of the img tag, and I couldn't find great examples for doing this. And I adopted the following: WebMarkupContainer flag = new WebMarkupContainer("flag-image-path"); flag.add(new SimpleAttributeModifier("src", Application.get().getApplicationSettings().getContextPath() + File.separator + "images/flags/" + entry.getPhoto().getLocation().getCountry().toLowerCase() + ".png")); add(flag); It worked but I wasn't deeply convinced with it. As I have to do this type of stuff quite often in my code, and, moreover, I thought it wasn't the cleanest way possible (I prefer to leave paths like 'images/flags' and '.png' in my HTML page), I wrote a WebComponent that maybe some people could find useful. Basically, it watchs the 'src' attribute, looking for the @DYNAMIC@ placeholder that it inserts the specified value at java code level. I also added the external flag, to point to dynamic external image sources. I use it a lot, although I don't know if it has a good "wicket approach". Let me know if anything's wrong with it. Here it goes: public class DynamicPathImage extends WebComponent { private static final long serialVersionUID = 1L; private boolean externalSrc = false; public DynamicPathImage(String id, String text) { super(id, new Model(text)); } @Override public void onComponentTag(final ComponentTag tag) { checkComponentTag(tag, "img"); String dynamicText = getModelObjectAsString(); super.onComponentTag(tag); String src = (String) tag.getAttributes().getString("src"); if (src != null && src.contains("@DYNAMIC@")) { src = src.replaceAll("@DYNAMIC@", dynamicText); } else { src = dynamicText; } if (isExternalSrc()) { tag.put("src", src); } else { tag.put("src", Application.get().getApplicationSettings().getContextPath() + File.separator + src); } } public boolean isExternalSrc() { return externalSrc; } public void setExternalSrc(boolean externalSrc) { this.externalSrc = externalSrc; } } ...and in my page I would call it like this: // Set path for the country flag image add(new DynamicPathImage("flag-image-path", entry.getPhoto().getLocation().getCountry().toLowerCase())); If I need to include a dynamic path not in my Wicket-enabled application: // Set path for the main photo DynamicPathImage photo = new DynamicPathImage("entry-image-path", PHOTO_DIR_URL + entry.getPhoto().getImagePath()); photo.setExternalSrc(true); add(photo); Thanks, Francisco ___ Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
* Juergen Donnerstag: > ApplicationSettings.getContextPath() and PrependContextPathHandler Thanks Juergen, PrependContextPathHandler seems to be what we are looking for indeed. But what does it mean « This is a markup inline filter which by default is added to the list of markup filters. » It suggests that I don't have to do anything to use it, but the next sentence indicates how to use it... -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
yes, just set the context path in the settings when you are behind a proxy/virtual host. then it should work. Please let us know what situation doesn't work for you that you expect to work. johan On 11/19/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote: ApplicationSettings.getContextPath() and PrependContextPathHandler Juergen On 11/19/06, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: > * Juergen Donnerstag: > > > Please take a look at the examples. They are usually a good > > source for informaton. As far as I can tell, in Wicket you don't > > need it, at least I didn't. > > It works in the general case if you use relative paths, for > example: > > But if you use WebApplication.mount(), those links cease to > reference the proper resource as in this case we need an absolute > path, and thus referencing the context path. > -- > Jean-Baptiste Quenot > aka John Banana Qwerty > http://caraldi.com/jbq/ > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
ApplicationSettings.getContextPath() and PrependContextPathHandler Juergen On 11/19/06, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: > * Juergen Donnerstag: > > > Please take a look at the examples. They are usually a good > > source for informaton. As far as I can tell, in Wicket you don't > > need it, at least I didn't. > > It works in the general case if you use relative paths, for > example: > > But if you use WebApplication.mount(), those links cease to > reference the proper resource as in this case we need an absolute > path, and thus referencing the context path. > -- > Jean-Baptiste Quenot > aka John Banana Qwerty > http://caraldi.com/jbq/ > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
* Juergen Donnerstag: > Please take a look at the examples. They are usually a good > source for informaton. As far as I can tell, in Wicket you don't > need it, at least I didn't. It works in the general case if you use relative paths, for example: But if you use WebApplication.mount(), those links cease to reference the proper resource as in this case we need an absolute path, and thus referencing the context path. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
Please take a look at the examples. They are usually a good source for informaton. As far as I can tell, in Wicket you don't need it, at least I didn't. Juergen On 11/19/06, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: > * Carfield Yim: > > > Astheuserwill deploytheapplicationwith > > difference web application name, like http://host1/app1 or > > http://host2/app2. The URL will be /app1/images/icon.jpg or > > /app2/images/icon.jpg . How can I set the image path to > > something like $baseurl/images/icon.jpg ? I've try to setup > > at but the rendered HTML don't > > contain that elements. > > I have the same problem and Wicket does not seem to address > that. Seems like we have to use a template for that, > like wicket.extensions.util.resource.TextTemplate to replace > $contextPath > > You don't need to specify the full URL with host name however, > using an absolute path is sufficient. > -- > Jean-Baptiste Quenot > aka John Banana Qwerty > http://caraldi.com/jbq/ > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
* Carfield Yim: > Astheuserwill deploytheapplicationwith > difference web application name, like http://host1/app1 or > http://host2/app2. The URL will be /app1/images/icon.jpg or > /app2/images/icon.jpg . How can I set the image path to > something like $baseurl/images/icon.jpg ? I've try to setup > at but the rendered HTML don't > contain that elements. I have the same problem and Wicket does not seem to address that. Seems like we have to use a template for that, like wicket.extensions.util.resource.TextTemplate to replace $contextPath You don't need to specify the full URL with host name however, using an absolute path is sufficient. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
* Erik van Oosten: > > I think you are looking for this information: > http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html I don't think this is the right answer as the URL is not generated by Wicket in this usecase. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Just wonder how everybody manage the image path when using wicket?
Hi Carfield, I think you are looking for this information: http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html Regards, Erik. Carfield Yim schreef: > As the user will deploy the application with difference web > application name, like http://host1/app1 or http://host2/app2. The URL > will be /app1/images/icon.jpg or /app2/images/icon.jpg . How can I set > the image path to something like $baseurl/images/icon.jpg ? I've try > to setup at but the rendered HTML don't > contain that elements. > -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Just wonder how everybody manage the image path when using wicket?
As the user will deploy the application with difference web application name, like http://host1/app1 or http://host2/app2. The URL will be /app1/images/icon.jpg or /app2/images/icon.jpg . How can I set the image path to something like $baseurl/images/icon.jpg ? I've try to setup at but the rendered HTML don't contain that elements. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user