Re: Tapestry Grid Paging

2016-03-23 Thread john c
Yea I got it working earlier using the inPlace parameter. Thanks.

  From: Nathan Quirynen 
 To: users@tapestry.apache.org 
 Sent: Wednesday, 23 March 2016, 11:39
 Subject: Re: Tapestry Grid Paging
   
Or the 'inPlace' parameter on true in the Grid component 
(http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/corelib/components/Grid.html)
 


On 23/03/16 16:37, Nathan Quirynen wrote:
> Did you set the zone that is surrounding your grid as the 'zone' 
> parameter on the GridPager component?
>
> http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/corelib/components/GridPager.html
>  
>
>
> On 23/03/16 15:34, john c wrote:
>> We have a big form which does a tonne of data loading from databases 
>> and legacy systems. Now we want to add this small grid at the top 
>> with paging. Clicking a paging button will trigger a page refresh and 
>> the whole form to reload the data again in addition to the grid 
>> data.  Obviously we don't want this to happen.
>> Is it possible to to fire an Ajax event and refresh the zone around 
>> the grid?  I cannot find an example. We are using 5.3.6.
>> John.
>>
>>> I have added rowsPerPage to add paging to a Tapestry Grid (that has a
>>> surrounding zone). When paging buttons are pressed it hits
>>> setupRender(). Is there a flag we can check to tell that a paging 
>>> button
>>> was just clicked?
>> No. Why do you need that?
>>
>>> Second, can it call a separate Tapestry event instead of it calling
>>> setupRender() ?
>> setupRender is invoked when the component or page is about to be 
>> rendered.
>> It's not actually directly related to Grid at all.
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



  

Re: Tapestry Grid Paging

2016-03-23 Thread john c
We have a big form which does a tonne of data loading from databases and legacy 
systems. Now we want to add this small grid at the top with paging. Clicking a 
paging button will trigger a page refresh and the whole form to reload the data 
again in addition to the grid data.  Obviously we don't want this to happen.
Is it possible to to fire an Ajax event and refresh the zone around the grid?  
I cannot find an example. We are using 5.3.6.
John.

  
> I have added rowsPerPage to add paging to a Tapestry Grid (that has a  
> surrounding zone). When paging buttons are pressed it hits  
> setupRender(). Is there a flag we can check to tell that a paging button  
> was just clicked?

No. Why do you need that?

> Second, can it call a separate Tapestry event instead of it calling  
> setupRender() ?

setupRender is invoked when the component or page is about to be rendered.  
It's not actually directly related to Grid at all.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



  

Tapestry Grid Paging

2016-03-22 Thread john c
I have added rowsPerPage to add paging to a Tapestry Grid (that has a 
surrounding zone). When paging buttons are pressed it hits setupRender(). Is 
there a flag we can check to tell that a paging button was just clicked? 
Second, can it call a separate Tapestry event instead of it calling 
setupRender() ?

John.


Re: Upgrading to 5.4 Beta 28

2015-03-30 Thread john c
This seems to work for me, and then selecting option 25:

mvn archetype:generate
-DarchetypeCatalog=https://repository.apache.org/content/repositories/staging
  From: Chris Mylonas 
 To: john c ; Tapestry users  
 Sent: Monday, 30 March 2015, 17:25
 Subject: Re: Upgrading to 5.4 Beta 28
   
In the pom.xml filenfomment out the section of yui compressor.
Are you using jumpstart 7 which is built using 5.4?




   

Re: Upgrading to 5.4 Beta 28

2015-03-30 Thread john c
I meant to write Quickstart, not Jumpstart.
Is there an archetype for 5.4 Quickstart ?

I just want to get a basic 5.4 build working to start.
  From: Chris Mylonas 
 To: john c ; Tapestry users  
 Sent: Monday, 30 March 2015, 17:25
 Subject: Re: Upgrading to 5.4 Beta 28
   
In the pom.xml filenfomment out the section of yui compressor.
Are you using jumpstart 7 which is built using 5.4?




   

Upgrading to 5.4 Beta 28

2015-03-30 Thread john c
I am attempting to switch to Tapestry 5.4 Beta 28, with the Jumpstart app. I 
modified the release version in pom.xml like below.
5.4-beta-28

