The form will change it's id on a zone update, so either manualy generate it
or maybe do it like this

@InjectComponent
private Form addToLightboxForm;

public String getAddToLightboxFormId(){

return addToLightboxForm.getClientId();

}

and
onchange="$('${addToLightboxFormId}').fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT);"
Cheers,
Dragan Sahpaski



On Wed, Jun 1, 2011 at 4:32 PM, Ray Nicholus <rnicho...@widen.com> wrote:

> <t:unless test="!lightboxEnabled">
>     <t:form t:id="addToLightboxForm" t:zone="lightboxZone">
>            <t:label for="addToLightbox"/>:
>            <t:select t:id="addToLightbox" model="addToLightboxModel"
> onchange="$('addToLightboxForm').fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT);"
> value="selectedLightboxName" label="literal:Add To Lightbox"/>
>        </t:form>
> </t:unless>
>
> On the Java side:
>
> public Object onSubmitFromAddToLightboxForm()
>  {
> if (selectedLightboxName.equals(AddToLightboxModel.NEW_LIGHTBOX_NAME))
>  {
> return onAddToNewLightbox();
> }
>  onAddToLightbox();
> return this;
> }
>
>
> On Wed, Jun 1, 2011 at 9:29 AM, dragan.sahpas...@gmail.com <
> dragan.sahpas...@gmail.com> wrote:
>
> > It works good for me.
> > Paste the entire code here.
> >
> > Cheers,
> > Dragan Sahpaski
> >
> >
> >
> > On Wed, Jun 1, 2011 at 4:22 PM, Ray Nicholus <rnicho...@widen.com>
> wrote:
> >
> > > This is causing all sorts of other odd issues.  First, the onSubmit for
> > the
> > > form is only called occasionally now.  I can't predict when it will and
> > > will
> > > not be called.
> > >
> > > On Wed, Jun 1, 2011 at 9:08 AM, dragan.sahpas...@gmail.com <
> > > dragan.sahpas...@gmail.com> wrote:
> > >
> > > > For example use it in a submit element like this:
> > > >
> > > > onchange="$('formId').fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT);"
> > > >
> > > >
> > > > Cheers,
> > > > Dragan Sahpaski
> > > >
> > > >
> > > >
> > > > On Wed, Jun 1, 2011 at 4:04 PM, Ray Nicholus <rnicho...@widen.com>
> > > wrote:
> > > >
> > > > > Thanks for the info.  Where exactly do I put the javascript dragon
> > > > listed?
> > > > >
> > > > > On Wed, Jun 1, 2011 at 9:02 AM, Thiago H. de Paula Figueiredo <
> > > > > thiag...@gmail.com> wrote:
> > > > >
> > > > > > On Wed, 01 Jun 2011 10:51:09 -0300, Ray Nicholus <
> > > rnicho...@widen.com>
> > > > > > wrote:
> > > > > >
> > > > > >  I guess I'm not sure what zone I need to specify in the form tag
> > or
> > > > why
> > > > > I
> > > > > >> need to specify a zone at all.
> > > > > >>
> > > > > >
> > > > > > Tapestry only sets up an AJAX form submit if you use the zone
> > > > parameter.
> > > > > > When returning a MultiZoneUpdate, the value of this parameter is
> > > > ignored.
> > > > > >
> > > > > >
> > > > > >  I only want to update a zone if one
> > > > > >> particular option in the form's Select component is selected.
>  In
> > > > fact,
> > > > > >> when a new item in the Select is selected, I am submitting the
> > form
> > > > via
> > > > > >> javascript (onchange=this.form.submit()).
> > > > > >>
> > > > > >
> > > > > > This will probably not trigger an AJAX form submission. The right
> > way
> > > > was
> > > > > > cited by Dragan in this thread.
> > > > > >
> > > > > > --
> > > > > > Thiago H. de Paula Figueiredo
> > > > > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> > > > developer,
> > > > > > and instructor
> > > > > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > > > > http://www.arsmachina.com.br
> > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to