You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by john c <jo...@yahoo.com> on 2013/08/29 23:56:10 UTC

JQuery Datatable Bind Mixin

I am attempting to use the jquery/bind mixin with a datatable, but not having success.
The relevant code is below. Basically I want to click a row and have it create a tapestry event, with the fileID.
I have tested and found the event occurs, but I can't seem to pass the fileID context.
Any ideas?


---------------------------------------------------------------------------

<t:jquery.datatable id="dataTable" 

  t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
include="..." >
</t:jquery.datatable>

---------------------------------------------------------------------------


    @Persist
    @Property
    private OutboundFile currRow;

    @InjectComponent
    private Zone theZone;


    @OnEvent("datatableclick") 
    public Object onDatatableClickEvent(String value) {
        System.out.println("value: " + value);
        return theZone.getBody();
    }   

Re: JQuery Datatable Bind Mixin

Posted by Barry Books <tr...@gmail.com>.
I don't really know how the data table works but I would guess it's a
property off the ui parameter that you want.


On Wed, Sep 4, 2013 at 12:24 AM, john c <jo...@yahoo.com> wrote:

> Ok I removed bind.context=".." altogether, and added:
>
> bind.callback="function(event,ui,u) {u.addContext("Your Value");
>
>
> I get "You Value" in the action listener. But I need the file id.
>
> I tried:
>
> bind.callback="function(event,ui,u) {u.addContext(${currRow.fileID});
> bind.callback="function(event,ui,u) {u.addContext(currRow.fileID);
>
>
> But it doesn't work. currRow is Null.
>
> My datatable is set to ajax mode (t:mode="true"). After searching the
> forums it says I need @Environmental on the row variable. Added that then
> got other errors.
>
>
> ________________________________
>  From: Barry Books <tr...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>; john c <
> john998800@yahoo.com>
> Sent: Friday, 30 August 2013 4:15 PM
> Subject: Re: JQuery Datatable Bind Mixin
>
>
> The callback is javascript. The bind mixin has no way of know what value
> you would like to pass back so the callback gets the value you want in the
> javascript event then adds it into the event url
>
> It's been a while but I think it's something like this
>
> <t:jquery.table id="dataTable"
>
>   t:row="currRow"
>   t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
> bind.zone="theZone" bind.callback="function(event,ui,u) {
> u.addContext("Your Value"); }"
> include="..." >
>
>
> On Fri, Aug 30, 2013 at 2:23 PM, john c <jo...@yahoo.com> wrote:
>
> > Ok, here is a little more of the datatable code:
> >
> > <t:jquery.table id="dataTable"
> >
> >   t:row="currRow"
> >   t:mixins="jquery/bind" bind.event="datatableclick"
> > bind.eventType="click" bind.zone="theZone"
> bind.context="${currRow.fileID}"
> > include="..." >
> >
> >   <p:buttonCell>
> >                     <t:jquery.dialogajaxlink t:dialog="myDialog"
> > t:zone="detailZone" t:context="${thisfile.fileID}"><button
> > class="smallgridbutton"
> > type="button">Requeue</button></t:jquery.dialogajaxlink>
> >                  </p:buttonCell>
> >
> > </t:jquery.datatable>
> >
> >
> >
> > currRow is defined in java with @Property annotation.
> >
> > I have tried in the tml:
> >
> > bind.context="${currRow.fileID}"
> >
> > bind.context="currRow.fileID"
> >
> > I am always getting an error: currRow is NULL.
> >
> >
> > Why is that?
> >
> >
> >
> ------------------------------------------------------------------------------------------------
> >
> > Now with the callback, where does this Java code go?
> >
> >
> >
> >
> > ________________________________
> >  From: Barry Books <tr...@gmail.com>
> > To: Tapestry users <us...@tapestry.apache.org>
> > Sent: Friday, 30 August 2013 8:59 AM
> > Subject: Re: JQuery Datatable Bind Mixin
> >
> >
> > You will need to provide a javascript callback function to the mixin that
> > puts the value into the url. It's called like this
> >
> > if ( callback ) {
> >    // TODO should work if value is array
> >    u.addContext = function(value) { u.url =
> u.url.replace(u.context,value)
> > };
> >    callback(event,ui,u);
> > }
> >
> > so I think your callback can be
> >
> > function(event,ui,u) { u.addContext("Your Value"); }
> >
> >
> >
> > On Thu, Aug 29, 2013 at 6:18 PM, Taha Hafeez Siddiqi <
> > tawus.tapestry@gmail.com> wrote:
> >
> > > Try curRow.fileID instead of ${curRow.fileID} as parameter to
> > bind.context
> > >
> > > Sent from my iPhone
> > >
> > > On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:
> > >
> > > > I am attempting to use the jquery/bind mixin with a datatable, but
> not
> > > having success.
> > > > The relevant code is below. Basically I want to click a row and have
> it
> > > create a tapestry event, with the fileID.
> > > > I have tested and found the event occurs, but I can't seem to pass
> the
> > > fileID context.
> > > > Any ideas?
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------------
> > > >
> > > > <t:jquery.datatable id="dataTable"
> > > >
> > > >   t:mixins="jquery/bind" bind.event="datatableclick"
> > > bind.eventType="click" bind.zone="theZone"
> > bind.context="${currRow.fileID}"
> > > > include="..." >
> > > > </t:jquery.datatable>
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------------
> > > >
> > > >
> > > >     @Persist
> > > >     @Property
> > > >     private OutboundFile currRow;
> > > >
> > > >     @InjectComponent
> > > >     private Zone theZone;
> > > >
> > > >
> > > >     @OnEvent("datatableclick")
> > > >     public Object onDatatableClickEvent(String value) {
> > > >         System.out.println("value: " + value);
> > > >         return theZone.getBody();
> > > >     }
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
>

