Re: [Wicket-user] How do you load an external image?

2007-01-30 Thread Scott Swank

I went back to this last night and it just worked the way it should have in
the first place without any changes.  I imagine that we had something mucked
up in our app's resource stream locator.

Thanks again.

On 1/24/07, Igor Vaynberg [EMAIL PROTECTED] wrote:


ah, so the image doesnt even render, i see. i thought that url you
showed was in the image's src. so this thread doesnt have anything to
do with the staticimage component itself???

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
 No markup is produced.  It's in a ModalWindow.  Here's the dump from the
 Ajax debug window:

 INFO: Initiating Ajax GET request on

/wicketapp/app?wicket:interface=:1:openScroll::IBehaviorListenerwicket:behaviorId=0random=
0.46680841416499696
 INFO: Invoking pre-call handler(s)...
 ERROR: Received Ajax response with code: 500
 INFO: Invoking post-call handler(s)...
 INFO: Invoking failure handler(s)...

 On 1/24/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
  that is very peculiar, i dont see a reason for it to look for a
packaged
 resource, what does the produced markup look like?
 
  -igor
 
 
 
 
  On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
  
   And the html tag is simply:
  
  img wicket:id=productImage /
  
   Thank you.
  
  
   On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:
  
The image is added to the panel like so:
   
   add(new StaticImage(productImage, 
 http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
 ));
   
And that uses a convenience constructor I added to the original
 StaticImage:
   
package com.vegas.wicket;
   
import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;
   
public class StaticImage extends WebComponent
{
private static final long serialVersionUID =
 -7600332611457262341L;
   
public StaticImage(String id, IModel model)
{
super(id, model);
}
   
public StaticImage(String id, String url)
{
this(id, new Model(url));
}
   
protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}
}
  
  
  
   --
   Scott Swank
   reformed mathematician
  

-
   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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
 
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 



 --
 Scott Swank
 reformed mathematician

-
 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





--
Scott Swank
reformed mathematician
-
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net

Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Scott Swank

When I use the above StaticImage Wicket looks for the image url in the path
of the relevant component like so:

com/vegas/cart/wicket/components/scroll/http:/cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg

Do I need to add a WebPageResourceStreamLocator or some such thing?  The
full log output is below.  Thank you as always.

1/24 15:02:14 WARN | PackageResource.getResourceStream(553): Unable to find
package resource [path =
com/vegas/cart/wicket/components/scroll/http:/cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg,
style = null, locale = en_US]
1/24 15:02:14 ERROR| AjaxRequestTarget.respond(379): Error while responding
to an AJAX request: [EMAIL PROTECTED] markupIdToComponent
[{scrollPopup=[MarkupContainer [Component id = scrollPopup, page =
com.vegas.cart.wicket.pages.Index, path = 7:scrollPopup.ModalWindow,
isVisible = true, isVersioned = false]]}], prependJavascript [[]],
appendJavascript [[var element = document.getElementById
(scrollPopup_content);
var settings = new Object();
settings.minWidth=200;
settings.minHeight=200;
settings.className=w_blue;
settings.width=800;
settings.height=400;
settings.resizable=true;
settings.element = element;
settings.cookieId=modal-window-18936477;
settings.title=Deathmatch Scrolling View;
settings.mask=semi-transparent;
settings.onClose = function() { var
wcall=wicketAjaxGet('/wicketapp/app?wicket:interface=:7:scrollPopup::IBehaviorListenerwicket:behaviorId=1',
function() { }, function() { }); };
Wicket.Window.create(settings).show();
]]
wicket.protocol.http.servlet.AbortWithWebErrorCodeException
   at wicket.markup.html.PackageResource.getResourceStream(
PackageResource.java:556)
   at wicket.markup.html.PackageResource.init(PackageResource.java:502)
   at wicket.markup.html.PackageResource.get(PackageResource.java:424)
   at
wicket.markup.html.image.resource.LocalizedImageResource$1.newResource(
LocalizedImageResource.java:361)
   at wicket.ResourceReference.bind(ResourceReference.java:149)
   at wicket.markup.html.image.resource.LocalizedImageResource.bind(
LocalizedImageResource.java:180)
   at
wicket.markup.html.image.resource.LocalizedImageResource.loadStaticImage(
LocalizedImageResource.java:368)
   at
wicket.markup.html.image.resource.LocalizedImageResource.setSrcAttribute(
LocalizedImageResource.java:283)
   at wicket.markup.html.image.Image.onComponentTag(Image.java:225)
   at wicket.Component.renderComponent(Component.java:1688)
   at wicket.markup.html.WebComponent.onRender(WebComponent.java:61)
   at wicket.Component.render(Component.java:1533)
   at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
   at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java