After I running mvn clean install I get this error.    Have I missed something??
Thanks.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
on project testapp: Could notesolve dependencies for project 
com.test:testapp:war:1.0-SNAPSHOT: Failure to find 
org.apache.tapestry:tapesty-yuicompressor:jar:5.4-beta-28 in 
https://repository.apache.org/content/groups/staging/ was cached in the loal 
repository, resolution will not be reattempted until the update interval of 
apache-staging has elapsed orpdates are forced        at 
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencResolver.java:220)





Re: How to Declare JSONObject function ?

2014-03-21 Thread john c
I read the other example and comments, and this is what I changed:

I edited the JSON params like this (removed JSONLiteral):

options.put("start", "aaa"); 


In draganddrop.js I enclosed the function definition like this:

T5.extendInitializers(function() {
function aaa() { 
   alert(); 
} 
});

Then I changed afterRender() like this:

@AfterRender
public void afterRender()
    {
        js.importJavaScriptLibrary(as.getContextAsset("js/draganddrop.js", 
null); 
        ajaxResponseRenderer.addCallback(new JavaScriptCallback()
        {
            @Override
            public void run(JavaScriptSupport javascriptSupport)
            {
                
javascriptSupport.addInitializerCall(InitializationPriority.LATE, "aaa", new 
JSONObject());
            }
        });
    }

I don't see the Ajax error. But I also don't see the Javascript function being 
called. I was hoping to see the alert box on start drag.

Any ideas?



On Friday, 21 March 2014 4:19 AM, Boris Horvat  wrote:
 
Fir me the solution was to use ut without jsonliterl, just put the name of
the fuction without brackets

On 21 Mar 2014 04:31, "john c"  wrote:

> First, I am using the latest, Tapestry/Tapestry-JQuery versions: 5.3.7 /
> 3.3.7.
>
> I created draganddrop.js and put it under webapp/js. It has a simple
> function:
>
> function aaa() {
>    alert();
> }
>
> In Java, I added the code like this:
>
> @Inject
> private AssetSource as;
>
> @Inject
> private JavaScriptSupport js;
>
> @AfterRender
> public void afterRender() {
>     js.importJavaScriptLibrary(as.getContextAsset("js/draganddrop.js",
> null);
> }
>
> So the JavaScript should be imported (I successfully imported other js
> scripts this way)
>
> Then in the same Java class I edited the JSON params to now have:
>
> options.put("start", new JSONLiteral("aaa"));
>
> But I got the same Ajax error, communication with the server failed: null.
>
>
>
> On Thursday, 20 March 2014 11:35 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> I think this (passing a JavaScript parameter from the server side) is not
> recommended anyway. Create this function in some .js file which you
> include in your page or component then pass options.put("start", new
> JSONLiteral("nameOfTheFunction"));
>
>
> On Thu, 20 Mar 2014 10:15:05 -0300, john c  wrote:
>
> > With  you can specify the JSONObject params like
> > so: t:params="params"
> > In Java I have code like this (snippet):
> >
> > public JSONObject getParams() {
> > JSONObject options = new JSONObject();
> > ..
> > ..
> > options.put("start", "function() {$(this).hide();}");
> > return options;
> > }
> >
> > This "start" option does not seem to work as a String. I have tried
> > JSONLiteral but it failed also. I got a Ajax error, something like
> > Communication with the server failed, null.
> >
> > I also tried in the tml -- t:params="literal:{start: function()
> > {$(this).hide();}}"
> >
> > But it does not work. In both cases above I tried with arguments:
> > function(event, ui) {}, but it did not work.
> >
> > How can I declare this function ??
> >
> > Thanks.
> > Reply, Re
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org

Re: How to Declare JSONObject function ?

2014-03-20 Thread john c
First, I am using the latest, Tapestry/Tapestry-JQuery versions: 5.3.7 / 3.3.7.

I created draganddrop.js and put it under webapp/js. It has a simple function:

function aaa() {
   alert();
}

In Java, I added the code like this:

@Inject
private AssetSource as;

@Inject
private JavaScriptSupport js;

@AfterRender
public void afterRender() {
    js.importJavaScriptLibrary(as.getContextAsset("js/draganddrop.js", null);
}

So the JavaScript should be imported (I successfully imported other js scripts 
this way)

Then in the same Java class I edited the JSON params to now have:

options.put("start", new JSONLiteral("aaa"));

But I got the same Ajax error, communication with the server failed: null.



On Thursday, 20 March 2014 11:35 AM, Thiago H de Paula Figueiredo 
 wrote:
 
I think this (passing a JavaScript parameter from the server side) is not  
recommended anyway. Create this function in some .js file which you  
include in your page or component then pass options.put("start", new  
JSONLiteral("nameOfTheFunction"));


On Thu, 20 Mar 2014 10:15:05 -0300, john c  wrote:

> With  you can specify the JSONObject params like  
> so: t:params="params"
> In Java I have code like this (snippet):
>
> public JSONObject getParams() {
> JSONObject options = new JSONObject();
> ..
> ..
> options.put("start", "function() {$(this).hide();}");
> return options;
> }
>
> This "start" option does not seem to work as a String. I have tried  
> JSONLiteral but it failed also. I got a Ajax error, something like  
> Communication with the server failed, null.
>
> I also tried in the tml -- t:params="literal:{start: function()  
> {$(this).hide();}}"
>
> But it does not work. In both cases above I tried with arguments:  
> function(event, ui) {}, but it did not work.
>
> How can I declare this function ??
>
> Thanks.
> Reply, Re


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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

How to Declare JSONObject function ?

2014-03-20 Thread john c
With  you can specify the JSONObject params like so: 
t:params="params"
In Java I have code like this (snippet):

public JSONObject getParams() {
JSONObject options = new JSONObject();
..
..
options.put("start", "function() {$(this).hide();}");
return options;
}

This "start" option does not seem to work as a String. I have tried JSONLiteral 
but it failed also. I got a Ajax error, something like Communication with the 
server failed, null.

I also tried in the tml -- t:params="literal:{start: function() 
{$(this).hide();}}"