Re: JQuery Datatable Bind Mixin

Posted by "Nourredine K." <no...@gmail.com>.
Hi,

> My datatable is set to ajax mode (t:mode="true"). After searching the forums it says I need @Environmental on the row variable. Added that then got other errors.

FYI, in last tapestry5-jquery release,  there's no more need to use
@Environmental on the row (see
https://github.com/got5/tapestry5-jquery/issues/285)

Nourredine.

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


Re: JQuery Datatable Bind Mixin

Posted by Barry Books <tr...@gmail.com>.
http://tapestry5-jquery.com


On Tue, Sep 10, 2013 at 10:50 AM, john c <jo...@yahoo.com> wrote:

> Is there a link to some documentation or sample somewhere?
>
>
> ________________________________
>  From: Barry Books <tr...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>; john c <
> john998800@yahoo.com>
> Sent: Monday, 9 September 2013 7:05 PM
> Subject: Re: JQuery Datatable Bind Mixin
>
>
> See the element parameter. It takes a jQuery selector
>
>
> On Mon, Sep 9, 2013 at 10:16 AM, john c <jo...@yahoo.com> wrote:
>
> > One more question with this jquery/bind mixin.... How can I make it apply
> > for the tbody only?   Only the rows?   I don't want the event to be fired
> > when clicking on a column name. It is interfering  with the sorting.
> > Thanks.
> >
> >
> > <t:jquery.datatable id="dataTable" t:add="button" t:row="currRow"
> > t:mode="true" t:source="source" rowsPerPage="12"   include=".."
> > t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
> > bind.zone="historyZone" bind.callback="function(event,ui,u) {...}"
> >
> > reorder="..." options="datatableParams">
> >
> >      ...
> > </t:jquery.datatable>
>

Re: JQuery Datatable Bind Mixin

Posted by john c <jo...@yahoo.com>.
Is there a link to some documentation or sample somewhere?


________________________________
 From: Barry Books <tr...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>; john c <jo...@yahoo.com> 
Sent: Monday, 9 September 2013 7:05 PM
Subject: Re: JQuery Datatable Bind Mixin
 

See the element parameter. It takes a jQuery selector


On Mon, Sep 9, 2013 at 10:16 AM, john c <jo...@yahoo.com> wrote:

> One more question with this jquery/bind mixin.... How can I make it apply
> for the tbody only?   Only the rows?   I don't want the event to be fired
> when clicking on a column name. It is interfering  with the sorting.
> Thanks.
>
>
> <t:jquery.datatable id="dataTable" t:add="button" t:row="currRow"
> t:mode="true" t:source="source" rowsPerPage="12"   include=".."
> t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
> bind.zone="historyZone" bind.callback="function(event,ui,u) {...}"
>
> reorder="..." options="datatableParams">
>
>      ...
> </t:jquery.datatable>

Re: JQuery Datatable Bind Mixin

Posted by Barry Books <tr...@gmail.com>.
See the element parameter. It takes a jQuery selector


On Mon, Sep 9, 2013 at 10:16 AM, john c <jo...@yahoo.com> wrote:

> One more question with this jquery/bind mixin.... How can I make it apply
> for the tbody only?   Only the rows?   I don't want the event to be fired
> when clicking on a column name. It is interfering  with the sorting.
> Thanks.
>
>
> <t:jquery.datatable id="dataTable" t:add="button" t:row="currRow"
> t:mode="true" t:source="source" rowsPerPage="12"   include=".."
> t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
> bind.zone="historyZone" bind.callback="function(event,ui,u) {...}"
>
> reorder="..." options="datatableParams">
>
>      ...
> </t:jquery.datatable>

Re: JQuery Datatable Bind Mixin

Posted by john c <jo...@yahoo.com>.
One more question with this jquery/bind mixin.... How can I make it apply for the tbody only?   Only the rows?   I don't want the event to be fired when clicking on a column name. It is interfering  with the sorting.   
Thanks.


<t:jquery.datatable id="dataTable" t:add="button" t:row="currRow" t:mode="true" t:source="source" rowsPerPage="12"   include=".." 
t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click" bind.zone="historyZone" bind.callback="function(event,ui,u) {...}"

reorder="..." options="datatableParams">

     ...
</t:jquery.datatable>

Re: JQuery Datatable Bind Mixin

Posted by john c <jo...@yahoo.com>.
bind.callback="function(event,ui,u) {u.addContext(event.target.parentNode.childNodes[3].innerHTML);}"



________________________________
 From: Thiago H de Paula Figueiredo <th...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org> 
Sent: Wednesday, 4 September 2013 7:45 AM
Subject: Re: JQuery Datatable Bind Mixin
 

On Wed, 04 Sep 2013 02:24:45 -0300, john c <jo...@yahoo.com> wrote:

> bind.callback="function(event,ui,u) {u.addContext(${currRow.fileID});
> bind.callback="function(event,ui,u) {u.addContext(currRow.fileID);
>
> But it doesn't work. currRow is Null.

That's the expected result. You're adding a callback, which will be called  
later, which is using a value which is set only during the rendering. Your  
function needs to extract the data from the HTML DOM nodes.

-- 
Thiago H. de Paula Figueiredo

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

Re: JQuery Datatable Bind Mixin

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 04 Sep 2013 02:24:45 -0300, john c <jo...@yahoo.com> wrote:

> bind.callback="function(event,ui,u) {u.addContext(${currRow.fileID});
> bind.callback="function(event,ui,u) {u.addContext(currRow.fileID);
>
> But it doesn't work. currRow is Null.

That's the expected result. You're adding a callback, which will be called  
later, which is using a value which is set only during the rendering. Your  
function needs to extract the data from the HTML DOM nodes.

-- 
Thiago H. de Paula Figueiredo

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


Re: JQuery Datatable Bind Mixin

Posted by john c <jo...@yahoo.com>.
Ok I removed bind.context=".." altogether, and added:

bind.callback="function(event,ui,u) {u.addContext("Your Value");


I get "You Value" in the action listener. But I need the file id.

I tried:

bind.callback="function(event,ui,u) {u.addContext(${currRow.fileID});
bind.callback="function(event,ui,u) {u.addContext(currRow.fileID);


But it doesn't work. currRow is Null.

My datatable is set to ajax mode (t:mode="true"). After searching the forums it says I need @Environmental on the row variable. Added that then got other errors.


________________________________
 From: Barry Books <tr...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>; john c <jo...@yahoo.com> 
Sent: Friday, 30 August 2013 4:15 PM
Subject: Re: JQuery Datatable Bind Mixin
 

The callback is javascript. The bind mixin has no way of know what value
you would like to pass back so the callback gets the value you want in the
javascript event then adds it into the event url

It's been a while but I think it's something like this

<t:jquery.table id="dataTable"

  t:row="currRow"
  t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
bind.zone="theZone" bind.callback="function(event,ui,u) {
u.addContext("Your Value"); }"
include="..." >


