RE: message internationalization

2011-12-05 Thread Wilhelmsen Tor Iver
> The label components are not refreshed after changing locale. Do you know > why. My guess is that the labels are not using a Locale-aware model like ResourceModel, but instead have been set using construction-time getString() or the like. > Another problem is that when I change the locale I

Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Brian Mulholland
As a Wicket neophyte myself I can't comment on most of this, but we did just look deeply into the notion of subclassing components for the purpose of making them render as rich text widgets from ExtJS. Having just done that I will say that there are ALOT of little hidden nits and difficulties that

Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Martin Grigorov
Hi, On Mon, Dec 5, 2011 at 1:23 PM, Brian Mulholland wrote: > As a Wicket neophyte myself I can't comment on most of this, but we > did just look deeply into the notion of subclassing components for the > purpose of making them render as rich text widgets from ExtJS.  Having > just done that I wi

Re: Internationalization on panels

2011-12-05 Thread cosmindumy
I solved the localization for most of the components except one. This is BeatyTipBehavior This is the code: sourceLanguageTooltip = new Label("sourceLanguageTooltip"); BeautyTipBehavior behavior = new BeautyTipBehavior(new ResourceModel("baloise.order.create.ordercreate.sourcelanguagetoolti

Re: Internationalization on panels

2011-12-05 Thread Martin Grigorov
Hi, How do you use the resource model in this behavior ? On Mon, Dec 5, 2011 at 1:36 PM, cosmindumy wrote: > I solved the localization for most of the components except one. This is > BeatyTipBehavior > This is the code: > sourceLanguageTooltip = new Label("sourceLanguageTooltip"); >        Beau

Re: Internationalization on panels

2011-12-05 Thread cosmindumy
I'm afraid I don't understand your question? What do you mean by "how do you use ResourceModel" ? Actually I have a class LTooltipBehavior that extends BeautyTipBehavior, but i alson tried with BeautyTipBehavior as you saw in the example and it didn't work. Here is the original code: targetLangua

Re: Internationalization on panels

2011-12-05 Thread Martin Grigorov
Paste the code of the behavior. I want to see what you do with the model inside. Use any pastebin service to paste the code because it is easier to read formatted and highlighted code ;-) On Mon, Dec 5, 2011 at 1:48 PM, cosmindumy wrote: > I'm afraid I don't understand your question? What do you

Re: Internationalization on panels

2011-12-05 Thread cosmindumy
Here is the class: http://www.heypasteit.com/clip/04FA But I don't use the model inside. I just pass it to superclass. Anyway it didn't work with their BeautyTipBehavior, so it should't be a problem with my Behavior. But you can take a look. -- View this message in context: http://apache-wicket.

Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Brian Mulholland
> I'm not sure what exactly you tried but here is how I'd approach it: > - create a Wicket component that purpose is to render just the HTML > needed by the ExtJS component > e.g. > for this simple HTML snipper you can just use WebMarkupContainer, but > for something more complex you'll need your

Re: Internationalization on panels

2011-12-05 Thread cosmindumy
Just as a remar, the following code works, but the tooltip is not refreshed after I change locale: Label phoneTooltip = new Label("phoneTooltip"); phoneTooltip.add(new LTooltipBehavior(new Model(getString("baloise.settings.userdetails.phonetooltip"))).setFadeInOut(true)); -- View this mes

Re: Internationalization on panels

2011-12-05 Thread Martin Grigorov
Re-read the wiki page about dynamic models, then read what Igor pasted in his response and I'm sure you'll find the solution. On Mon, Dec 5, 2011 at 2:07 PM, cosmindumy wrote: > Just as a remar, the following code works, but the tooltip is not refreshed > after I change locale: > > Label phoneToo

Re: Form Submit components

2011-12-05 Thread cheesus
Hmm, "change all under wicket.markup.html.navigation.paging to use SubmitLink instead of Link" sounds easier than it is. Really, nobody has a pointer to a solution for "submit form upon table navigation" ? Cheers, Tom. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/F

Re: Form Submit components

2011-12-05 Thread Martin Grigorov
On Mon, Dec 5, 2011 at 2:29 PM, cheesus wrote: > Hmm, "change all under wicket.markup.html.navigation.paging > to use SubmitLink instead of Link" sounds easier than it is. What is hard with it ? > Really, nobody has a pointer to a solution for "submit form upon table > navigation" ? Contributio

Re: Re: DataTable and FilterToolbar

2011-12-05 Thread cheesus
To follow up that old post of mine, the solution is of course to add a "default button", and if we don't have one, but need one, we make it invisible: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataTable-Multiple-Filter-and-OrderSubmittingLink-tp3520329p416045

Re: Internationalization on panels

2011-12-05 Thread cosmindumy
Thanks. :* I subcalssed the Model. It works. I understand now exactly the difference between static and dynamic models. But as I know ResourceModel is a dynamic model. Why it didn't find the key? And why for other components it worked and for BeatyTipBehavior it didn't work? I didn't find an expl

Re: Internationalization on panels

2011-12-05 Thread Martin Grigorov
The only reason I can see is that your .properties file (the resource bundle) is next to a Component (e.g. MyPage.properties). If the translation is in MyApplication.properties then it will work. On Mon, Dec 5, 2011 at 2:38 PM, cosmindumy wrote: > Thanks. :* > I subcalssed the Model. It works. I

Re: Form Submit components

2011-12-05 Thread cheesus
Martin Grigorov-4 wrote > > What is hard with it ? > Well, it would have been a lot easier if "SubmitLink" were a "Link" ;-) ... Well, I have it running now, with a solution looking roughly like... > Really, nobody has a pointer to a solution for "submit form upon table > navigation" ? Marti