:982)
   at wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java
:571)
   at wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:108)
   at wicket.Component.renderComponent(Component.java:1719)
   at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
   at wicket.Component.render(Component.java:1533)
   at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
   at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java
:982)
   at wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java
:571)
   at wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:108)
   at wicket.Component.renderComponent(Component.java:1719)
   at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
   at wicket.Component.render(Component.java:1533)
   at wicket.Component.renderComponent(Component.java:1657)
   at wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java
:474)
   at wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:361)
   at wicket.request.compound.DefaultResponseStrategy.respond(
DefaultResponseStrategy.java:49)
   at wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond
(AbstractCompoundRequestCycleProcessor.java:66)
   at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
   at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:934)
   at wicket.RequestCycle.step(RequestCycle.java:1010)
   at wicket.RequestCycle.steps(RequestCycle.java:1084)
   at wicket.RequestCycle.request(RequestCycle.java:454)
   at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
ReplyHeaderFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at 

Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Igor Vaynberg
how are you creating the static image?

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
 When I use the above StaticImage Wicket looks for the image url in the path
 of the relevant component like so:

 com/vegas/cart/wicket/components/scroll/http:/cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg

  Do I need to add a WebPageResourceStreamLocator or some such thing?  The
 full log output is below.  Thank you as always.

 1/24 15:02:14 WARN |
 PackageResource.getResourceStream(553): Unable to find
 package resource [path =
 com/vegas/cart/wicket/components/scroll/http:/cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg,
 style = null, locale = en_US]
 1/24 15:02:14 ERROR| AjaxRequestTarget.respond(379): Error while responding
 to an AJAX request: [EMAIL PROTECTED] markupIdToComponent
 [{scrollPopup=[MarkupContainer [Component id = scrollPopup, page =
 com.vegas.cart.wicket.pages.Index , path =
 7:scrollPopup.ModalWindow, isVisible = true, isVersioned = false]]}],
 prependJavascript [[]], appendJavascript [[var element =
 document.getElementById(scrollPopup_content);
 var settings = new Object();
 settings.minWidth=200;
 settings.minHeight=200;
 settings.className=w_blue;
 settings.width=800;
 settings.height=400;
 settings.resizable=true;
 settings.element = element;
 settings.cookieId=modal-window-18936477;
 settings.title=Deathmatch Scrolling View;
 settings.mask=semi-transparent;
 settings.onClose = function() { var
 wcall=wicketAjaxGet('/wicketapp/app?wicket:interface=:7:scrollPopup::IBehaviorListenerwicket:behaviorId=1',
 function() { }, function() { }); };
 Wicket.Window.create(settings).show();
 ]]
 wicket.protocol.http.servlet.AbortWithWebErrorCodeException
 at
 wicket.markup.html.PackageResource.getResourceStream(PackageResource.java:556)
 at wicket.markup.html.PackageResource
 .init(PackageResource.java:502)
 at
 wicket.markup.html.PackageResource.get(PackageResource.java:424)
 at
 wicket.markup.html.image.resource.LocalizedImageResource$1.newResource(LocalizedImageResource.java
 :361)
 at wicket.ResourceReference.bind(ResourceReference.java:149)
 at
 wicket.markup.html.image.resource.LocalizedImageResource.bind(LocalizedImageResource.java:180)
 at
 wicket.markup.html.image.resource.LocalizedImageResource.loadStaticImage
 (LocalizedImageResource.java:368)
 at
 wicket.markup.html.image.resource.LocalizedImageResource.setSrcAttribute(LocalizedImageResource.java:283)
 at
 wicket.markup.html.image.Image.onComponentTag(Image.java:225)
 at
 wicket.Component.renderComponent(Component.java:1688)
 at
 wicket.markup.html.WebComponent.onRender(WebComponent.java:61)
 at wicket.Component.render(Component.java:1533)
 at wicket.MarkupContainer.renderNext
 (MarkupContainer.java:1334)
 at
 wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
 at
 wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
 at wicket.markup.html.panel.Panel.onComponentTagBody
 (Panel.java:108)
 at
 wicket.Component.renderComponent(Component.java:1719)
 at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
 at wicket.Component.render(Component.java:1533)
 at wicket.MarkupContainer.renderNext
 (MarkupContainer.java:1334)
 at
 wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
 at
 wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
 at wicket.markup.html.panel.Panel.onComponentTagBody
 (Panel.java:108)
 at
 wicket.Component.renderComponent(Component.java:1719)
 at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
 at wicket.Component.render(Component.java:1533)
 at wicket.Component.renderComponent
 (Component.java:1657)
 at
 wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:474)
 at
 wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:361)
 at
 wicket.request.compound.DefaultResponseStrategy.respond
 (DefaultResponseStrategy.java:49)
 at
 wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
 at
 wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java
 :902)
 at
 wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:934)
 at wicket.RequestCycle.step(RequestCycle.java:1010)
 at wicket.RequestCycle.steps(RequestCycle.java:1084)
 at wicket.RequestCycle.request (RequestCycle.java:454)
 at
 wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java
 :810)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
   

Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Scott Swank

