Problem when adding component with PackagedResourceReference during submit

2013-10-21 Thread britter
Hi,

I'm having a problem with a component that uses a PackagedResourceReference.
Here is the setup:

I'm using Wicket 1.5.10 with wiquery 1.5.7. I've extended DatePickerT to
add a custom image fur the widget. The relevant part f the constructor looks
like this:

PackageResourceReference pcgRef = new
PackageResourceReference(BrDatePickerField.class, calendar.gif);
String url = urlFor(pcgRef, null).toString();
setButtonImage(url);

Now I'm using the BrDatePickerField in a RepeatingView. It is used for users
to submit cost points. For example On Jan/31/2013: 34,23$. This view has a
button that adds additional rows. The button just adds a new item to the
list that is shown by the RepeatingView.
When the View is rendered initially the calendar.gif shows up correctly for
all rows that have already been added to the data store:
../resource/com.mypackage.wutils.BrDatePickerField/calendar-ver-1378812639389.gif

However, if I add a new row the icon will not show up in the new row. The
url for the new row is:
./resource/de.brunata.online.wutils.BrDatePickerField/calendar-ver-1378812639389.gif

I believe this has something to do with the request URL, because I know that
the UrlRender uses the client Url somewhere. If I debug the constructor of
the BrDatePickerField, I can see that in the inital call 
getRequest().getClientUrl() =
wicket/bookmarkable/com.mypackage.PageThatUsesBrDatePickerField

If I press the add Row button it will become:
getRequest().getClientUrl() = wicket/page?15-1.IFormSubmitListener-fHnKosten

I have already tried to use a context relative resource, but this doesn't
help. I've also tried to hack the constructor of the BrDatePickerField by
adding a ../ if it is missing, but this will break the icon on other pages.
Can anybody help here?

TIA!

Benedikt



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-when-adding-component-with-PackagedResourceReference-during-submit-tp4661896.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Problem when adding component with PackagedResourceReference during submit

2013-10-21 Thread britter
Hello Martin,

thanks for your reply. The setButtonImage method is defined in
org.odlabs.wiquery.ui.datepicker.DatePickerT, see here:
http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePicker.java?r=553

My BrDatePickerField looks something like this:

public class BrDatePickerFieldT extends DatePickerT {

   public BrDatePickerField(String id, IModelT model) {
  super(id, model);
  // do some stuff with model, add validators etc.

  PackageResourceReference pcgRef = new
PackageResourceReference(BrDatePickerField.class, calendar.gif);
  String url = urlFor(pcgRef, null).toString();
  setButtonImage(url); // inherited from DatePickerT
   }

}

Now I've just realized, that the hole process of adding new rows to the view
is implemented manually. I guess I'll have to change this so that a
RefeshingView is used. If this doesn't work, I'll come back here.

Thanks!
Benedikt



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-when-adding-component-with-PackagedResourceReference-during-submit-tp4661896p4661900.html
Sent from the Users forum mailing list archive at Nabble.com.

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