Re: Form Submit components

2011-12-05 Thread Martin Grigorov
On Mon, Dec 5, 2011 at 5:53 PM, cheesus wrote: > > Martin Grigorov-4 wrote >> >> What is hard with it ? >> > Well, it would have been a lot easier if "SubmitLink" were a "Link" ;-) If there is no ticket in Jira then we cannot know about this problem and fix it. Ticket + patch would be awesome! :-

1.5 Printing Markup

2011-12-05 Thread Ben Tilford
Has something changed where WicketTester.getResponse().getDocument() no longer contains the generated markup? I'm getting empty strings for any component started through the tester. Stepping through with the debugger it does resolve the associated markup correctly it just never gets added to the re

Re: 1.5 Printing Markup

2011-12-05 Thread Martin Grigorov
Use org.apache.wicket.util.tester.BaseWicketTester.getLastResponseAsString() The difference is in #getLastResponse() vs. getResponse() (for the next request/response) On Mon, Dec 5, 2011 at 6:11 PM, Ben Tilford wrote: > Has something changed where WicketTester.getResponse().getDocument() no > lo

urlFor()

2011-12-05 Thread John Toncart
Hi guys, with 1.4 I was doing: ResourceReference resourceImg = new ResourceReference(name + ".jpg"); String urlString = RequestCycle.get().urlFor(imageResource).toString(); Now with 1.5 I can't do this, not know where is problem. Does anyone know how to do this in 1.5 please? John ---

RE: best way to accommodate dynamic properties

2011-12-05 Thread Daniel Watrous
I'm still trying to figure this out. I would like to be able to do something like the following: HTML: JAVA: public class ImageTestPage extends WebPage{ public ImageTestPage() { Image myImg = new Image("testimage"); myImg.setUrlForImageSrc("http://path/to/image.gif";);

Re: urlFor()