The image is added to the panel like so:

  add(new StaticImage(productImage, 
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg;));

And that uses a convenience constructor I added to the original StaticImage:

package com.vegas.wicket;

import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;

public class StaticImage extends WebComponent
{
   private static final long serialVersionUID = -7600332611457262341L;

   public StaticImage(String id, IModel model)
   {
   super(id, model);
   }

   public StaticImage(String id, String url)
   {
   this(id, new Model(url));
   }

   protected void onComponentTag(ComponentTag tag)
   {
   checkComponentTag(tag, img);
   tag.put(src, getModelObjectAsString());
   }
}
-
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Scott Swank

And the html tag is simply:

  img wicket:id=productImage /

Thank you.

On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:


The image is added to the panel like so:

   add(new StaticImage(productImage, 
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
));

And that uses a convenience constructor I added to the original
StaticImage:

package com.vegas.wicket;

import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;

public class StaticImage extends WebComponent
{
private static final long serialVersionUID = -7600332611457262341L;

public StaticImage(String id, IModel model)
{
super(id, model);
}

public StaticImage(String id, String url)
{
this(id, new Model(url));
}

protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}
}





--
Scott Swank
reformed mathematician
-
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Igor Vaynberg

that is very peculiar, i dont see a reason for it to look for a packaged
resource, what does the produced markup look like?

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:


And the html tag is simply:

   img wicket:id=productImage /

Thank you.

On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:

 The image is added to the panel like so:

add(new StaticImage(productImage,  
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
 ));

 And that uses a convenience constructor I added to the original
 StaticImage:

 package com.vegas.wicket;

 import wicket.markup.ComponentTag;
 import wicket.markup.html.WebComponent;
 import wicket.model.IModel;
 import wicket.model.Model;

 public class StaticImage extends WebComponent
 {
 private static final long serialVersionUID = -7600332611457262341L;

 public StaticImage(String id, IModel model)
 {
 super(id, model);
 }

 public StaticImage(String id, String url)
 {
 this(id, new Model(url));
 }

 protected void onComponentTag(ComponentTag tag)
 {
 checkComponentTag(tag, img);
 tag.put(src, getModelObjectAsString());
 }
 }




--
Scott Swank
reformed mathematician
-
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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Scott Swank

We have added a new ResourceStreamLocator to let us put html files off in a
separate directory for our UI team.  From our WebApplication:

 protected void init() {
 super.init();
 CompoundResourceStreamLocator locator =

(CompoundResourceStreamLocator)getResourceSettings().getResourceStreamLocator();
WebApplicationPath resourceFinder = (WebApplicationPath)
getResourceSettings().getResourceFinder();
resourceFinder.add(/dev/uiproto/wicketapp/content); //this path
should be changed
resourceFinder.add(/dev/workspace/wicketapp/content); //this path
should be changed

locator.add(0, new WebPageResourceStreamLocator(resourceFinder));
 }

Is that potentially the culprit?

On 1/24/07, Igor Vaynberg [EMAIL PROTECTED] wrote:


that is very peculiar, i dont see a reason for it to look for a packaged
resource, what does the produced markup look like?

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:

 And the html tag is simply:

img wicket:id=productImage /

 Thank you.

 On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:
 
  The image is added to the panel like so:
 
 add(new StaticImage(productImage,  
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
  ));
 
  And that uses a convenience constructor I added to the original
  StaticImage:
 
  package com.vegas.wicket;
 
  import wicket.markup.ComponentTag;
  import wicket.markup.html.WebComponent;
  import wicket.model.IModel;
  import wicket.model.Model;
 
  public class StaticImage extends WebComponent
  {
  private static final long serialVersionUID =
  -7600332611457262341L;
 
  public StaticImage(String id, IModel model)
  {
  super(id, model);
  }
 
  public StaticImage(String id, String url)
  {
  this(id, new Model(url));
  }
 
  protected void onComponentTag(ComponentTag tag)
  {
  checkComponentTag(tag, img);
  tag.put(src, getModelObjectAsString());
  }
  }




 --
 Scott Swank
 reformed mathematician

 -
 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user






