[SOLVED] Re: PropertyModel / PropertyResolver / Map or List access
Hi Sven, Hi Paul, thanx, now its working. I thought the PropertyModel/PropertyResolver will unpack the model-object itself, so there is no need to adress getObject by .object. Maybe a small note in javadoc could help others not running into this issue. So... All ways (mentioned in javadoc) are working, tested: (@Sven: I think you had some typos in your mail, so I will repeat my working tests) new PropertyModel(MyPage.this, list.object[1].anyProperty) new PropertyModel(MyPage.this, list.object.1.anyProperty) new PropertyModel(list, [1].anyProperty) new PropertyModel(list, 1.anyProperty) as well, navigation further, such an expression is working, too. new PropertyModel(list, 1.anyProperty[any-string-key]) Thanx for help... best regards Patrick P.s. Short question for string-key-access on maps. The syntax is quite equal to associative arrays in javascript. I like the way it is in wicket, no need paying attention for additional quotation marks, and its ok for me, but shouldnt it also support new PropertyModel(list, 1.anyProperty['any-string-key'])? Am 06.11.2014 21:01, schrieb Sven Meier: Hi, you're telling PropertyModel to look up property list from MyPage, but list is not a list, it's a model, models don't have a property 1. Use this instead: new Label(myLabel, new PropertyModel(list, [1],anyProperty)) ... or: new Label(myLabel, new PropertyModel(MyPage.this, list.object.[1].anyProperty)) Regards Sven On 11/06/2014 05:03 PM, Patrick Davids wrote: Hi all, the javadoc of PropertyResolver says, map or list access is possible via keys or index. Accessing an map via key is no problem, but I dont get it working for lists and index. for instance: MyPage extends Page{ private IModelListAnything list; public MyPage(IModelListAnything list){ super(); this.list = list; add(new Label(mylabel, new PropertyModel(MyPage.this, list[1].anyProperty))); } } ends up in a Exception like this: Last cause: No get method defined for class: class MyPage$1 expression: 1 I also made a try with list.1.anyProperty. Not working... Any ideas? best regards Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket-Ajax-BaseURL encoding problem when uploading file using ajax
Hi, I have a strange error when uploading file using ajax request. I have a page with parameters whit url like: http://localhost:8080/myapp/customer/id/1234 When I am opening a modal window with upload form the Wicket-Ajax-BaseURL is: customer/id/1234?1 and all links in ajax response are properly constructed, eg.: ../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-140930656.js But when I choose a file and press upload (using AjaxSubmitButton) then in the followed request Wicket-Ajax-BaseURL is encoded like: customer%2Fid%2F1234 so the code inside UrlRenderer.renderRelativeUrl does not find a proper baseUrlSegments so the calculated renderedUrl is wrong. This leads to invalid url paths, eg.: ./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-140930656.js and other errors with resolving urls. I cannot find where this base url can be broken? Maybe the problem is somewhere in my code, but I don't know where to search for this. PS. The same error is in FF and Chrome. Wicket 6.17.0. -- Best regards, Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket-Ajax-BaseURL encoding problem when uploading file using ajax
I think the problem is in POST request when submitting a form. In wicket-ajax-jquery.js wicket-ajax-baseurl parametr is appended to request url. It is encoded using Wicket.Form.encode: form.action = attrs.u + separator + wicket-ajax=truewicket-ajax-baseurl= + Wicket.Form.encode(getAjaxBaseUrl()); After this an url becomes encoded using escaped %2F instead of slashes (eg. customer%2Fid%2F1234). This leads to resolving urls problems, as I have described in my previous post. -- Best regards, Daniel On Fri, Nov 7, 2014 at 1:30 PM, Daniel Stoch daniel.st...@gmail.com wrote: Hi, I have a strange error when uploading file using ajax request. I have a page with parameters whit url like: http://localhost:8080/myapp/customer/id/1234 When I am opening a modal window with upload form the Wicket-Ajax-BaseURL is: customer/id/1234?1 and all links in ajax response are properly constructed, eg.: ../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-140930656.js But when I choose a file and press upload (using AjaxSubmitButton) then in the followed request Wicket-Ajax-BaseURL is encoded like: customer%2Fid%2F1234 so the code inside UrlRenderer.renderRelativeUrl does not find a proper baseUrlSegments so the calculated renderedUrl is wrong. This leads to invalid url paths, eg.: ./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-140930656.js and other errors with resolving urls. I cannot find where this base url can be broken? Maybe the problem is somewhere in my code, but I don't know where to search for this. PS. The same error is in FF and Chrome. Wicket 6.17.0. -- Best regards, Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
CircularDependencyException when upgrading from Wicket 6.9.0 to 6.10.0
Hi there, I’m trying to upgrade some semi-legacy app to the current Wicket version. I discovered that I get a CircularDependencyException when upgrading from 6.9.0 to 6.10.0 without any code changes. I created a quickstart based on Wicket 6.10.0 that throws the exception when opening the home page (when changing to 6.9.0 everything is fine): https://dl.dropboxusercontent.com/u/236111/quickstart.zip The demo app uses some jquery(-ui) resource references and resource replacements. Could someone point me into the right direction maybe? Cheers, -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
hiding a bit of markup
All, I have a little list in HTML: ul lifoo/li libar/li /ul There are some wicket:message tags, but no components on the page. I want only to show the foo list item if the flag variable is set to true. What's the easiest way to do this in Wicket? I've read the documentation on controlling HTML http://wicket.apache.org/guide/guide/keepControl.html. It seems I can use a WebMarkupContainer, but only if I add some extra HTML. Obviously I don't want this: ul div wicket:id=foolifoo/li/div libar/li /ul It seems I can also use a Fragment (which presumably wouldn't require the extra HTML because it would use wicket:fragment, but the constructor for that component requires that I specify the Wicket ID of the container, which doesn't exist. How can I simply reference some piece of HTML so that I can show or hide it based on some flag? Garret
Re: hiding a bit of markup
Haha! OK, this was simple---my brain apparently hasn't got started yet. I can use a WebMarkup container, and I don't have to add any HTML---I can add the wicket:id on the li itself: ul li wicket:id=flagItemfoo/li libar/li /ul Duh! The code looks like this: add(new WebMarkupContainer(flagItem) { @Override public boolean isVisible() { return flag; } }); Happy Friday! Garret P.S. Thanks to the Wicket SourceForge FAQ http://wicket.sourceforge.net/faqs.html#how-hide-markup, even though a bit old, for giving my mind a kick. On 11/7/2014 10:32 AM, Garret Wilson wrote: All, I have a little list in HTML: ul lifoo/li libar/li /ul There are some wicket:message tags, but no components on the page. I want only to show the foo list item if the flag variable is set to true. What's the easiest way to do this in Wicket? I've read the documentation on controlling HTML http://wicket.apache.org/guide/guide/keepControl.html. It seems I can use a WebMarkupContainer, but only if I add some extra HTML. Obviously I don't want this: ul div wicket:id=foolifoo/li/div libar/li /ul It seems I can also use a Fragment (which presumably wouldn't require the extra HTML because it would use wicket:fragment, but the constructor for that component requires that I specify the Wicket ID of the container, which doesn't exist. How can I simply reference some piece of HTML so that I can show or hide it based on some flag? Garret
Re: hiding a bit of markup
Hi Garret, did you try this? ul li wicket:id=foofoo/li libar/li /ul Everything can be a WebMarkupContainer. No need to always use divs or spans. have a nice weekend Patrick Am 07.11.2014 17:32, schrieb Garret Wilson: All, I have a little list in HTML: ul lifoo/li libar/li /ul There are some wicket:message tags, but no components on the page. I want only to show the foo list item if the flag variable is set to true. What's the easiest way to do this in Wicket? I've read the documentation on controlling HTML http://wicket.apache.org/guide/guide/keepControl.html. It seems I can use a WebMarkupContainer, but only if I add some extra HTML. Obviously I don't want this: ul div wicket:id=foolifoo/li/div libar/li /ul It seems I can also use a Fragment (which presumably wouldn't require the extra HTML because it would use wicket:fragment, but the constructor for that component requires that I specify the Wicket ID of the container, which doesn't exist. How can I simply reference some piece of HTML so that I can show or hide it based on some flag? Garret
Re: hiding a bit of markup
Hi garret In onconfigure of your panel, Setvisibility of foo based on flag there. Every time page loads or Ajax includes panel it'll handle the visibility. Adam On Nov 7, 2014 8:33 AM, Garret Wilson gar...@globalmentor.com wrote: All, I have a little list in HTML: ul lifoo/li libar/li /ul There are some wicket:message tags, but no components on the page. I want only to show the foo list item if the flag variable is set to true. What's the easiest way to do this in Wicket? I've read the documentation on controlling HTML http://wicket.apache.org/ guide/guide/keepControl.html. It seems I can use a WebMarkupContainer, but only if I add some extra HTML. Obviously I don't want this: ul div wicket:id=foolifoo/li/div libar/li /ul It seems I can also use a Fragment (which presumably wouldn't require the extra HTML because it would use wicket:fragment, but the constructor for that component requires that I specify the Wicket ID of the container, which doesn't exist. How can I simply reference some piece of HTML so that I can show or hide it based on some flag? Garret
Re: CircularDependencyException when upgrading from Wicket 6.9.0 to 6.10.0
It should be a bug: https://issues.apache.org/jira/browse/WICKET-5752 Hi there, I’m trying to upgrade some semi-legacy app to the current Wicket version. I discovered that I get a CircularDependencyException when upgrading from 6.9.0 to 6.10.0 without any code changes. I created a quickstart based on Wicket 6.10.0 that throws the exception when opening the home page (when changing to 6.9.0 everything is fine): https://dl.dropboxusercontent.com/u/236111/quickstart.zip The demo app uses some jquery(-ui) resource references and resource replacements. Could someone point me into the right direction maybe? Cheers, -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org