On Fri, Aug 30, 2013 at 2:23 PM, john c <jo...@yahoo.com> wrote:

> Ok, here is a little more of the datatable code:
>
> <t:jquery.table id="dataTable"
>
>   t:row="currRow"
>   t:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> include="..." >
>
>   <p:buttonCell>
>                     <t:jquery.dialogajaxlink t:dialog="myDialog"
> t:zone="detailZone" t:context="${thisfile.fileID}"><button
> class="smallgridbutton"
> type="button">Requeue</button></t:jquery.dialogajaxlink>
>                  </p:buttonCell>
>
> </t:jquery.datatable>
>
>
>
> currRow is defined in java with @Property annotation.
>
> I have tried in the tml:
>
> bind.context="${currRow.fileID}"
>
> bind.context="currRow.fileID"
>
> I am always getting an error: currRow is NULL.
>
>
> Why is that?
>
>
> ------------------------------------------------------------------------------------------------
>
> Now with the callback, where does this Java code go?
>
>
>
>
> ________________________________
>  From: Barry Books <tr...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>
> Sent: Friday, 30 August 2013 8:59 AM
> Subject: Re: JQuery Datatable Bind Mixin
>
>
> You will need to provide a javascript callback function to the mixin that
> puts the value into the url. It's called like this
>
> if ( callback ) {
>    // TODO should work if value is array
>    u.addContext = function(value) { u.url = u.url.replace(u.context,value)
> };
>    callback(event,ui,u);
> }
>
> so I think your callback can be
>
> function(event,ui,u) { u.addContext("Your Value"); }
>
>
>
> On Thu, Aug 29, 2013 at 6:18 PM, Taha Hafeez Siddiqi <
> tawus.tapestry@gmail.com> wrote:
>
> > Try curRow.fileID instead of ${curRow.fileID} as parameter to
> bind.context
> >
> > Sent from my iPhone
> >
> > On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:
> >
> > > I am attempting to use the jquery/bind mixin with a datatable, but not
> > having success.
> > > The relevant code is below. Basically I want to click a row and have it
> > create a tapestry event, with the fileID.
> > > I have tested and found the event occurs, but I can't seem to pass the
> > fileID context.
> > > Any ideas?
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------------
> > >
> > > <t:jquery.datatable id="dataTable"
> > >
> > >   t:mixins="jquery/bind" bind.event="datatableclick"
> > bind.eventType="click" bind.zone="theZone"
> bind.context="${currRow.fileID}"
> > > include="..." >
> > > </t:jquery.datatable>
> > >
> > >
> >
> ---------------------------------------------------------------------------
> > >
> > >
> > >     @Persist
> > >     @Property
> > >     private OutboundFile currRow;
> > >
> > >     @InjectComponent
> > >     private Zone theZone;
> > >
> > >
> > >     @OnEvent("datatableclick")
> > >     public Object onDatatableClickEvent(String value) {
> > >         System.out.println("value: " + value);
> > >         return theZone.getBody();
> > >     }
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: JQuery Datatable Bind Mixin

