Well thanks a lot for your advice Lance, this worked beautifully!  For 
reference I added the following data attributes to each of my selects (with a 
unique event name for each select type):

data-cardid="${cubeCard.id}" data-event="colourprofileoverridechanged"

Then I wrote the following JS snippet to perform the ajax submission & zone 
update:

                 $(document).find(".cubeAjaxUpdate").change(function() {
                    $("#savingUpdate").show(); 
                   
                    request = $.ajax({
                        url: 
"/editcube:"+$(this).data("event")+"/"+$(this).data("cardid")+"/"+$(this).val()+"?t:ac=1",
                        type: "post",
                        data: "t:zoneid=gridZone"
                    });
                
                    request.done(function (response, textStatus, jqXHR){
                        $("#savingUpdate").hide(); 
                    });
                });

> Date: Wed, 21 Aug 2013 15:55:06 +0100
> Subject: Re: Submitting id & value of a t:select component onChange
> From: lance.j...@googlemail.com
> To: users@tapestry.apache.org
> 
> tapestry-jquery has rewritten Tapestry's javascript and I'm not too
> familiar with it. I'm sure there's a function in there to trigger a zone
> update.
> On 21 Aug 2013 15:26, "Lance Java" <lance.j...@googlemail.com> wrote:
> 
> > You could use data attributes and some clientside jquery just like a
> > non-tapestry app.
> >
> > TML
> > <t:grid row="current" id="myGrid">
> >    <p:someCell><t:select … data-foo="current.foo" data-bar="current.bar" …
> > /></p:someCell>
> > </t:grid>
> >
> >
> >
> > JS
> > $("#myGrid").find("select").change(function() {
> >    var select = $(this);
> >    var foo = select.data("foo");
> >    var bar = select.data("bar");
> >    doStuff(foo, bar);
> >
> > };
> >
                                          

Reply via email to