2011-12-05 Thread Martin Grigorov
org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String) 2011/12/5 John Toncart : > Hi guys, > > with 1.4 I was doing: > ResourceReference resourceImg = new ResourceReference(name + ".jpg"); > String urlString = RequestCycle.get().urlFor(imageResource).toString(

Re: best way to accommodate dynamic properties

2011-12-05 Thread Martin Grigorov
class MyImage extends WebComponent { public void onComponentTag(ComponentTag tag) { tag.put("src", url); ... } } On Mon, Dec 5, 2011 at 7:16 PM, Daniel Watrous wrote: > I'm still trying to figure this out. I would like to be able to do something > like the following: > > HTML: > >

Re: best way to accommodate dynamic properties

2011-12-05 Thread John Toncart
I think you can't do this without markup. Put in DB binary data, width and height and pul it out then and with this data modify markup. If image doesn't have exif data you don't know dimensions (I think...) Daniel Watrous wrote: I'm still trying to figure this out. I would like to be able to

Re: Using Property Resolver

2011-12-05 Thread Igor Vaynberg
as long as you are in a wicket thread you should be, see how the property model does it. -igor On Mon, Dec 5, 2011 at 10:05 AM, anantasthana wrote: > I want to be able to do some thing similar to what a property model does in > the sense that we give the property model an object and field and it

Re: urlFor()

2011-12-05 Thread John Toncart
PackageResourceReference resourceImg = new PackageResourceReference(name + ".jpg"); String urlString = RequestCycle.get().urlFor(imageResource).toString(); gives me error: The method urlFor(IRequestHandler) in the type RequestCycle is not applicable for the arguments (PackageResourceReference)

Re: best way to accommodate dynamic properties

2011-12-05 Thread Igor Vaynberg
class myimage extends image { oncomponenttag(tag) { Integer width=getImageWidth(); Integer height=getImageHeight(); if (width!=null) tag.put("width", width); if (height!=null) tag.put("height", height); }} -igor On Mon, Dec 5, 2011 at 10:20 AM, John Toncart wrote: > I

Re: urlFor()

2011-12-05 Thread Martin Grigorov
Why don't use an IDE. It gives you the method signature and even suggests fixes: RequestCycle.get().urlFor(imageResource, null).toString(); On Mon, Dec 5, 2011 at 7:26 PM, John Toncart wrote: > PackageResourceReference resourceImg = new PackageResourceReference(name + > ".jpg"); > String urlStri

Re: urlFor()

2011-12-05 Thread Igor Vaynberg
urlfor(new ResourceReferenceRequestHandler(ref)) -igor On Mon, Dec 5, 2011 at 10:26 AM, John Toncart wrote: > PackageResourceReference resourceImg = new PackageResourceReference(name + > ".jpg"); > String urlString = RequestCycle.get().urlFor(imageResource).toString(); > > gives me error: > The

Re: urlFor()

2011-12-05 Thread Igor Vaynberg
actually, request handler has: public final CharSequence urlFor(ResourceReference reference, PageParameters params) -igor On Mon, Dec 5, 2011 at 10:29 AM, Igor Vaynberg wrote: > urlfor(new ResourceReferenceRequestHandler(ref)) > > -igor > > On Mon, Dec 5, 2011 at 10:26 AM, John Toncart wrote: >

Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Andrei Voden
I think using String.format for that is breaking idea of MVC where you endup writing JScript code in Java. Sounds really awkward. I guess I can hookup Velocity or Freemarker but isnt whole point of Wicket is to replace that? Plus another problem I see is if I have to use separate templates for each

Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Martin Grigorov
On Mon, Dec 5, 2011 at 7:52 PM, Andrei Voden wrote: > I think using String.format for that is breaking idea of MVC where you > endup writing JScript code in Java. Sounds really awkward. > I guess I can hookup Velocity or Freemarker but isnt whole point of Wicket > is to replace that? you asked "h

IRequestMapper that ignores page version

2011-12-05 Thread Allen Gilbert
Hello, I have a problem similar to the one outlined here: http://apache-wicket.1842946.n4.nabble.com/Migrating-from-1-4-16-to-1-5-RC3-problem-when-trying-to-avoid-pages-caching-not-calling-the-construc-td3463183.html. I have a page that uses a lot of Ajax (and is thus stateful/versioned), but I ne

Re: urlFor()

2011-12-05 Thread John Toncart
Martin, mea culpa, I overlook PageParams in urlFor(). Thanks for your hint. Martin Grigorov wrote: Why don't use an IDE. It gives you the method signature and even suggests fixes: RequestCycle.get().urlFor(imageResource, null).toString(); On Mon, Dec 5, 2011 at 7:26 PM, John Toncart wrote:

Re: IRequestMapper that ignores page version

2011-12-05 Thread Martin Grigorov
Hi, Here is an idea (again from me:-) ): Override MountedMapper and in #mapRequest(Request) do: if (((WebRequest) request).isAjax()) return super.mapRequest(request); // else url = request.getUrl(); info = getPageComponentInfo(url); if (info != null) url.removeQueryParam(info.toString()); retu

Model Not Updated for Empty Fields

2011-12-05 Thread Richard W. Adams
For some reason my data model is not being updated when I completely erase an input text field. I'm submitting the form via an AjaxSubmitLink, and the model shows changes to the contents when there ARE contents. And the model correctly shows changes to the field contents when I change the con

Re: Model Not Updated for Empty Fields

2011-12-05 Thread Jeremy Thomerson
On Mon, Dec 5, 2011 at 4:31 PM, Richard W. Adams wrote: > For some reason my data model is not being updated when I completely > erase an input text field. > > I'm submitting the form via an AjaxSubmitLink, and the model shows > changes to the contents when there ARE contents. And the model cor

CSRF protection and preserving page mount names

2011-12-05 Thread Dan Alvizu
Hello, I'm migrating from wicket 1.4 to 1.5 and I am looking to port the cross site request forgery (CSRF) protection from wicket 1.4. In 1.4, the recommended way[1] is to use CryptedUrlWebRequestCodingStrategy: // MyWebApplication.java @Override protected IRequestCycleProcessor newRequ

ConcurrentModificationException

2011-12-05 Thread Fang Lin
When clicking on a link (i.e., ?5-1.ILinkListener-...) after a session expired, this error page shows up on my browser window: Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.util.ConcurrentModificatio

Re: IRequestMapper that ignores page version

2011-12-05 Thread Allen Gilbert
Martin, I had to modify your example to get it to work, as request.getUrl() actually returns a new Url instance when it's called. Here's what I settled on: @Override public IRequestHandler mapRequest(Request request) { Request requestToMap = request; if ((request instanceof WebRequest) && !((Web

Hide page version query parameters

2011-12-05 Thread Allen Gilbert
Is there a built-in way to hide page version parameters (e.g. ?12) in Wicket 1.5? If not, is it possible to write a custom IRequestMapper that does so without screwing up proper request handling? -Allen

Re: ConcurrentModificationException

2011-12-05 Thread Martin Grigorov
Hi, I don't see how this may happen. The execution of RequestCycle is single threaded. Do you have RequestCycleListener or something similar where you start another thread and you use the same instance of RequestCycle ? On Tue, Dec 6, 2011 at 2:31 AM, Fang Lin wrote: > When clicking on a link (i