You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Long <st...@gmail.com> on 2006/08/23 03:27:52 UTC

LinkSubmit in a form that itself is the result of some other ajax update doesnt work

I have a pager that moves results from 1 to 100, 10 at a time.

the pager itself refreshes a section of the page which in turn has a
for loop for th e10 results that are currently being navigated.

The elements in for loop also each provide links which work via ajax
(@Submit and async on the form) - that is, if i click on the fourth
elemnt ont he for loop, the submit tags it and submits it. this works
fine on the first page, which is loaded via a hard refresh without
ajax. if i click on the second page (ie, a link requeries the db and
thae section with the for loop is updated via ajax), the submit inside
the updated area no longer work. they dont submit via ajax, they
revert to the manual URL.

Is there something going on that I can do? or maybe Im not updating
something somehwere?

any help would be appreciated, thanks,

josh



.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: LinkSubmit in a form that itself is the result of some other ajax update doesnt work

Posted by Josh Long <st...@gmail.com>.
The funny thing is,I was JUST about to sent a note back explaining how
the problem (in this evil case) cured itself:

<div jwcid="@Border">

 <div jwcid="status@Any">
   <div listener = "listener:changePage"
             selectedPageNumber="ognl:selectedPageNumber"
             updateComponents = "ognl:  { 'res' ,'status' }"   search
= "ognl:search"
             jwcid="p1@search/restaurants/SearchPager">
            pager goes here
            </div> </div>

  <br/>

     <form jwcid="@Form" async = "ognl:true"  updateComponents ="ognl:{'res'}">
      <div   jwcid="res@Any">


        <div jwcid="@For" value="ognl:result" source="ognl: results">

                           <a href="javascript:void(0);"
                                 tag="ognl: result"    listener
="listener:showMeTheMoney"
                                 selected = "ognl: selectedResult"
                                 jwcid="submit@LinkSubmit">
                                  ${result.company}   /   ${result.id}
                              </a>



         </div>


      </div>
     </form>

</div>




Sooooo..........

the pager updates a parameter (a page number) and calls a listener,
the listener then fetches the data, the data is then available in a
collection. inside the pager,
getResponseBuilder().updateComponent("res") is called. so now res
(res@Any) is rerendered with new data. the for loop is run and each
record gets a submit button. the submit button in turn has an listener
thats called when clicked and it in turn updates the res result set.
all via ajax.

However, if you reverse my form and div tags, such that form is inside
of      <div   jwcid="res@Any">
, you get the problems i was trying to understand myself earlier. the
individual rows worked fine on the first page, but any subsequent
rendering of "res" through ajax would rerender the form as well as the
components which for some reason didnt work.

It was random luck that I found that out at all...

Peace,
Josh








On 8/22/06, Jesse Kuhnert <jk...@gmail.com> wrote:
> That sounds tricky. I can guess and tell you to turn on browser debugging
> but this sounds like it will be hard to do that way..
>
> Can you provide me with a test case to reproduce with? (i mean attached to a
> jira ticket that I can download and run out of the box preferrably)
>
> On 8/22/06, Josh Long <st...@gmail.com> wrote:
> >
> > I have a pager that moves results from 1 to 100, 10 at a time.
> >
> > the pager itself refreshes a section of the page which in turn has a
> > for loop for th e10 results that are currently being navigated.
> >
> > The elements in for loop also each provide links which work via ajax
> > (@Submit and async on the form) - that is, if i click on the fourth
> > elemnt ont he for loop, the submit tags it and submits it. this works
> > fine on the first page, which is loaded via a hard refresh without
> > ajax. if i click on the second page (ie, a link requeries the db and
> > thae section with the for loop is updated via ajax), the submit inside
> > the updated area no longer work. they dont submit via ajax, they
> > revert to the manual URL.
> >
> > Is there something going on that I can do? or maybe Im not updating
> > something somehwere?
> >
> > any help would be appreciated, thanks,
> >
> > josh
> >
> >
> >
> > .
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo/(and a dash of TestNG), team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: LinkSubmit in a form that itself is the result of some other ajax update doesnt work

Posted by Jesse Kuhnert <jk...@gmail.com>.
That sounds tricky. I can guess and tell you to turn on browser debugging
but this sounds like it will be hard to do that way..

Can you provide me with a test case to reproduce with? (i mean attached to a
jira ticket that I can download and run out of the box preferrably)

On 8/22/06, Josh Long <st...@gmail.com> wrote:
>
> I have a pager that moves results from 1 to 100, 10 at a time.
>
> the pager itself refreshes a section of the page which in turn has a
> for loop for th e10 results that are currently being navigated.
>
> The elements in for loop also each provide links which work via ajax
> (@Submit and async on the form) - that is, if i click on the fourth
> elemnt ont he for loop, the submit tags it and submits it. this works
> fine on the first page, which is loaded via a hard refresh without
> ajax. if i click on the second page (ie, a link requeries the db and
> thae section with the for loop is updated via ajax), the submit inside
> the updated area no longer work. they dont submit via ajax, they
> revert to the manual URL.
>
> Is there something going on that I can do? or maybe Im not updating
> something somehwere?
>
> any help would be appreciated, thanks,
>
> josh
>
>
>
> .
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.