But it does not work. In both cases above I tried with arguments: 
function(event, ui) {}, but it did not work.

How can I declare this function ??

Thanks.
Reply, Re

Re: JQuery Datatable Bind Mixin

2013-09-10 Thread john c
Is there a link to some documentation or sample somewhere?



 From: Barry Books 
To: Tapestry users ; john c  
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  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: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">
>
>      ...
> 

Re: JQuery Datatable Bind Mixin

2013-09-09 Thread john c
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.




     ...


Re: JQuery Datatable Bind Mixin

2013-09-04 Thread john c
bind.callback="function(event,ui,u) 
{u.addContext(event.target.parentNode.childNodes[3].innerHTML);}"




 From: Thiago H de Paula Figueiredo 
To: Tapestry users  
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  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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Re: JQuery Datatable Bind Mixin

2013-09-03 Thread john c
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 
To: Tapestry users ; john c  
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




On Fri, Aug 30, 2013 at 2:23 PM, john c  wrote:

> Ok, here is a little more of the datatable code:
>
> 
>   t:row="currRow"
>   t:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> include="..." >
>
>   
>                      t:zone="detailZone" t:context="${thisfile.fileID}"> class="smallgridbutton"
> type="button">Requeue
>                  
>
> 
>
>
>
> 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 
> To: Tapestry users 
> 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.tapes...@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  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:mixins="jquery/bind" bind.event="datatableclick"
> > bind.eventType="click" bind.zone="theZone"
> bind.context="${currRow.fileID}"
> > > include="..." >
> > > 
> > >
> > >
> >
> ---
> > >
> > >
> > >     @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-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>

Re: JQuery Datatable Bind Mixin

2013-08-30 Thread john c
Ok, here is a little more of the datatable code:

 

  
                    Requeue
                 





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 
To: Tapestry users  
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.tapes...@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  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:mixins="jquery/bind" bind.event="datatableclick"
> bind.eventType="click" bind.zone="theZone" bind.context="${currRow.fileID}"
> > include="..." >
> > 
> >
> >
> ---
> >
> >
> >     @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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

JQuery Datatable Bind Mixin

2013-08-29 Thread john c
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?


---




---


    @Persist
    @Property
    private OutboundFile currRow;

    @InjectComponent
    private Zone theZone;


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