thanks Taha 2011/7/29 Taha Hafeez <tawus.tapes...@gmail.com>
> You can use eventlink instead of actionlink and specify the event name > using "event" parameter. > > regards > Taha > > On Fri, Jul 29, 2011 at 7:34 PM, Julien Martin <bal...@gmail.com> wrote: > > It would be nice if I could add several OnEvent to a method. I could for > > instance add the EventConstants.ACTION event as well as the ACTIVATE > event > > to my loadJobPostings() method. > > Can anyone please help? Is there a better way? > > J. > > > > 2011/7/29 Julien Martin <bal...@gmail.com> > > > >> I understand part of the problem now. The method below is called before > the > >> ajax method that return grid.getBody(); > >> > >> *@OnEvent(EventConstants.ACTIVATE) > >> void loadJobPostings() { > >> jobPostings = service.loadJobPostings(); > >> }* > >> > >> How can remedy this without doing something like this which I find not > very > >> beautiful: > >> > >> * > >> @OnEvent(value = EventConstants.ACTION, component = "pause") > >> @Log > >> > >> Object pauseJobPosting(JobPosting jobPosting) { > >> service.pauseJobPosting(jobPosting); > >> loadJobPostings();//NOTICE HERE!!! > >> return grid.getBody(); > >> }* > >> > >> Any idea? > >> > >> > >> J. > >> > >> 2011/7/29 Julien Martin <bal...@gmail.com> > >> > >>> Here is the result of the first click: > >>> > >>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > limit ? > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > limit ? > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_0_, > >>>> jobposting0_.job_posting_activated as job2_0_0_, > >>>> jobposting0_.job_posting_body as job3_0_0_, > >>>> jobposting0_.job_posting_contact_email as job4_0_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_0_, > >>>> jobposting0_.job_posting_location as job8_0_0_, > >>>> jobposting0_.job_posting_paused as job9_0_0_, > >>>> jobposting0_.job_posting_salary as job10_0_0_, > >>>> jobposting0_.job_posting_title as job11_0_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_0_, > >>>> jobposting0_.job_posting_validated as job13_0_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > >>>> Hibernate: *update* cheetah.job_posting set job_posting_activated=?, > >>>> job_posting_body=?, job_posting_contact_email=?, > job_posting_contact_name=?, > >>>> job_posting_contact_telephone=?, job_posting_creation_date=?, > >>>> job_posting_location=?, job_posting_paused=?, job_posting_salary=?, > >>>> job_posting_title=?, job_posting_update_date=?, > job_posting_validated=?, > >>>> job_posting_validation_date=? where id_job_posting=? > >>>> > >>> > >>> > >>> and the second click: > >>> > >>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > limit ? > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_, > >>>> jobposting0_.job_posting_activated as job2_0_, > jobposting0_.job_posting_body > >>>> as job3_0_, jobposting0_.job_posting_contact_email as job4_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_, > >>>> jobposting0_.job_posting_location as job8_0_, > >>>> jobposting0_.job_posting_paused as job9_0_, > jobposting0_.job_posting_salary > >>>> as job10_0_, jobposting0_.job_posting_title as job11_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_, > >>>> jobposting0_.job_posting_validated as job13_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > limit ? > >>>> Hibernate: select jobposting0_.id_job_posting as id1_0_0_, > >>>> jobposting0_.job_posting_activated as job2_0_0_, > >>>> jobposting0_.job_posting_body as job3_0_0_, > >>>> jobposting0_.job_posting_contact_email as job4_0_0_, > >>>> jobposting0_.job_posting_contact_name as job5_0_0_, > >>>> jobposting0_.job_posting_contact_telephone as job6_0_0_, > >>>> jobposting0_.job_posting_creation_date as job7_0_0_, > >>>> jobposting0_.job_posting_location as job8_0_0_, > >>>> jobposting0_.job_posting_paused as job9_0_0_, > >>>> jobposting0_.job_posting_salary as job10_0_0_, > >>>> jobposting0_.job_posting_title as job11_0_0_, > >>>> jobposting0_.job_posting_update_date as job12_0_0_, > >>>> jobposting0_.job_posting_validated as job13_0_0_, > >>>> jobposting0_.job_posting_validation_date as job14_0_0_ from > >>>> cheetah.job_posting jobposting0_ where jobposting0_.id_job_posting=? > >>>> > >>>> > >>> *The fist click issues 4 selects and one update > >>> The second click issues 4 selects.* > >>> > >>> I am going to try and find why and let you know. Might be an issue with > my > >>> JPA code... > >>> > >>> Julien. > >>> > >>> > >>> 2011/7/29 Julien Martin <bal...@gmail.com> > >>> > >>>> No JS error is shown in firebug/firefox. > >>>> I am going to try with @Log > >>>> J. > >>>> > >>>> 2011/7/29 Taha Hafeez <tawus.tapes...@gmail.com> > >>>> > >>>>> You can add @Log to the event handlers to log the calls. > >>>>> > >>>>> Did you check if you page has a javascript error ? > >>>>> > >>>>> regards > >>>>> Taha > >>>>> > >>>>> On Fri, Jul 29, 2011 at 7:02 PM, Julien Martin <bal...@gmail.com> > >>>>> wrote: > >>>>> > No exception is thrown... > >>>>> > Is there any way to log the ajax calls? > >>>>> > J. > >>>>> > > >>>>> > 2011/7/29 Taha Hafeez <tawus.tapes...@gmail.com> > >>>>> > > >>>>> >> There must be some stack trace ? Can you share that ? > >>>>> >> > >>>>> >> regards > >>>>> >> Taha > >>>>> >> > >>>>> >> On Fri, Jul 29, 2011 at 6:54 PM, Julien Martin <bal...@gmail.com> > >>>>> wrote: > >>>>> >> > I've added these as suggested. It still does not work... > >>>>> >> > Any other idea? > >>>>> >> > J. > >>>>> >> > > >>>>> >> > > >>>>> >> > * @OnEvent(value = EventConstants.ACTION, component = "pause") > >>>>> >> > Object pauseJobPosting(JobPosting jobPosting) { > >>>>> >> > service.pauseJobPosting(jobPosting); > >>>>> >> > return grid.getBody(); > >>>>> >> > } > >>>>> >> > > >>>>> >> > @OnEvent(value = EventConstants.ACTION, component = > "unPause") > >>>>> >> > Object unPauseJobPosting(JobPosting jobPosting) { > >>>>> >> > service.unPauseJobPosting(jobPosting); > >>>>> >> > return grid.getBody(); > >>>>> >> > }* > >>>>> >> > > >>>>> >> > > >>>>> >> > 2011/7/29 Taha Hafeez <tawus.tapes...@gmail.com> > >>>>> >> > > >>>>> >> >> Do the corresponding event handlers of these actionlinks return > >>>>> >> >> zone.getBody() > >>>>> >> >> > >>>>> >> >> @InjectComponent > >>>>> >> >> private Zone grid; > >>>>> >> >> > >>>>> >> >> Object onUnPause() > >>>>> >> >> { > >>>>> >> >> return grid.getBody(); > >>>>> >> >> } > >>>>> >> >> > >>>>> >> >> regards > >>>>> >> >> Taha > >>>>> >> >> > >>>>> >> >> > >>>>> >> >> On Fri, Jul 29, 2011 at 6:32 PM, Julien Martin < > bal...@gmail.com> > >>>>> >> wrote: > >>>>> >> >> > Hello, > >>>>> >> >> > > >>>>> >> >> > I have a form that contains a number of action links. I would > >>>>> like to > >>>>> >> >> update > >>>>> >> >> > the whole enclosig form from an action link and have added a > >>>>> zone to > >>>>> >> that > >>>>> >> >> > purpose. > >>>>> >> >> > > >>>>> >> >> > It is as follows: > >>>>> >> >> > > >>>>> >> >> > * <t:zone t:id="grid" id="grid"> > >>>>> >> >> > <form t:type="form" t:id="jobPostings"> > >>>>> >> >> > > >>>>> >> >> > <t:grid source="jobPostings" row="jobPosting" > >>>>> add="actions" > >>>>> >> >> > exclude="jobPostingValidationDate"> > >>>>> >> >> > <p:jobPostingPausedCell> > >>>>> >> >> > <t:if test="jobPosting.jobPostingPaused"> > >>>>> >> >> > <t:actionlink t:id="unPause" > >>>>> >> context="jobPosting" > >>>>> >> >> > zone="grid">unPause</t:actionlink> > >>>>> >> >> > <p:else> > >>>>> >> >> > <t:actionlink t:id="pause" > >>>>> >> >> context="jobPosting" > >>>>> >> >> > zone="grid">pause</t:actionlink> > >>>>> >> >> > </p:else> > >>>>> >> >> > </t:if> > >>>>> >> >> > </p:jobPostingPausedCell> > >>>>> >> >> > <p:actionscell> > >>>>> >> >> > <t:actionlink t:id="activate" > >>>>> >> >> > context="jobPosting">activate</t:actionlink> > >>>>> >> >> > <br/> > >>>>> >> >> > <t:actionlink t:id="modify" > >>>>> >> >> > context="jobPosting">modify</t:actionlink> > >>>>> >> >> > <br/> > >>>>> >> >> > <t:actionlink t:id="delete" > >>>>> >> >> > context="jobPosting">delete</t:actionlink> > >>>>> >> >> > <br/> > >>>>> >> >> > </p:actionscell> > >>>>> >> >> > </t:grid> > >>>>> >> >> > </form> > >>>>> >> >> > </t:zone>* > >>>>> >> >> > > >>>>> >> >> > However the zone is not updated when I click on the button. > >>>>> >> >> > > >>>>> >> >> > Can anyone please help? > >>>>> >> >> > > >>>>> >> >> > Regards, > >>>>> >> >> > > >>>>> >> >> > Julien. > >>>>> >> >> > > >>>>> >> >> > >>>>> >> >> > >>>>> --------------------------------------------------------------------- > >>>>> >> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>>>> >> >> For additional commands, e-mail: > users-h...@tapestry.apache.org > >>>>> >> >> > >>>>> >> >> > >>>>> >> > > >>>>> >> > >>>>> >> > --------------------------------------------------------------------- > >>>>> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>>>> >> For additional commands, e-mail: users-h...@tapestry.apache.org > >>>>> >> > >>>>> >> > >>>>> > > >>>>> > >>>>> --------------------------------------------------------------------- > >>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>>>> For additional commands, e-mail: users-h...@tapestry.apache.org > >>>>> > >>>>> > >>>> > >>> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >