RE: stateless pages
setStatelessHint() tells the page to attempt to be stateless, but if any of the components or the behaviors are not stateless than the page will revert back to statefulness. There are several components which have stateless alternatives (StatelessForm and StatelessLink for example), but the very nature of Ajax and it's callback functionality means that the page cannot be stateless. The server must maintain state about the current page for each Ajax request to have the correct starting point. If I may ask, what is it about statefulness that concerns you? Thanks, -David Phillips - USAA -Original Message- From: René Vangsgaard [mailto:rene.vangsga...@gmail.com] Sent: Monday, December 10, 2012 3:29 PM To: users@wicket.apache.org Subject: EXTERNAL: stateless pages I am looking into stateless wicket. Do the setStatelessHint() work as expected? My links are generated correctly, but when the page is rendered a ?#number is rendered - the #number being the normal wicket counter. I read that the presence of this number indicates my page is not stateless. And it is true that any use of Ajax will make a page stateful. On a more general note, I am looking into creating a stateless application, mainly because of scaling. Do you think Wicket will fit, even though I will be using Ajax? I really think the separation of HTML and code, the approach with components and the use of wicket:id is the best, and I have not found it anywhere else. Basically I like Wicket, but do not need the statefulness. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Detecting HTML 5 Features in Wicket
I would suggest taking a look at Modernizr (http://modernizr.com/) for feature detection. Thanks, -David Phillips - USAA -Original Message- From: Corbin, James [mailto:jcor...@iqnavigator.com] Sent: Monday, November 12, 2012 8:40 AM To: users@wicket.apache.org Subject: EXTERNAL: Detecting HTML 5 Features in Wicket Is there any built in support for detecting HTML 5 browser features like Web Storage? If not, what is the recommended approach for doing so? I'm looking for a way to detect support for Web (e.g. Local) Storage, so in cases where the browser's do not support it (e.g., IE7), I can use cookies or some other mechanism instead. Thanks, J.D. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Detecting HTML 5 Features in Wicket
'getBatherExtendedBrowserInfo()' really just builds a small page to test client side settings which posts back the information it's gathered. That page is provided from 'newBrowserInfoPage()' in WebSession. Thus, if you want to plug Modernizr into your session before the page load, you can override this method and provide a custom page which includes Modernizr. Three things to note about this approach. First, you should probably start with just extending the 'BrowserInfoPage' class to get it's built in postback functionality. Second, this callback doesn't trigger until you call 'WebSession.getClientInfo()' for the first time, so make sure that's done before any heavy lifting. Finally, I would suggest embedding Modernizr onto your new page directly instead of linking a JS file. This is mainly to reduce latency overhead from multiple requests. Thanks, -David Phillips - USAA -Original Message- From: Corbin, James [mailto:jcor...@iqnavigator.com] Sent: Monday, November 12, 2012 9:11 AM To: users@wicket.apache.org Subject: EXTERNAL: Re: Detecting HTML 5 Features in Wicket Thanks, I have already. I know how to detect HTML5 features using javascript, just wondered what is the best way to do so from Wicket code. Given your suggestion, how could I use Modernizr to set browser state indicating, for example, that HTML 5 local storage is in fact supported. I'm just not sure how to plug something like this into the initialization of the web application. It would be nice if the gather extended browser info support in Wicket supported these properties. I'm just curious how others have managed to answer the question, Does my browser and version support HTML 5 Local Storage?, from Wicket code. Thanks, J.D. On 11/12/12 7:59 AM, Phillips, David david.phill...@usaa.com wrote: I would suggest taking a look at Modernizr (http://modernizr.com/) for feature detection. Thanks, -David Phillips - USAA -Original Message- From: Corbin, James [mailto:jcor...@iqnavigator.com] Sent: Monday, November 12, 2012 8:40 AM To: users@wicket.apache.org Subject: EXTERNAL: Detecting HTML 5 Features in Wicket Is there any built in support for detecting HTML 5 browser features like Web Storage? If not, what is the recommended approach for doing so? I'm looking for a way to detect support for Web (e.g. Local) Storage, so in cases where the browser's do not support it (e.g., IE7), I can use cookies or some other mechanism instead. Thanks, J.D. - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: EXTERNAL: Migration of generateCallbackScript to Wicket 6
'generateCallbackScript()' was removed, but 'getCallbackScript()' still remains. You can call that to retrieve the necessary scripts, or 'getCallbackFunction()' if you want to generate a full function. If you want to add in additional parameters you can override 'getCallbackUrl()' and return your additional params. Thanks, -David Phillips - USAA -Original Message- From: Adriano dos Santos Fernandes [mailto:asfernan...@gmail.com] On Behalf Of Adriano dos Santos Fernandes Sent: Friday, October 26, 2012 11:36 AM To: wicket-users Subject: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Hi! I'm migrating from Wicket 1.5 to 6, and I have a couple of generateCallbackScript usage that I have no idea what to do. An example: class ToolbarBehaviour extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L; @Override protected void respond(AjaxRequestTarget target) { int itemNumber = getRequest().getRequestParameters().getParameterValue(item).toInt(); ToolItem item = Toolbar.this.registeredItems.get(itemNumber); item.onClick(target); } public CharSequence getAjaxUrl(String params) { return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl() + + params + '); } }; This is an integration with ExtJS toolbar, and getAjaxUrl() isused to build an ajax call in another place. I do also have similar JQueryBehavior's using generateCallbackScript and adding parameters to them. How to code this with Wicket 6? Adriano - 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: EXTERNAL: Migration of generateCallbackScript to Wicket 6
I don't see that API in AbstractAjaxBehavior or AbstractDefaultAjaxBehavior (I'm looking at 6.2). Where is that available? Thanks, -David Phillips - USAA -Original Message- From: Sebastien [mailto:seb...@gmail.com] Sent: Friday, October 26, 2012 1:03 PM To: users@wicket.apache.org Subject: Re: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Hi, If you want to add in additional parameters you can override 'getCallbackUrl()' and return your additional params. Although it's still valid in wicket 6, the best is now to override getCallbackParameters() protected CallbackParameter[] getCallbackParameters() { return new CallbackParameter[] { CallbackParameter.converted(...), CallbackParameter.explicit(...), CallbackParameter.context(...), CallbackParameter.resolved(...) }; } See javadoc for difference between converted, explicit, etc Best regards, Sebastien On Fri, Oct 26, 2012 at 7:52 PM, Phillips, David david.phill...@usaa.comwrote: 'generateCallbackScript()' was removed, but 'getCallbackScript()' still remains. You can call that to retrieve the necessary scripts, or 'getCallbackFunction()' if you want to generate a full function. If you want to add in additional parameters you can override 'getCallbackUrl()' and return your additional params. Thanks, -David Phillips - USAA -Original Message- From: Adriano dos Santos Fernandes [mailto:asfernan...@gmail.com] On Behalf Of Adriano dos Santos Fernandes Sent: Friday, October 26, 2012 11:36 AM To: wicket-users Subject: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Hi! I'm migrating from Wicket 1.5 to 6, and I have a couple of generateCallbackScript usage that I have no idea what to do. An example: class ToolbarBehaviour extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L; @Override protected void respond(AjaxRequestTarget target) { int itemNumber = getRequest().getRequestParameters().getParameterValue(item).toInt(); ToolItem item = Toolbar.this.registeredItems.get(itemNumber); item.onClick(target); } public CharSequence getAjaxUrl(String params) { return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl() + + params + '); } }; This is an integration with ExtJS toolbar, and getAjaxUrl() isused to build an ajax call in another place. I do also have similar JQueryBehavior's using generateCallbackScript and adding parameters to them. How to code this with Wicket 6? Adriano - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: EXTERNAL: Migration of generateCallbackScript to Wicket 6
Ah ok, thanks for the clarification. The parameters in 'getCallbackFunction()' would definitely be a cleaner approach. Thanks, -David Phillips - USAA -Original Message- From: Sebastien [mailto:seb...@gmail.com] Sent: Friday, October 26, 2012 4:50 PM To: users@wicket.apache.org Subject: Re: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Ops, I wrote a mistake: #getCallbackParameters does not exists; it my own method! However, the way to specify/handle callback parameters is still to provide an array of CallbackParameter (wicket-6.x, then) to AbstractDefaultAjaxBehavior#getCallbackFunction() You will find the static methods (context, explicit, resolved context) and their corresponding javadoc in org.apache.wicket.ajax.attributes.CallbackParameter Sorry for the confusion, Sebastien. On Fri, Oct 26, 2012 at 8:18 PM, Phillips, David david.phill...@usaa.comwrote: I don't see that API in AbstractAjaxBehavior or AbstractDefaultAjaxBehavior (I'm looking at 6.2). Where is that available? Thanks, -David Phillips - USAA -Original Message- From: Sebastien [mailto:seb...@gmail.com] Sent: Friday, October 26, 2012 1:03 PM To: users@wicket.apache.org Subject: Re: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Hi, If you want to add in additional parameters you can override 'getCallbackUrl()' and return your additional params. Although it's still valid in wicket 6, the best is now to override getCallbackParameters() protected CallbackParameter[] getCallbackParameters() { return new CallbackParameter[] { CallbackParameter.converted(...), CallbackParameter.explicit(...), CallbackParameter.context(...), CallbackParameter.resolved(...) }; } See javadoc for difference between converted, explicit, etc Best regards, Sebastien On Fri, Oct 26, 2012 at 7:52 PM, Phillips, David david.phill...@usaa.com wrote: 'generateCallbackScript()' was removed, but 'getCallbackScript()' still remains. You can call that to retrieve the necessary scripts, or 'getCallbackFunction()' if you want to generate a full function. If you want to add in additional parameters you can override 'getCallbackUrl()' and return your additional params. Thanks, -David Phillips - USAA -Original Message- From: Adriano dos Santos Fernandes [mailto:asfernan...@gmail.com] On Behalf Of Adriano dos Santos Fernandes Sent: Friday, October 26, 2012 11:36 AM To: wicket-users Subject: EXTERNAL: Migration of generateCallbackScript to Wicket 6 Hi! I'm migrating from Wicket 1.5 to 6, and I have a couple of generateCallbackScript usage that I have no idea what to do. An example: class ToolbarBehaviour extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L; @Override protected void respond(AjaxRequestTarget target) { int itemNumber = getRequest().getRequestParameters().getParameterValue(item).toInt(); ToolItem item = Toolbar.this.registeredItems.get(itemNumber); item.onClick(target); } public CharSequence getAjaxUrl(String params) { return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl() + + params + '); } }; This is an integration with ExtJS toolbar, and getAjaxUrl() isused to build an ajax call in another place. I do also have similar JQueryBehavior's using generateCallbackScript and adding parameters to them. How to code this with Wicket 6? Adriano - 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 - 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: works in ff/chrome/safari but not IE
Also ensure you're using an input tag with type=submit instead of a button tag. IE has several issues handling the button tag. Thanks, -David Phillips -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Saturday, September 01, 2012 12:43 AM To: users@wicket.apache.org Subject: Re: works in ff/chrome/safari but not IE Try with: form.setDefaultButton(theAjaxButton). On Sat, Sep 1, 2012 at 4:40 AM, mlabs mlabs@gmail.com wrote: simple form AjaxButton for the submit button OnSubmit() gets hit in the debugger for FF/chrome/safari, but NOT for IE9 any ideas? TIA -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/works-in-ff-chrome-safari-b ut-not-IE-tp4651682.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 -- 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: 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
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