Posted by Barry Books <tr...@gmail.com>.
The callback is javascript. The bind mixin has no way of know what value
you would like to pass back so the callback gets the value you want in the
javascript event then adds it into the event url

It's been a while but I think it's something like this

<t:jquery.table id="dataTable"

  t:row="currRow"
  t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click"
bind.zone="theZone" bind.callback="function(event,ui,u) {
u.addContext("Your Value"); }"
include="..." >


On Fri, Aug 30, 2013 at 2:23 PM, john c <jo...@yahoo.com> wrote:

> Ok, here is a little more of the datatable code:
>
> <t:jquery.table id="dataTable"
>
>   t:row="currRow"
>   t:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> include="..." >
>
>   <p:buttonCell>
>                     <t:jquery.dialogajaxlink t:dialog="myDialog"
> t:zone="detailZone" t:context="${thisfile.fileID}"><button
> class="smallgridbutton"
> type="button">Requeue</button></t:jquery.dialogajaxlink>
>                  </p:buttonCell>
>
> </t:jquery.datatable>
>
>
>
> currRow is defined in java with @Property annotation.
>
> I have tried in the tml:
>
> bind.context="${currRow.fileID}"
>
> bind.context="currRow.fileID"
>
> I am always getting an error: currRow is NULL.
>
>
> Why is that?
>
>
> ------------------------------------------------------------------------------------------------
>
> Now with the callback, where does this Java code go?
>
>
>
>
> ________________________________
>  From: Barry Books <tr...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>
> Sent: Friday, 30 August 2013 8:59 AM
> Subject: Re: JQuery Datatable Bind Mixin
>
>
> You will need to provide a javascript callback function to the mixin that
> puts the value into the url. It's called like this
>
> if ( callback ) {
>    // TODO should work if value is array
>    u.addContext = function(value) { u.url = u.url.replace(u.context,value)
> };
>    callback(event,ui,u);
> }
>
> so I think your callback can be
>
> function(event,ui,u) { u.addContext("Your Value"); }
>
>
>
> On Thu, Aug 29, 2013 at 6:18 PM, Taha Hafeez Siddiqi <
> tawus.tapestry@gmail.com> wrote:
>
> > Try curRow.fileID instead of ${curRow.fileID} as parameter to
> bind.context
> >
> > Sent from my iPhone
> >
> > On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:
> >
> > > I am attempting to use the jquery/bind mixin with a datatable, but not
> > having success.
> > > The relevant code is below. Basically I want to click a row and have it
> > create a tapestry event, with the fileID.
> > > I have tested and found the event occurs, but I can't seem to pass the
> > fileID context.
> > > Any ideas?
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------------
> > >
> > > <t:jquery.datatable id="dataTable"
> > >
> > >   t:mixins="jquery/bind" bind.event="datatableclick"
> > bind.eventType="click" bind.zone="theZone"
> bind.context="${currRow.fileID}"
> > > include="..." >
> > > </t:jquery.datatable>
> > >
> > >
> >
> ---------------------------------------------------------------------------
> > >
> > >
> > >     @Persist
> > >     @Property
> > >     private OutboundFile currRow;
> > >
> > >     @InjectComponent
> > >     private Zone theZone;
> > >
> > >
> > >     @OnEvent("datatableclick")
> > >     public Object onDatatableClickEvent(String value) {
> > >         System.out.println("value: " + value);
> > >         return theZone.getBody();
> > >     }
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: JQuery Datatable Bind Mixin

