WebComponent was a perfect fit, thank you.
A somewhat related problem exists however.
I load this Image using AjaxLazyLoadPanel like so:
add(new AjaxLazyLoadPanel("image") {
/**
* Makes object serializable.
*/
private static final long serialVersionUID = 1L;
@Override
public Component getLazyLoadComponent(String id) {
return (new ChartPanel(id));
}
});
class ChartPanel extends Panel {
private static final long serialVersionUID = 1L;
/**
* Constructor for ChartPanel.
*
* @param - The id to use
*
*/
public ChartPanel(String id) {
super(id);
addChart(this);
}
which calls my the addChart() that works now since I switched to WebComponent.
The lazy loading image (the spinning waiter) continues to spin after
the image is loaded.
Am I missing something obvious here to make it stop?
Thanks
On Sat, Dec 5, 2009 at 3:33 AM, bgooren <[email protected]> wrote:
>
> If you want to generate the URL yourself and want to keep using the code you
> have already written, use a WebComponent instead of an Image:
>
> WebComponent dynamicImage = new WebComponent("image");
> dynamicImage.add(new AttributeModifier("src", true, new
> AbstractReadOnlyModel() {} ) );
>
> Otherwise, as suggested by the previous reply, look into
> DynamicImageResource.
>
>
> bassglider wrote:
>>
>> Hi Everyone,
>>
>> I am attempting to load an image that takes some time. I can load a
>> remote image using the URL, but when it takes time to gather the data
>> and then get the url, I get this:
>>
>> [java] 11174 [btpool0-1] ERROR org.apache.wicket.RequestCycle -
>> Exception in rendering component: [Component id = image]
>> [java] org.apache.wicket.WicketRuntimeException: Exception in
>> rendering component: [Component id = image]
>> [java] at
>> org.apache.wicket.Component.renderComponent(Component.java:2656)
>> [java] at
>> org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62)
>> [java] at org.apache.wicket.Component.render(Component.java:2448)
>>
>>
>> I read that it could be from the thread expiring or the page trying to
>> modify itself after it is rendered(?)
>>
>> So I tried adding this to my Application
>>
>> �...@override
>> protected void init() {
>> super.init();
>>
>> //remove thread monitoring from resource watcher
>> this.getResourceSettings().setResourcePollFrequency(null);
>> }
>>
>>
>> It had no effect on the issue. Any suggestions or remedies would be
>> greatly appreciated.
>>
>> Here is the code I am using:
>>
>>
>> Image dynamicImage = new Image("image");
>> dynamicImage.add(new AttributeModifier("src", true, new
>> AbstractReadOnlyModel() {
>>
>> private static final long serialVersionUID = 1L;
>>
>> /**
>> * {...@inheritdoc}
>> */
>> �...@override
>> public final Object getObject() {
>> GoogleChart chart = new GoogleChart("http://xxxxxx:xxxx/xxxxx/");
>> String url = chart.getChart ("value", "2009-11-15"," 2009-11-15",
>> "xxxxxxxx", "july", true, false );
>> System.out.println("GETCHART URL: " + url);
>> //String url = "http://xxxxxx/PleaseStandBy.jpg";
>> return url;
>> }
>> }));
>> dynamicImage.setOutputMarkupId(true);
>> add(dynamicImage);
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/Remote-Image-Generation-Null-Pointer-tp26653612p26655670.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]