--
Scott Swank
reformed mathematician
-
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Scott Swank

No markup is produced.  It's in a ModalWindow.  Here's the dump from the
Ajax debug window:

*INFO: *
Initiating Ajax GET request on
/wicketapp/app?wicket:interface=:1:openScroll::IBehaviorListenerwicket:behaviorId=0random=
0.46680841416499696
*INFO: *Invoking pre-call handler(s)...
*ERROR: *Received Ajax response with code: 500
*INFO: *Invoking post-call handler(s)...
*INFO: *Invoking failure handler(s)...


On 1/24/07, Igor Vaynberg [EMAIL PROTECTED] wrote:


that is very peculiar, i dont see a reason for it to look for a packaged
resource, what does the produced markup look like?

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:

 And the html tag is simply:

img wicket:id=productImage /

 Thank you.

 On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:
 
  The image is added to the panel like so:
 
 add(new StaticImage(productImage,  
http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
  ));
 
  And that uses a convenience constructor I added to the original
  StaticImage:
 
  package com.vegas.wicket;
 
  import wicket.markup.ComponentTag;
  import wicket.markup.html.WebComponent;
  import wicket.model.IModel;
  import wicket.model.Model;
 
  public class StaticImage extends WebComponent
  {
  private static final long serialVersionUID =
  -7600332611457262341L;
 
  public StaticImage(String id, IModel model)
  {
  super(id, model);
  }
 
  public StaticImage(String id, String url)
  {
  this(id, new Model(url));
  }
 
  protected void onComponentTag(ComponentTag tag)
  {
  checkComponentTag(tag, img);
  tag.put(src, getModelObjectAsString());
  }
  }




 --
 Scott Swank
 reformed mathematician

 -
 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user






--
Scott Swank
reformed mathematician
-
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Igor Vaynberg
i have no idea why you would have that weird stuff in the src
attribute, its not in the model.

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
 No markup is produced.  It's in a ModalWindow.  Here's the dump from the
 Ajax debug window:

 INFO: Initiating Ajax GET request on
 /wicketapp/app?wicket:interface=:1:openScroll::IBehaviorListenerwicket:behaviorId=0random=0.46680841416499696
 INFO: Invoking pre-call handler(s)...
 ERROR: Received Ajax response with code: 500
 INFO: Invoking post-call handler(s)...
 INFO: Invoking failure handler(s)...

 On 1/24/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
  that is very peculiar, i dont see a reason for it to look for a packaged
 resource, what does the produced markup look like?
 
  -igor
 
 
 
 
  On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
  
   And the html tag is simply:
  
  img wicket:id=productImage /
  
   Thank you.
  
  
   On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:
  
The image is added to the panel like so:
   
   add(new StaticImage(productImage, 
 http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
 ));
   
And that uses a convenience constructor I added to the original
 StaticImage:
   
package com.vegas.wicket;
   
import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;
   
public class StaticImage extends WebComponent
{
private static final long serialVersionUID =
 -7600332611457262341L;
   
public StaticImage(String id, IModel model)
{
super(id, model);
}
   
public StaticImage(String id, String url)
{
this(id, new Model(url));
}
   
protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}
}
  
  
  
   --
   Scott Swank
   reformed mathematician
  
 -
   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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
 
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 



 --
 Scott Swank
 reformed mathematician
 -
 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2007-01-24 Thread Igor Vaynberg
ah, so the image doesnt even render, i see. i thought that url you
showed was in the image's src. so this thread doesnt have anything to
do with the staticimage component itself???

-igor


On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
 No markup is produced.  It's in a ModalWindow.  Here's the dump from the
 Ajax debug window:

 INFO: Initiating Ajax GET request on
 /wicketapp/app?wicket:interface=:1:openScroll::IBehaviorListenerwicket:behaviorId=0random=0.46680841416499696
 INFO: Invoking pre-call handler(s)...
 ERROR: Received Ajax response with code: 500
 INFO: Invoking post-call handler(s)...
 INFO: Invoking failure handler(s)...

 On 1/24/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
  that is very peculiar, i dont see a reason for it to look for a packaged
 resource, what does the produced markup look like?
 
  -igor
 
 
 
 
  On 1/24/07, Scott Swank [EMAIL PROTECTED] wrote:
  
   And the html tag is simply:
  
  img wicket:id=productImage /
  
   Thank you.
  
  
   On 1/24/07, Scott Swank  [EMAIL PROTECTED] wrote:
  