Posted by john c <jo...@yahoo.com>.
Ok, here is a little more of the datatable code:

<t:jquery.table id="dataTable"

  t:row="currRow"
  t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}" 
include="..." > 

  <p:buttonCell>
                    <t:jquery.dialogajaxlink t:dialog="myDialog" t:zone="detailZone" t:context="${thisfile.fileID}"><button class="smallgridbutton" type="button">Requeue</button></t:jquery.dialogajaxlink>
                 </p:buttonCell>

</t:jquery.datatable>



currRow is defined in java with @Property annotation.

I have tried in the tml:

bind.context="${currRow.fileID}"

bind.context="currRow.fileID"

I am always getting an error: currRow is NULL.


Why is that?  

------------------------------------------------------------------------------------------------

Now with the callback, where does this Java code go? 




________________________________
 From: Barry Books <tr...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org> 
Sent: Friday, 30 August 2013 8:59 AM
Subject: Re: JQuery Datatable Bind Mixin
 

You will need to provide a javascript callback function to the mixin that
puts the value into the url. It's called like this

if ( callback ) {                    
   // TODO should work if value is array
   u.addContext = function(value) { u.url = u.url.replace(u.context,value) };
   callback(event,ui,u);
}

so I think your callback can be

function(event,ui,u) { u.addContext("Your Value"); }



