Re: WML + Wicket experiences?
Must call removeAttribute before calling getSession, otherwise it will just find the old one: Session.unset(); getApplication().getSessionStore().removeAttribute(getRequest(), Session.SESSION_ATTRIBUTE_NAME); //!! getApplication().getSessionStore().setAttribute(getRequest(), Session.SESSION_ATTRIBUTE_NAME, getSession()); try { sessionField.set(getRequestCycle(), getSession()); } catch (Exception e) { throw new RuntimeException(e); } 2009/2/22 Martin Makundi : > Further investigation shows that the wap device is very sensitive to > switching session id on the fly. This might be because it probably > uses url-rewriting AND it does not allow redirect, so it will easily > trigger into wrong session (if changed on the fly). > > Therefore, I changed my old login session swap: > Session.unset(); > getApplication().getSessionStore().removeAttribute(getRequest(), > Session.SESSION_ATTRIBUTE_NAME); > getSession().replaceSession(); > > > into this one: >Session.unset(); >getApplication().getSessionStore().setAttribute(getRequest(), > Session.SESSION_ATTRIBUTE_NAME, getSession()); >try { > sessionField.set(getRequestCycle(), getSession()); >} catch (Exception e) { > throw new RuntimeException(e); >} > > It is a bit of a hack, though, but this preserves the client session id. > > And it appears to work better now. Maybe there is a smoother way to > force new session id without dazzling the wap device? > > ** > Martin > > 2009/2/22 Martin Makundi : >> I am experiencing serious problems with the redirects.. sometimes I >> can browse fine, but at other times the session is abruptedly >> terminated when the wap device fails to handle the redirect. >> >> Did you experience any of these problems, what was your solution? >> >> ** >> Martin >> >> 2009/2/20 Jeremy Thomerson : >>> Yes - that should work. >>> >>> On Thu, Feb 19, 2009 at 5:47 PM, Martin Makundi < >>> martin.maku...@koodaripalvelut.com> wrote: >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
Further investigation shows that the wap device is very sensitive to switching session id on the fly. This might be because it probably uses url-rewriting AND it does not allow redirect, so it will easily trigger into wrong session (if changed on the fly). Therefore, I changed my old login session swap: Session.unset(); getApplication().getSessionStore().removeAttribute(getRequest(), Session.SESSION_ATTRIBUTE_NAME); getSession().replaceSession(); into this one: Session.unset(); getApplication().getSessionStore().setAttribute(getRequest(), Session.SESSION_ATTRIBUTE_NAME, getSession()); try { sessionField.set(getRequestCycle(), getSession()); } catch (Exception e) { throw new RuntimeException(e); } It is a bit of a hack, though, but this preserves the client session id. And it appears to work better now. Maybe there is a smoother way to force new session id without dazzling the wap device? ** Martin 2009/2/22 Martin Makundi : > I am experiencing serious problems with the redirects.. sometimes I > can browse fine, but at other times the session is abruptedly > terminated when the wap device fails to handle the redirect. > > Did you experience any of these problems, what was your solution? > > ** > Martin > > 2009/2/20 Jeremy Thomerson : >> Yes - that should work. >> >> On Thu, Feb 19, 2009 at 5:47 PM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
We used Shrinkray recently. http://www.shrinkraywireless.com/ - Brill On 21-Feb-09, at 5:18 PM, Martin Makundi wrote: I am experiencing serious problems with the redirects.. sometimes I can browse fine, but at other times the session is abruptedly terminated when the wap device fails to handle the redirect. Did you experience any of these problems, what was your solution? ** Martin 2009/2/20 Jeremy Thomerson : Yes - that should work. On Thu, Feb 19, 2009 at 5:47 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: - 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: WML + Wicket experiences?
I am experiencing serious problems with the redirects.. sometimes I can browse fine, but at other times the session is abruptedly terminated when the wap device fails to handle the redirect. Did you experience any of these problems, what was your solution? ** Martin 2009/2/20 Jeremy Thomerson : > Yes - that should work. > > On Thu, Feb 19, 2009 at 5:47 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
More wap trouble. Apparently you must call setRedirect(false) BEFORE invoking setResponsePage.. don't exactly know why, I found no explicit reason. Another problem that popped up is about how to easily make convertToHtmlUnicodeEscapes=true for Labels? XML is strict such that it requires all äöåÄÅÖ and other special characters to be escaped; otherwise it does not validate. Is there any simple way to switch convertToHtmlUnicodeEscapes=true for a label? My 'temporary' solution is to roll-out a hack: public class WapLabel extends Label { /** * @param id * @param model */ public WapLabel(String id, final IModel model) { super(id, new AbstractReadOnlyModel() { @Override public CharSequence getObject() { return Strings.escapeMarkup((String) model.getObject(), false, true); } }); setEscapeModelStrings(false); } /** * @param id * @param label */ public WapLabel(String id, String label) { super(id, (label != null) ? Strings.escapeMarkup(label, false, true).toString() : null); setEscapeModelStrings(false); } /** * @param id */ public WapLabel(String id) { super(id); setEscapeModelStrings(false); } } ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
Dammit.. I found this article: http://www.thewirelessfaq.com/why_does_a_normal_http_302_redirect_not_work_with_wap Talks something about redirects.. so I tried to set setRedirect(false); and it works now. Funny. Since I have hacked rid of 302 redirects because google don't like them: // Force 302 redirect status code into 301 'permanent redirect' Field statusField = HttpStatus.class.getDeclaredField("__responseLine"); statusField.setAccessible(true); Buffer[] responseLine = (Buffer[]) statusField.get(HttpStatus.class); byte[] bytes = responseLine[302].toString().replace("302", "301").getBytes(); responseLine[302] = new ByteArrayBuffer(bytes,0,bytes.length,Buffer.IMMUTABLE); Apparently wap don't like 301's either... or maybe there is something funny in the headers that it don't like. ** Martin 2009/2/20 Martin Makundi : > Hi! > > Currently my problem is that the Nokia3510i simulator does not react > properly to setResponsePage(WapMainPage.class). For some (yet unknown) > reason the requestcycle processes an empty request which results in > PageExpiredException: > > [RequestParameters componentPath=3:loginForm pageMapName=null > versionNumber=0 interfaceName=IFormSubmitListener componentId=null > behaviorId=null urlDepth=-1 parameters={} > onlyProcessIfPathActive=false] > > If I try the same pages with firefox it works fine, the > setResponsePage opens the WapMainPage.wml and it validates just fine. > I am begnnining to pull my hair now ... did you experience anything > like this? > > Here are some of my 'compositions', the login form is processed quite > fine and the session is intialized etc... but the > setResponsePage(WapMainPage.class) after successful login > (loginForm#onSubmit) does not work with the wap simulator: > > ::: > >add(loginForm = new LoginForm(true) { > /** > * @see > org.apache.wicket.markup.html.form.Form#onComponentTagBody(org.apache.wicket.markup.MarkupStream, > org.apache.wicket.markup.ComponentTag) > */ > @Override > protected void onComponentTagBody(MarkupStream markupStream, > ComponentTag openTag) { >renderComponentTagBody(markupStream, openTag); > } >}); >loginForm.setRenderBodyOnly(true); > > > : > > public class WapSubmitComponent extends Button { > private static final long serialVersionUID = 1L; > > /** > * @param id > * @param model > */ > public WapSubmitComponent(String id, IModel model) { >super(id, model); > } > > /** > * @param id > */ > public WapSubmitComponent(String id) { >super(id); > } > > /** > * @see > org.apache.wicket.markup.html.form.Button#onComponentTag(org.apache.wicket.markup.ComponentTag) > */ > @Override > protected void onComponentTag(ComponentTag tag) { >// nothing > } > > /** > * @see > org.apache.wicket.MarkupContainer#onComponentTagBody(org.apache.wicket.markup.MarkupStream, > org.apache.wicket.markup.ComponentTag) > */ > @Override > protected void onComponentTagBody(MarkupStream markupStream, > ComponentTag openTag) { >super.onComponentTagBody(markupStream, openTag); >// Check whether to add tag body >if (getDefaultModelObject() != null) { > getResponse().write(getDefaultModelObject().toString()); >} >getResponse().write("\r\ngetResponse().write(getMethod()); >getResponse().write("\" href=\""); >getResponse().write(getForm().urlFor(IFormSubmitListener.INTERFACE)); >getResponse().write("\">\r\n"); >{ > // Indicate submitting form-component > writePostField(getInputName(), "true"); >} >{ > // Add other enabled form components > final Form wapForm = getForm(); > wapForm.visitFormComponentsPostOrder(new ValidationVisitor() > { >@Override >public void validate(final FormComponent formComponent) >{ > final Form form = formComponent.getForm(); > if (formComponent != WapSubmitComponent.this && form == > wapForm && form.isEnabled() && form.isEnableAllowed() && >form.isVisibleInHierarchy()) { >String name = formComponent.getInputName(); >writePostField(name, "$(" + name + ")"); > } >} > }); >} >getResponse().write("\r\n"); > } > > /** > * > */ > void writePostField(String name, String value) { >getResponse().write(" getResponse().write(name); >getResponse().write("\" value=\""); >getResponse().write(value); >getResponse().write("\"/>\r\n"); > } > > /** > * Gets the HTTP submit method that will appear in form markup. If > no method is specified in the > * template, "post" is the default. Note that the markup-declared > HTTP method may not correspond > * to the one actually used to submit the form; in an Ajax submit, > for example, JavaScript event > * handlers may submit the form with a "get" even when the form > method is declared as "post." > * Therefore t
Re: WML + Wicket experiences?
Hi! Currently my problem is that the Nokia3510i simulator does not react properly to setResponsePage(WapMainPage.class). For some (yet unknown) reason the requestcycle processes an empty request which results in PageExpiredException: [RequestParameters componentPath=3:loginForm pageMapName=null versionNumber=0 interfaceName=IFormSubmitListener componentId=null behaviorId=null urlDepth=-1 parameters={} onlyProcessIfPathActive=false] If I try the same pages with firefox it works fine, the setResponsePage opens the WapMainPage.wml and it validates just fine. I am begnnining to pull my hair now ... did you experience anything like this? Here are some of my 'compositions', the login form is processed quite fine and the session is intialized etc... but the setResponsePage(WapMainPage.class) after successful login (loginForm#onSubmit) does not work with the wap simulator: ::: add(loginForm = new LoginForm(true) { /** * @see org.apache.wicket.markup.html.form.Form#onComponentTagBody(org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { renderComponentTagBody(markupStream, openTag); } }); loginForm.setRenderBodyOnly(true); : public class WapSubmitComponent extends Button { private static final long serialVersionUID = 1L; /** * @param id * @param model */ public WapSubmitComponent(String id, IModel model) { super(id, model); } /** * @param id */ public WapSubmitComponent(String id) { super(id); } /** * @see org.apache.wicket.markup.html.form.Button#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { // nothing } /** * @see org.apache.wicket.MarkupContainer#onComponentTagBody(org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { super.onComponentTagBody(markupStream, openTag); // Check whether to add tag body if (getDefaultModelObject() != null) { getResponse().write(getDefaultModelObject().toString()); } getResponse().write("\r\n\r\n"); { // Indicate submitting form-component writePostField(getInputName(), "true"); } { // Add other enabled form components final Form wapForm = getForm(); wapForm.visitFormComponentsPostOrder(new ValidationVisitor() { @Override public void validate(final FormComponent formComponent) { final Form form = formComponent.getForm(); if (formComponent != WapSubmitComponent.this && form == wapForm && form.isEnabled() && form.isEnableAllowed() && form.isVisibleInHierarchy()) { String name = formComponent.getInputName(); writePostField(name, "$(" + name + ")"); } } }); } getResponse().write("\r\n"); } /** * */ void writePostField(String name, String value) { getResponse().write(" \r\n"); } /** * Gets the HTTP submit method that will appear in form markup. If no method is specified in the * template, "post" is the default. Note that the markup-declared HTTP method may not correspond * to the one actually used to submit the form; in an Ajax submit, for example, JavaScript event * handlers may submit the form with a "get" even when the form method is declared as "post." * Therefore this method should not be considered a guarantee of the HTTP method used, but a * value for the markup only. Override if you have a requirement to alter this behavior. * * @return the submit method specified in markup. */ protected String getMethod() { String method = getMarkupAttributes().getString("method"); return (method != null) ? method : Form.METHOD_POST; } } ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
Yes - that should work. On Thu, Feb 19, 2009 at 5:47 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Maybe I call: > > url = getRequestCycle().urlFor(form, > IFormSubmitListener.INTERFACE).toString() > > ** > Martin > > 2009/2/20 Martin Makundi : > >> Apparently the form urlFor(IFormSubmitListener.INTERFACE) is > >> indifferent to the form id. How does it know which form is submitted > >> if there are two forms on the same page? > > > > Ah.. probably the urlFor does some processing.. I wonder if I can > > transfer this 'capability' onto a component that is not the form > > itself. > > > > ** > > Martin > > > >> > >>> > >>> > >>> > >>> On Thu, Feb 19, 2009 at 5:05 PM, Martin Makundi < > >>> martin.maku...@koodaripalvelut.com> wrote: > >>> > I can actually 'bypass' the form very easily by setting > setRenderBodyOnly(true) and overriding the onComponentTagBody with > renderComponentTagBody(markupStream, openTag); > > My concern is on the processing side. > > How can I trigger/attach a suitable > requestListener/IFormSubmittingComponent? Preferably re-using some > existing component... > > > > > > > > > ** > Martin > > > 2009/2/19 Jeremy Thomerson : > > I've never tried it, but I would suspect that I would start by > creating > > something like: > > > > public class WapForm extends Form { > >protected void onComponentTag(final ComponentTag tag) { > >// copy the code from Form.onComponentTag to here and change > the > > "action" and tag, etc... > >} > > } > > > > Form could also be changed to get the kind of tag and the attribute > name > > ("action" / "href") from a method that could be overridden, but that > would > > require a change to core - this method you can do yourself quickly. > > > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < > > martin.maku...@koodaripalvelut.com> wrote: > > > >> > it's totally possible. did it at a company last year (but that's > >> > proprietary, of course). > >> > >> Cool. Can you give a hint if you could re-use Form components in > Wml? > >> > >> > >> > >> > >> > >> > >> What is the best way to bind href and the postfields with a wicket > >> form? Or should I build a custom 'wap-form' which supports similar > >> validation? > >> > >> ** > >> Martin > >> > >> > > >> > Martin Makundi wrote: > >> >> > >> >> Hi! > >> >> > >> >> There has been some discussion in the past about using Wicket > for > >> >> rendering WML pages: > >> >> http://cwiki.apache.org/WICKET/mobile-devices.html > >> >> > >> >> Is there any such wml+wicket boilerplate/quickstart code > available > out > >> >> there or would someone like to post their experiences? > >> >> > >> >> ** > >> >> Martin > >> >> > >> >> > - > >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> >> For additional commands, e-mail: users-h...@wicket.apache.org > >> >> > >> >> > >> >> > >> > > >> > -- > >> > View this message in context: > >> > > http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html > >> > Sent from the Wicket - User 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 > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > >>> > >>> > >>> -- > >>> Jeremy Thomerson > >>> http://www.wickettraining.com > >>> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Jeremy Thomerson http://www.wickettraining.com
Re: WML + Wicket experiences?
Maybe I call: url = getRequestCycle().urlFor(form, IFormSubmitListener.INTERFACE).toString() ** Martin 2009/2/20 Martin Makundi : >> Apparently the form urlFor(IFormSubmitListener.INTERFACE) is >> indifferent to the form id. How does it know which form is submitted >> if there are two forms on the same page? > > Ah.. probably the urlFor does some processing.. I wonder if I can > transfer this 'capability' onto a component that is not the form > itself. > > ** > Martin > >> >>> >>> >>> >>> On Thu, Feb 19, 2009 at 5:05 PM, Martin Makundi < >>> martin.maku...@koodaripalvelut.com> wrote: >>> I can actually 'bypass' the form very easily by setting setRenderBodyOnly(true) and overriding the onComponentTagBody with renderComponentTagBody(markupStream, openTag); My concern is on the processing side. How can I trigger/attach a suitable requestListener/IFormSubmittingComponent? Preferably re-using some existing component... ** Martin 2009/2/19 Jeremy Thomerson : > I've never tried it, but I would suspect that I would start by creating > something like: > > public class WapForm extends Form { >protected void onComponentTag(final ComponentTag tag) { >// copy the code from Form.onComponentTag to here and change the > "action" and tag, etc... >} > } > > Form could also be changed to get the kind of tag and the attribute name > ("action" / "href") from a method that could be overridden, but that would > require a change to core - this method you can do yourself quickly. > > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> > it's totally possible. did it at a company last year (but that's >> > proprietary, of course). >> >> Cool. Can you give a hint if you could re-use Form components in Wml? >> >> >> >> >> >> >> What is the best way to bind href and the postfields with a wicket >> form? Or should I build a custom 'wap-form' which supports similar >> validation? >> >> ** >> Martin >> >> > >> > Martin Makundi wrote: >> >> >> >> Hi! >> >> >> >> There has been some discussion in the past about using Wicket for >> >> rendering WML pages: >> >> http://cwiki.apache.org/WICKET/mobile-devices.html >> >> >> >> Is there any such wml+wicket boilerplate/quickstart code available out >> >> there or would someone like to post their experiences? >> >> >> >> ** >> >> Martin >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> >> >> > >> > -- >> > View this message in context: >> http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html >> > Sent from the Wicket - User 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> -- >>> Jeremy Thomerson >>> http://www.wickettraining.com >>> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
> Apparently the form urlFor(IFormSubmitListener.INTERFACE) is > indifferent to the form id. How does it know which form is submitted > if there are two forms on the same page? Ah.. probably the urlFor does some processing.. I wonder if I can transfer this 'capability' onto a component that is not the form itself. ** Martin > >> >> >> >> On Thu, Feb 19, 2009 at 5:05 PM, Martin Makundi < >> martin.maku...@koodaripalvelut.com> wrote: >> >>> I can actually 'bypass' the form very easily by setting >>> setRenderBodyOnly(true) and overriding the onComponentTagBody with >>> renderComponentTagBody(markupStream, openTag); >>> >>> My concern is on the processing side. >>> >>> How can I trigger/attach a suitable >>> requestListener/IFormSubmittingComponent? Preferably re-using some >>> existing component... >>> >>> >>> >>> >>> >>> >>> >>> >>> ** >>> Martin >>> >>> >>> 2009/2/19 Jeremy Thomerson : >>> > I've never tried it, but I would suspect that I would start by creating >>> > something like: >>> > >>> > public class WapForm extends Form { >>> >protected void onComponentTag(final ComponentTag tag) { >>> >// copy the code from Form.onComponentTag to here and change the >>> > "action" and tag, etc... >>> >} >>> > } >>> > >>> > Form could also be changed to get the kind of tag and the attribute name >>> > ("action" / "href") from a method that could be overridden, but that >>> would >>> > require a change to core - this method you can do yourself quickly. >>> > >>> > >>> > -- >>> > Jeremy Thomerson >>> > http://www.wickettraining.com >>> > >>> > >>> > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < >>> > martin.maku...@koodaripalvelut.com> wrote: >>> > >>> >> > it's totally possible. did it at a company last year (but that's >>> >> > proprietary, of course). >>> >> >>> >> Cool. Can you give a hint if you could re-use Form components in Wml? >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> What is the best way to bind href and the postfields with a wicket >>> >> form? Or should I build a custom 'wap-form' which supports similar >>> >> validation? >>> >> >>> >> ** >>> >> Martin >>> >> >>> >> > >>> >> > Martin Makundi wrote: >>> >> >> >>> >> >> Hi! >>> >> >> >>> >> >> There has been some discussion in the past about using Wicket for >>> >> >> rendering WML pages: >>> >> >> http://cwiki.apache.org/WICKET/mobile-devices.html >>> >> >> >>> >> >> Is there any such wml+wicket boilerplate/quickstart code available >>> out >>> >> >> there or would someone like to post their experiences? >>> >> >> >>> >> >> ** >>> >> >> Martin >>> >> >> >>> >> >> - >>> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> >> >> For additional commands, e-mail: users-h...@wicket.apache.org >>> >> >> >>> >> >> >>> >> >> >>> >> > >>> >> > -- >>> >> > View this message in context: >>> >> >>> http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html >>> >> > Sent from the Wicket - User 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 >>> >> >>> >> >>> > >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
> Wouldn't you get that automatically using the code I gave below? Form, in > it's onComponentTag, generates a URL that is for submitting the form. So, > if you use that in the href of your go tag, the form should "just work". > I'd think, anyway. Ok. I will have a look at it. I like to use a separate submitting component in order to position the "Submit" link better into the proper place. Apparently the form urlFor(IFormSubmitListener.INTERFACE) is indifferent to the form id. How does it know which form is submitted if there are two forms on the same page? ** Martin > > > > On Thu, Feb 19, 2009 at 5:05 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> I can actually 'bypass' the form very easily by setting >> setRenderBodyOnly(true) and overriding the onComponentTagBody with >> renderComponentTagBody(markupStream, openTag); >> >> My concern is on the processing side. >> >> How can I trigger/attach a suitable >> requestListener/IFormSubmittingComponent? Preferably re-using some >> existing component... >> >> >> >> >> >> >> >> >> ** >> Martin >> >> >> 2009/2/19 Jeremy Thomerson : >> > I've never tried it, but I would suspect that I would start by creating >> > something like: >> > >> > public class WapForm extends Form { >> >protected void onComponentTag(final ComponentTag tag) { >> >// copy the code from Form.onComponentTag to here and change the >> > "action" and tag, etc... >> >} >> > } >> > >> > Form could also be changed to get the kind of tag and the attribute name >> > ("action" / "href") from a method that could be overridden, but that >> would >> > require a change to core - this method you can do yourself quickly. >> > >> > >> > -- >> > Jeremy Thomerson >> > http://www.wickettraining.com >> > >> > >> > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < >> > martin.maku...@koodaripalvelut.com> wrote: >> > >> >> > it's totally possible. did it at a company last year (but that's >> >> > proprietary, of course). >> >> >> >> Cool. Can you give a hint if you could re-use Form components in Wml? >> >> >> >> >> >> >> >> >> >> >> >> >> >> What is the best way to bind href and the postfields with a wicket >> >> form? Or should I build a custom 'wap-form' which supports similar >> >> validation? >> >> >> >> ** >> >> Martin >> >> >> >> > >> >> > Martin Makundi wrote: >> >> >> >> >> >> Hi! >> >> >> >> >> >> There has been some discussion in the past about using Wicket for >> >> >> rendering WML pages: >> >> >> http://cwiki.apache.org/WICKET/mobile-devices.html >> >> >> >> >> >> Is there any such wml+wicket boilerplate/quickstart code available >> out >> >> >> there or would someone like to post their experiences? >> >> >> >> >> >> ** >> >> >> Martin >> >> >> >> >> >> - >> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> >> >> >> >> >> >> > >> >> > -- >> >> > View this message in context: >> >> >> http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html >> >> > Sent from the Wicket - User 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 >> >> >> >> >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > -- > Jeremy Thomerson > http://www.wickettraining.com > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
Wouldn't you get that automatically using the code I gave below? Form, in it's onComponentTag, generates a URL that is for submitting the form. So, if you use that in the href of your go tag, the form should "just work". I'd think, anyway. On Thu, Feb 19, 2009 at 5:05 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > I can actually 'bypass' the form very easily by setting > setRenderBodyOnly(true) and overriding the onComponentTagBody with > renderComponentTagBody(markupStream, openTag); > > My concern is on the processing side. > > How can I trigger/attach a suitable > requestListener/IFormSubmittingComponent? Preferably re-using some > existing component... > > > > > > > > > ** > Martin > > > 2009/2/19 Jeremy Thomerson : > > I've never tried it, but I would suspect that I would start by creating > > something like: > > > > public class WapForm extends Form { > >protected void onComponentTag(final ComponentTag tag) { > >// copy the code from Form.onComponentTag to here and change the > > "action" and tag, etc... > >} > > } > > > > Form could also be changed to get the kind of tag and the attribute name > > ("action" / "href") from a method that could be overridden, but that > would > > require a change to core - this method you can do yourself quickly. > > > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > > > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < > > martin.maku...@koodaripalvelut.com> wrote: > > > >> > it's totally possible. did it at a company last year (but that's > >> > proprietary, of course). > >> > >> Cool. Can you give a hint if you could re-use Form components in Wml? > >> > >> > >> > >> > >> > >> > >> What is the best way to bind href and the postfields with a wicket > >> form? Or should I build a custom 'wap-form' which supports similar > >> validation? > >> > >> ** > >> Martin > >> > >> > > >> > Martin Makundi wrote: > >> >> > >> >> Hi! > >> >> > >> >> There has been some discussion in the past about using Wicket for > >> >> rendering WML pages: > >> >> http://cwiki.apache.org/WICKET/mobile-devices.html > >> >> > >> >> Is there any such wml+wicket boilerplate/quickstart code available > out > >> >> there or would someone like to post their experiences? > >> >> > >> >> ** > >> >> Martin > >> >> > >> >> - > >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> >> For additional commands, e-mail: users-h...@wicket.apache.org > >> >> > >> >> > >> >> > >> > > >> > -- > >> > View this message in context: > >> > http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html > >> > Sent from the Wicket - User 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 > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Jeremy Thomerson http://www.wickettraining.com
Re: WML + Wicket experiences?
I can actually 'bypass' the form very easily by setting setRenderBodyOnly(true) and overriding the onComponentTagBody with renderComponentTagBody(markupStream, openTag); My concern is on the processing side. How can I trigger/attach a suitable requestListener/IFormSubmittingComponent? Preferably re-using some existing component... ** Martin 2009/2/19 Jeremy Thomerson : > I've never tried it, but I would suspect that I would start by creating > something like: > > public class WapForm extends Form { >protected void onComponentTag(final ComponentTag tag) { >// copy the code from Form.onComponentTag to here and change the > "action" and tag, etc... >} > } > > Form could also be changed to get the kind of tag and the attribute name > ("action" / "href") from a method that could be overridden, but that would > require a change to core - this method you can do yourself quickly. > > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> > it's totally possible. did it at a company last year (but that's >> > proprietary, of course). >> >> Cool. Can you give a hint if you could re-use Form components in Wml? >> >> >> >> >> >> >> What is the best way to bind href and the postfields with a wicket >> form? Or should I build a custom 'wap-form' which supports similar >> validation? >> >> ** >> Martin >> >> > >> > Martin Makundi wrote: >> >> >> >> Hi! >> >> >> >> There has been some discussion in the past about using Wicket for >> >> rendering WML pages: >> >> http://cwiki.apache.org/WICKET/mobile-devices.html >> >> >> >> Is there any such wml+wicket boilerplate/quickstart code available out >> >> there or would someone like to post their experiences? >> >> >> >> ** >> >> Martin >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> >> >> > >> > -- >> > View this message in context: >> http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html >> > Sent from the Wicket - User 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 >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WML + Wicket experiences?
I've never tried it, but I would suspect that I would start by creating something like: public class WapForm extends Form { protected void onComponentTag(final ComponentTag tag) { // copy the code from Form.onComponentTag to here and change the "action" and tag, etc... } } Form could also be changed to get the kind of tag and the attribute name ("action" / "href") from a method that could be overridden, but that would require a change to core - this method you can do yourself quickly. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Feb 19, 2009 at 3:35 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > > it's totally possible. did it at a company last year (but that's > > proprietary, of course). > > Cool. Can you give a hint if you could re-use Form components in Wml? > > > > > > > What is the best way to bind href and the postfields with a wicket > form? Or should I build a custom 'wap-form' which supports similar > validation? > > ** > Martin > > > > > Martin Makundi wrote: > >> > >> Hi! > >> > >> There has been some discussion in the past about using Wicket for > >> rendering WML pages: > >> http://cwiki.apache.org/WICKET/mobile-devices.html > >> > >> Is there any such wml+wicket boilerplate/quickstart code available out > >> there or would someone like to post their experiences? > >> > >> ** > >> Martin > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > >> > > > > -- > > View this message in context: > http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html > > Sent from the Wicket - User 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: WML + Wicket experiences?
> it's totally possible. did it at a company last year (but that's > proprietary, of course). Cool. Can you give a hint if you could re-use Form components in Wml? What is the best way to bind href and the postfields with a wicket form? Or should I build a custom 'wap-form' which supports similar validation? ** Martin > > Martin Makundi wrote: >> >> Hi! >> >> There has been some discussion in the past about using Wicket for >> rendering WML pages: >> http://cwiki.apache.org/WICKET/mobile-devices.html >> >> Is there any such wml+wicket boilerplate/quickstart code available out >> there or would someone like to post their experiences? >> >> ** >> Martin >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html > Sent from the Wicket - User 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: WML + Wicket experiences?
it's totally possible. did it at a company last year (but that's proprietary, of course). Martin Makundi wrote: > > Hi! > > There has been some discussion in the past about using Wicket for > rendering WML pages: > http://cwiki.apache.org/WICKET/mobile-devices.html > > Is there any such wml+wicket boilerplate/quickstart code available out > there or would someone like to post their experiences? > > ** > Martin > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/WML-%2B-Wicket-experiences--tp22076991p22081338.html Sent from the Wicket - User 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