Hi, This is improved in Wicket 6. You can use org.apache.wicket.protocol.http.WebApplication#addResourceReplacement for exactly this use case. See http://wicketinaction.com/2012/07/wicket-6-resource-management/ You are recommended to upgrade your application.
On Thu, Feb 14, 2013 at 1:39 AM, Evan Sable <e...@novelution.com> wrote: > Hi, > > I'm working on a project that's on wicket 1.4. It's using > the MultiFileUploadField class. I see in the code for that class that in > renderHead, it calls: > response.renderJavascriptReference(JS); > and earlier it defines: > private static final ResourceReference JS = new > JavascriptResourceReference( > MultiFileUploadField.class, "MultiFileUploadField.js"); > > But, I'd like to make a minor modification to the actual javascript in > MultiFileUploadField.js. Specifically, I want to modify that code to > remove the "c:/fakepath" prefix that appears in the box with the list of > selected files below the field (in chrome and safari - not a problem in > firefox and ie). If I could just over-ride the javascript contents of that > file, it would be an easy fix. But, more generally, I'd like to know not > just for this specific issue, is there a "wicket way" to override the > packaged javascript resource that comes with a component? Perhaps is there > a simple way to extend the MultiFileUploadField class with my own class, > and somehow keep the rest of the code as is, but specify an alternate > resource? It's private in that class, so I don't see how I'd do this, but > maybe I'm missing something obvious. Or maybe is there some way to keep > using the same class but to tell the application that I want to replace the > corresponding javascript file with my own? Or is there some other approach > I should be taking when this type of issue comes up? > > Thanks very much for any advice, > -Evan > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>