RE: contributing external javascript resources
That's the correct way to reference external resources (prior to Wicket 6). Wicket will just include a script tag in your HeaderResponse container. This looks like it might be an issue related to the way you initialize the google maps API. This stackoverflow comment suggests a possible solution (http://stackoverflow.com/questions/7811985/warning-a-call-to-document-write-from-an-asynchronously-loaded-external-scrip#comment13842467_7812160). Thanks, -David Phillips -Original Message- From: mlabs [mailto:mlabs@gmail.com] Sent: Monday, August 06, 2012 9:55 PM To: users@wicket.apache.org Subject: contributing external javascript resources I have a page that renders a googleapi map in a wicket panel. Works great. I thought I would optimize things a bit by having the panel contribute the googleapi javascript reference to the header, instead of having it permanently referenced in the page header irrespective of whether the map panel is visible or not... so I override renderHead() in my panel like so: public void renderHead(IHeaderResponse response){ response.renderJavascriptReference(http://maps.googleapis.com/maps/api/js?sensor=false;, gmap-api); } however, this doesn't work.. and in the browser javascript debugger I see this: Warning: A call to document.write() from an asynchronously-loaded external script was ignored. Source File: http://maps.googleapis.com/maps/api/js?sensor=false Q:what is the correct way to contribute external javascript references to the header? TIA -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/contributing-external-javascript-resources-tp4651029.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
pivot table for wicket
Hi I implemented a simple pivot table for wicket that can be found at https://github.com/decebals/wicket-pivot Best regards, Decebal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/pivot-table-for-wicket-tp4651031.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: pivot table for wicket
Great! Always a very useful component! Tom On 7-8-2012 9:46, Decebal Suiu wrote: Hi I implemented a simple pivot table for wicket that can be found at https://github.com/decebals/wicket-pivot Best regards, Decebal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/pivot-table-for-wicket-tp4651031.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form
If I use an AjaxLink instead of an AjaxButton I still get the same behaviour. The values in the form are not reset when clicking the Cancel link/button. My form has a CompoundPropertyModel and just three TextFields. Each TextField has an AjaxFormComponentUpdatingBehavior for validation on event onchange. The Cancel AjaxLink should reset (and disable) the form but stay on the same page. Now what I get is this: if the user changes a value and it is valid, the underlying model get's updated. Clicking Cancel afterwards does not reset the changed value back to the original value. If I remove the AjaxFormComponentUpdatingBehavior Cancel AjaxLink works as expected. I am looking for a way to have the Cancel link and still keep the AjaxFormComponentUpdatingBehavior. 2012/8/6 Bertrand Guay-Paquet ber...@step.polymtl.ca Hi, form.clearInput() only clears the raw input (what is received in the current request) of the form components. That is, it doesn't modify the underlying models. With setDefaultFormProcessing(**false), this means that your FormComponent models are not updated at all. The AjaxFormComponentUpdatingBehav**ior should only be triggered when input changes on the text fields. It plays no part otherwise when clicking a button. As a sidenote, why do you use a Button? This component causes the form to be submitted but apparently you don't need the values for this action. A link would save a bit of processing and transfer. Bertrand On 06/08/2012 12:33 PM, heapifyman wrote: Hello, I've been struggling for a while now with a problem that a Cancel AjaxButton (with setDefaultFormProcessing(**false)) calling form.clearInput() would not reset my form to original values. The problem seems to be that I have AjaxFormComponentUpdatingBehav**ior (onchange event) for validation added to a few Textfields of the form. Am I right, that the behaviour updates the model and thus the Cancel button cannot restore the original value? And if that really is the problem, is there a best practice how to combine the two functionalities? Thanks in advance. --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form
The primary nature of the AjaxFormComponentUpdatingBehavior is to validate the input and update the model. If you are looking to do the validation piece without updating the model, you probably want to use an AjaxEventBehavior instead. In onEvent you can then call inputChanged and validate directly on the component without calling updateModel. Thanks, -David Phillips -Original Message- From: heapifyman [mailto:heapify...@gmail.com] Sent: Tuesday, August 07, 2012 5:07 AM To: users@wicket.apache.org Subject: Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form If I use an AjaxLink instead of an AjaxButton I still get the same behaviour. The values in the form are not reset when clicking the Cancel link/button. My form has a CompoundPropertyModel and just three TextFields. Each TextField has an AjaxFormComponentUpdatingBehavior for validation on event onchange. The Cancel AjaxLink should reset (and disable) the form but stay on the same page. Now what I get is this: if the user changes a value and it is valid, the underlying model get's updated. Clicking Cancel afterwards does not reset the changed value back to the original value. If I remove the AjaxFormComponentUpdatingBehavior Cancel AjaxLink works as expected. I am looking for a way to have the Cancel link and still keep the AjaxFormComponentUpdatingBehavior. 2012/8/6 Bertrand Guay-Paquet ber...@step.polymtl.ca Hi, form.clearInput() only clears the raw input (what is received in the current request) of the form components. That is, it doesn't modify the underlying models. With setDefaultFormProcessing(**false), this means that your FormComponent models are not updated at all. The AjaxFormComponentUpdatingBehav**ior should only be triggered when input changes on the text fields. It plays no part otherwise when clicking a button. As a sidenote, why do you use a Button? This component causes the form to be submitted but apparently you don't need the values for this action. A link would save a bit of processing and transfer. Bertrand On 06/08/2012 12:33 PM, heapifyman wrote: Hello, I've been struggling for a while now with a problem that a Cancel AjaxButton (with setDefaultFormProcessing(**false)) calling form.clearInput() would not reset my form to original values. The problem seems to be that I have AjaxFormComponentUpdatingBehav**ior (onchange event) for validation added to a few Textfields of the form. Am I right, that the behaviour updates the model and thus the Cancel button cannot restore the original value? And if that really is the problem, is there a best practice how to combine the two functionalities? Thanks in advance. --**--**-- --- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscribe@wicket.apache. org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form
On Tue, Aug 7, 2012 at 1:25 PM, Phillips, David david.phill...@usaa.com wrote: The primary nature of the AjaxFormComponentUpdatingBehavior is to validate the input and update the model. If you are looking to do the validation piece without updating the model, you probably want to use an AjaxEventBehavior instead. In onEvent you can then call inputChanged and validate directly on the component without calling updateModel. This wont work because AjaxEventBehavior doesn't send the data, unless you do this manually. The cancel link should just set an empty model object to the form. Thanks, -David Phillips -Original Message- From: heapifyman [mailto:heapify...@gmail.com] Sent: Tuesday, August 07, 2012 5:07 AM To: users@wicket.apache.org Subject: Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form If I use an AjaxLink instead of an AjaxButton I still get the same behaviour. The values in the form are not reset when clicking the Cancel link/button. My form has a CompoundPropertyModel and just three TextFields. Each TextField has an AjaxFormComponentUpdatingBehavior for validation on event onchange. The Cancel AjaxLink should reset (and disable) the form but stay on the same page. Now what I get is this: if the user changes a value and it is valid, the underlying model get's updated. Clicking Cancel afterwards does not reset the changed value back to the original value. If I remove the AjaxFormComponentUpdatingBehavior Cancel AjaxLink works as expected. I am looking for a way to have the Cancel link and still keep the AjaxFormComponentUpdatingBehavior. 2012/8/6 Bertrand Guay-Paquet ber...@step.polymtl.ca Hi, form.clearInput() only clears the raw input (what is received in the current request) of the form components. That is, it doesn't modify the underlying models. With setDefaultFormProcessing(**false), this means that your FormComponent models are not updated at all. The AjaxFormComponentUpdatingBehav**ior should only be triggered when input changes on the text fields. It plays no part otherwise when clicking a button. As a sidenote, why do you use a Button? This component causes the form to be submitted but apparently you don't need the values for this action. A link would save a bit of processing and transfer. Bertrand On 06/08/2012 12:33 PM, heapifyman wrote: Hello, I've been struggling for a while now with a problem that a Cancel AjaxButton (with setDefaultFormProcessing(**false)) calling form.clearInput() would not reset my form to original values. The problem seems to be that I have AjaxFormComponentUpdatingBehav**ior (onchange event) for validation added to a few Textfields of the form. Am I right, that the behaviour updates the model and thus the Cancel button cannot restore the original value? And if that really is the problem, is there a best practice how to combine the two functionalities? Thanks in advance. --**--**-- --- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscribe@wicket.apache. org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form
2012/8/7 Martin Grigorov mgrigo...@apache.org On Tue, Aug 7, 2012 at 1:25 PM, Phillips, David david.phill...@usaa.com wrote: The primary nature of the AjaxFormComponentUpdatingBehavior is to validate the input and update the model. If you are looking to do the validation piece without updating the model, you probably want to use an AjaxEventBehavior instead. In onEvent you can then call inputChanged and validate directly on the component without calling updateModel. This wont work because AjaxEventBehavior doesn't send the data, unless you do this manually. How would I do that? The cancel link should just set an empty model object to the form. What if I'm editing an existing entity that's coming from a database (not creating a new one) and I want to display the original values after clicking Cancel? I assume I have to reload the entity and set it as the model object again? Thanks, -David Phillips -Original Message- From: heapifyman [mailto:heapify...@gmail.com] Sent: Tuesday, August 07, 2012 5:07 AM To: users@wicket.apache.org Subject: Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form If I use an AjaxLink instead of an AjaxButton I still get the same behaviour. The values in the form are not reset when clicking the Cancel link/button. My form has a CompoundPropertyModel and just three TextFields. Each TextField has an AjaxFormComponentUpdatingBehavior for validation on event onchange. The Cancel AjaxLink should reset (and disable) the form but stay on the same page. Now what I get is this: if the user changes a value and it is valid, the underlying model get's updated. Clicking Cancel afterwards does not reset the changed value back to the original value. If I remove the AjaxFormComponentUpdatingBehavior Cancel AjaxLink works as expected. I am looking for a way to have the Cancel link and still keep the AjaxFormComponentUpdatingBehavior. 2012/8/6 Bertrand Guay-Paquet ber...@step.polymtl.ca Hi, form.clearInput() only clears the raw input (what is received in the current request) of the form components. That is, it doesn't modify the underlying models. With setDefaultFormProcessing(**false), this means that your FormComponent models are not updated at all. The AjaxFormComponentUpdatingBehav**ior should only be triggered when input changes on the text fields. It plays no part otherwise when clicking a button. As a sidenote, why do you use a Button? This component causes the form to be submitted but apparently you don't need the values for this action. A link would save a bit of processing and transfer. Bertrand On 06/08/2012 12:33 PM, heapifyman wrote: Hello, I've been struggling for a while now with a problem that a Cancel AjaxButton (with setDefaultFormProcessing(**false)) calling form.clearInput() would not reset my form to original values. The problem seems to be that I have AjaxFormComponentUpdatingBehav**ior (onchange event) for validation added to a few Textfields of the form. Am I right, that the behaviour updates the model and thus the Cancel button cannot restore the original value? And if that really is the problem, is there a best practice how to combine the two functionalities? Thanks in advance. --**--**-- --- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscribe@wicket.apache. org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: MountedMapper and CryptoMapper
Hi Jesse, Thanks for the response. I am using 1.5.4. And I don't have any other IRequestMappers installed. I will say that it doesn't affect other pages. So if I click a link that takes me to another page then it's fine. However, we use bread crumb pages quite a bit so if one page has encryption turned off then that might mean several views for the end-user. Maybe there is a way to redirect to an encrypted mapper after the mountedmapper does it's thing? So if the user types http://server/abc then the mountedmapper would determine which page that is and maybe get cryptomapper to rewrite the url as encrypted and process it from there? Not sure I'm just throwing out ideas. Josh -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/MountedMapper-and-CryptoMapper-tp4651024p4651037.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: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form
The cancel link should just set an empty model object to the form. What if I'm editing an existing entity that's coming from a database (not creating a new one) and I want to display the original values after clicking Cancel? I assume I have to reload the entity and set it as the model object again? Yes. You also have to add the form to the ajax target for it to be re-rendered with the original values. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ConversionException when wanting to cancel validation
Hi all Wicket users, I've ran into a feature where I can't stop validation without a crash, or I have to remove my converter. I have some kind of wizard, and with option that where ever you click, data will be tried to save. This means: all links are submitlinks, and if possible, save the new value in the form model before navigation. If you choose to go back a step, validation is not needed. (of course one step further I need validation) This works nice, except if the form contains errors. You can stop this by calling Session.get().cleanupFeedbackMessages();. Now the feedback is gone and navigation will continue. But when I have a number field type Integer, and fill in 12314567890123456789 (too big, I know), I get a crash because of the ConversionException, created by the IntegerConverter on setObject of my number field. I'd like to have this field left un-updated, but whatever I try (e.g. catch the exception on setObject(..))... ór I get a crash on going back in the wizard, ór in some way my validation is not going well when wanting to continue the wizard. I'd like to achieve: when you go back some steps: save what we can save, no blocking validation or uncaught exception; and when continuing the wizard: normal Wicket behavior. Do you know these issues, which you said '2 hours work', and after a day still it's no good? ;( Use: Wicket 1.5.6 Best regards, Jeroen v. Dijk
Re: MountedMapper and CryptoMapper
I think what I am going to do is have a mounted page called AbcMountedPage that throws a RestartResponseAtInterceptPageException so that it redirects to AbcPage. That way AbcPage will be handled by CryptoMapper. I've also noticed that there is a RedirectPage. I could extend that I suppose. It's not perfect but it's not that bad either. Thanks for your help. Josh -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/MountedMapper-and-CryptoMapper-tp4651024p4651040.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: Editing list in Dataview
You don't have to have Spring to do this one table, it just makes it easier to do many more like really fast in the future. It is more scalable. The Dataview and ListView components are just the UI component(the view). So your query won't have to change. The main thing that will change is how you feed the data returned by your query to the view. So for ListView you are either using a List or a IModel to feed it data. With a Dataview you will have to implement IDataProvider to feed it data. If your query is handling pagination right now then you are good, however if it isn't then here is something to consider. You can still have paging without modifying the query but if you do that then that means the query will return all records, and you will be filtering your results down inside your java code. A lot of my Dataviews do that because the result sets are small enough, however if you have very large result sets then you might consider incorporating paging into your query. Josh -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Editing-list-in-Dataview-tp4650885p4651041.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
dynamic control of location of panels on page
Let's say we want to have a number of widgets on the page. But we want to be able to dynamically define what widgets are shown, and in what order they appear on the page. So I can create a bunch of panels, each with their own html, and add those panels to a container to display on the screen. But how do I control the order of them? If I put them in a list, will they be drawn in the order they were added to the list? I'm following this example: https://cwiki.apache.org/WICKET/page-with-dynamic-components.html wicket dynamic content Will this type of solution work even if the widgets are of different widths? Can we still control the layout in the html if we never know what widgets are shown? I hope I explained it properly. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-control-of-location-of-panels-on-page-tp4651043.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: dynamic control of location of panels on page
Well, if you use a repeater it will go through its model in the order you added the items to it. If you want to control where on the page they go, then you would need some kind of dynamic template or overlay. For that I used HTML tables with North, South, Center, East, West table cells and I add the container to all 5 cells but hide the ones that I don't want to see. It's a bit extensive as the page map grows, but it works and it should be okay to get you started on a better solution :) For some other dynamic components I used Velocity as their template: http://en.wikipedia.org/wiki/Apache_Velocity This is the Wicket project on it: http://wicket.apache.org/learn/projects/velocity.html ~ Thank you, Paul Bors -Original Message- From: oggie [mailto:gog...@gmail.com] Sent: Tuesday, August 07, 2012 4:01 PM To: users@wicket.apache.org Subject: dynamic control of location of panels on page Let's say we want to have a number of widgets on the page. But we want to be able to dynamically define what widgets are shown, and in what order they appear on the page. So I can create a bunch of panels, each with their own html, and add those panels to a container to display on the screen. But how do I control the order of them? If I put them in a list, will they be drawn in the order they were added to the list? I'm following this example: https://cwiki.apache.org/WICKET/page-with-dynamic-components.html wicket dynamic content Will this type of solution work even if the widgets are of different widths? Can we still control the layout in the html if we never know what widgets are shown? I hope I explained it properly. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-control-of-location-of-pa nels-on-page-tp4651043.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org