The image is added to the panel like so:
   
   add(new StaticImage(productImage, 
 http://cache.vegas.com/resorts/thehotel/mandalaybaynew.jpg
 ));
   
And that uses a convenience constructor I added to the original
 StaticImage:
   
package com.vegas.wicket;
   
import wicket.markup.ComponentTag;
import wicket.markup.html.WebComponent;
import wicket.model.IModel;
import wicket.model.Model;
   
public class StaticImage extends WebComponent
{
private static final long serialVersionUID =
 -7600332611457262341L;
   
public StaticImage(String id, IModel model)
{
super(id, model);
}
   
public StaticImage(String id, String url)
{
this(id, new Model(url));
}
   
protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}
}
  
  
  
   --
   Scott Swank
   reformed mathematician
  
 -
   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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
 
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 



 --
 Scott Swank
 reformed mathematician
 -
 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] How do you load an external image?

2006-12-27 Thread August Detlefsen
How can I load an image directly from a url?

For example I want to display a picture of a user next to their profile, 
but all of the images are served by another machine for better 
performance. I tried something like this but it won't compile:

Image profileImg = new Image(profileimg);
profileImg.setImageResource( new UrlResourceStream( new 
URL(user.getPhotourl()) ) );


Thanks,
August

-
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.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2006-12-27 Thread Igor Vaynberg

class staticimage extends webcomponent {

public staticimage(string id, imodel model) {
   super(id, model);
 }

 protected void oncomponenttag(tag) {
 checkcomponenttag(tag, img);
 tag.put(src, getModelObjectAsString());
   }
}

add(new staticimage(img, new Model(http://foo.com/bar.gif;));

-igor


On 12/27/06, August Detlefsen [EMAIL PROTECTED] wrote:


How can I load an image directly from a url?

For example I want to display a picture of a user next to their profile,
but all of the images are served by another machine for better
performance. I tried something like this but it won't compile:

Image profileImg = new Image(profileimg);
profileImg.setImageResource( new UrlResourceStream( new
URL(user.getPhotourl()) ) );


Thanks,
August

-
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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2006-12-27 Thread August Detlefsen

Thank you Igor! You don't know how long I tried to do this.

I've added this fix to the Wiki:
http://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image

-August



Igor Vaynberg wrote:

class staticimage extends webcomponent {

 public staticimage(string id, imodel model) {
super(id, model);
  }

  protected void oncomponenttag(tag) {
  checkcomponenttag(tag, img);
  tag.put(src, getModelObjectAsString());
}
}

add(new staticimage(img, new Model(http://foo.com/bar.gif;));

-igor


On 12/27/06, *August Detlefsen* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


How can I load an image directly from a url?

For example I want to display a picture of a user next to their
profile,
but all of the images are served by another machine for better
performance. I tried something like this but it won't compile:

Image profileImg = new Image(profileimg);
profileImg.setImageResource( new UrlResourceStream( new
URL(user.getPhotourl()) ) );


Thanks,
August

-

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.phpp=sourceforgeCID=DEVDEV
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How do you load an external image?

2006-12-27 Thread Igor Vaynberg

i wouldnt really call it a fix, just common sense after using wicket for a
bit :)

-igor


On 12/27/06, August Detlefsen [EMAIL PROTECTED] wrote:


 Thank you Igor! You don't know how long I tried to do this.

I've added this fix to the Wiki:

http://cwiki.apache.org/confluence/display/WICKET/How+to+load+an+external+image

-August



Igor Vaynberg wrote:

class staticimage extends webcomponent {

 public staticimage(string id, imodel model) {
super(id, model);
  }

  protected void oncomponenttag(tag) {
  checkcomponenttag(tag, img);
  tag.put(src, getModelObjectAsString());
}
}

add(new staticimage(img, new Model(http://foo.com/bar.gif;));

-igor


On 12/27/06, August Detlefsen [EMAIL PROTECTED] wrote:

 How can I load an image directly from a url?

 For example I want to display a picture of a user next to their profile,
 but all of the images are served by another machine for better
 performance. I tried something like this but it won't compile:

 Image profileImg = new Image(profileimg);
 profileImg.setImageResource( new UrlResourceStream( new
 URL(user.getPhotourl()) ) );


 Thanks,
 August

 -

 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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=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.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user