On Thu, Aug 29, 2013 at 6:18 PM, Taha Hafeez Siddiqi <
tawus.tapestry@gmail.com> wrote:

> Try curRow.fileID instead of ${curRow.fileID} as parameter to bind.context
>
> Sent from my iPhone
>
> On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:
>
> > I am attempting to use the jquery/bind mixin with a datatable, but not
> having success.
> > The relevant code is below. Basically I want to click a row and have it
> create a tapestry event, with the fileID.
> > I have tested and found the event occurs, but I can't seem to pass the
> fileID context.
> > Any ideas?
> >
> >
> >
> ---------------------------------------------------------------------------
> >
> > <t:jquery.datatable id="dataTable"
> >
> >   t:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> > include="..." >
> > </t:jquery.datatable>
> >
> >
> ---------------------------------------------------------------------------
> >
> >
> >     @Persist
> >     @Property
> >     private OutboundFile currRow;
> >
> >     @InjectComponent
> >     private Zone theZone;
> >
> >
> >     @OnEvent("datatableclick")
> >     public Object onDatatableClickEvent(String value) {
> >         System.out.println("value: " + value);
> >         return theZone.getBody();
> >     }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: JQuery Datatable Bind Mixin

Posted by Barry Books <tr...@gmail.com>.
You will need to provide a javascript callback function to the mixin that
puts the value into the url. It's called like this

if ( callback ) {					
   // TODO should work if value is array
   u.addContext = function(value) { u.url = u.url.replace(u.context,value) };
   callback(event,ui,u);
}

so I think your callback can be

function(event,ui,u) { u.addContext("Your Value"); }



On Thu, Aug 29, 2013 at 6:18 PM, Taha Hafeez Siddiqi <
tawus.tapestry@gmail.com> wrote:

> Try curRow.fileID instead of ${curRow.fileID} as parameter to bind.context
>
> Sent from my iPhone
>
> On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:
>
> > I am attempting to use the jquery/bind mixin with a datatable, but not
> having success.
> > The relevant code is below. Basically I want to click a row and have it
> create a tapestry event, with the fileID.
> > I have tested and found the event occurs, but I can't seem to pass the
> fileID context.
> > Any ideas?
> >
> >
> >
> ---------------------------------------------------------------------------
> >
> > <t:jquery.datatable id="dataTable"
> >
> >   t:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> > include="..." >
> > </t:jquery.datatable>
> >
> >
> ---------------------------------------------------------------------------
> >
> >
> >     @Persist
> >     @Property
> >     private OutboundFile currRow;
> >
> >     @InjectComponent
> >     private Zone theZone;
> >
> >
> >     @OnEvent("datatableclick")
> >     public Object onDatatableClickEvent(String value) {
> >         System.out.println("value: " + value);
> >         return theZone.getBody();
> >     }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: JQuery Datatable Bind Mixin

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Try curRow.fileID instead of ${curRow.fileID} as parameter to bind.context

Sent from my iPhone

On 30-Aug-2013, at 3:26 AM, john c <jo...@yahoo.com> wrote:

> I am attempting to use the jquery/bind mixin with a datatable, but not having success.
> The relevant code is below. Basically I want to click a row and have it create a tapestry event, with the fileID.
> I have tested and found the event occurs, but I can't seem to pass the fileID context.
> Any ideas?
> 
> 
> ---------------------------------------------------------------------------
> 
> <t:jquery.datatable id="dataTable" 
> 
>   t:mixins="jquery/bind" bind.event="datatableclick" bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> include="..." >
> </t:jquery.datatable>
> 
> ---------------------------------------------------------------------------
> 
> 
>     @Persist
>     @Property
>     private OutboundFile currRow;
> 
>     @InjectComponent
>     private Zone theZone;
> 
> 
>     @OnEvent("datatableclick") 
>     public Object onDatatableClickEvent(String value) {
>         System.out.println("value: " + value);
>         return theZone.getBody();
>     }   

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