You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Doug Leeper <do...@yahoo.com> on 2007/10/04 00:15:25 UTC

Missing resource parameters for an Image using a ResourceReference

I am using a ResourceReference to access a SharedResource for an Image.  I am
also passing parameters via a ValueMap to obtain the correct image. 
However, when I look at my URL, the parameters are missing.

I traced it to Image.onComponentTag()

<code>
		final ResourceReference resourceReference = getImageResourceReference();
		if (resourceReference != null)
		{
			localizedImageResource.setResourceReference(resourceReference);
		}
</code>

which calls localizedImageResource.setResourceReference( resourceReference,
null ) and therefore clears the parameters.

So either I am doing this all wrong or this is a bug.  Can someone point the
way for me?

Thanks

- Doug

BTW...in Image constructor, I am doing the following:

<code>
	public HoleImage( String id, Long golfCourseId, int holeNo ) {
		super( id );
		
		ResourceReference ref = new ResourceReference(MyOwnGolfApplication.class,
"holeOverviewImage");
		
		ValueMap map = new ValueMap();
		
		map.add( "golfCourseId", golfCourseId.toString() );
		map.add( "holeNumber", String.valueOf( holeNo ));
		
		setImageResourceReference( ref, map );
	}
</code>




-- 
View this message in context: http://www.nabble.com/Missing-resource-parameters-for-an-Image-using-a-ResourceReference-tf4564719.html#a13029039
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Missing resource parameters for an Image using a ResourceReference

Posted by Doug Leeper <do...@yahoo.com>.
BTW...if I change LocaledImageResource.setResourceReference(
ResourceReference ref ) to the following:


	public final void setResourceReference(final ResourceReference
resourceReference)
	{
		setResourceReference(resourceReference, resourceParameters);
	}

Everything works as expected.

Another possible solution would be to expose the parameters in
LocalizedResourceReference (get/set)Parameters.  Then the change could be
limited to Image.onComponentTag()

		final ResourceReference resourceReference = getImageResourceReference();
		if (resourceReference != null)
		{
			localizedImageResource.setResourceReference(resourceReference,
localizedImageResource.getParameters());
		}

BTW...I filed a bug report for this issue 
https://issues.apache.org/jira/browse/WICKET-1039 WICKET-1039 
-- 
View this message in context: http://www.nabble.com/Missing-resource-parameters-for-an-Image-using-a-ResourceReference-tf4564719.html#a13029367
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org