tapestry-hibernate and mysql console

2012-11-05 Thread angelochen
Hi, a T5 app uses tapestry-hibernate to display some pages, when I updated some fields in mysql console, commit, and close the mysql console, and go back to t5 app, some times the changes are not reflected, in fact, there are times when I checked the mysql again, the data was still there, got some

Re: onPrepare from grid?

2012-11-05 Thread Lance Java
You can attach a mixin to any component and hook onto the component's render phases. By default, the mixin lifecycle phases will fire before it's containing component which can be switched by adding the @MixinAfter annotation. http://tapestry.apache.org/component-rendering.html http://tapestry.apa

Re: injecting the currently logged in user

2012-11-05 Thread Ulrich Stärk
I played around with a few of the options I outlined and in the end chose the FieldConduit approach that Lenny suggested. The base is a service called CurrentUserSource which has a single method getUser() that does if(!securityService.isAuthenticated()) return null; Long id = (Long) securit

Re: tapestry-hibernate and mysql console

2012-11-05 Thread Taha Siddiqi
Hi Angelo Yes this is not related to Tapestry. Hibernate caches the results for efficiency(there are different levels of caches involved) and so what you do directly with the database may not be updated in the cache for a while depending on the cache configuration. My advice would be not to up

Testing of classes with injected resources?

2012-11-05 Thread membersound
Hi, how can I JUnit test a class within a Tapestry application? I mean: a class where I make eg use of tapestry service bindings and @Inject my own services there. In the docs I just found how to test components and pages, but I want to directly test against my business classes... Thanks -- Vi

Re: is there a doc describing Tapestry built-in services?

2012-11-05 Thread Geoff Callender
You've inspired me. http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/services On 02/11/2012, at 4:09 AM, Bob Harner wrote: > I agree with Rural that there is a need for a list of some kind. > > As a partial solution, the Javadoc package summary pages list of mo

Re: Testing of classes with injected resources?

2012-11-05 Thread Taha Siddiqi
Hi You can create your registry and then access the registered services. Registry registry; public void setup(){ RegistryBuilder builder = new RegistryBuilder(); builder.add(AppModule.class); IOCUtilities.addDefaultModules(builder); registry = builder.build();

Quick coloring for grid rows text?

2012-11-05 Thread membersound
Hi, how can I apply simple coloring for a grid row text? Let's say an amount that should be green (+) or red (-)? Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Quick-coloring-for-grid-rows-text-tp5717652.html Sent from the Tapestry - User mailing list archive a

Re: Quick coloring for grid rows text?

2012-11-05 Thread Taha Siddiqi
Hi Use Grid's rowClass parameter public String getRowClass(){ return amount < 0 ? redColoredClass : greenColoredClass; } regards Taha On Nov 5, 2012, at 6:03 PM, membersound wrote: > Hi, > > how can I apply simple coloring for a grid row text? Let's say an amount > that should be green (+

ajaxResponseRenderer in event

2012-11-05 Thread nquirynen
Hi, I have a problem with executing some javascript after an ajax call to a tapestry event. *Test.class* public class Test { @Inject private ComponentResources componentResources; @Inject private AjaxResponseRenderer ajaxResponseRenderer;

Re: ajaxResponseRenderer in event

2012-11-05 Thread Charlouze
Can you send the client code that handle the request ? IMHO, I think that you forget to process json response, I have already done that mistake a lot of time. 2012/11/5 nquirynen > Hi, > > I have a problem with executing some javascript after an ajax call to a > tapestry event. > > *Test.class*

Re: ajaxResponseRenderer in event

2012-11-05 Thread Lance Java
You are using $.get() to get an eventlink URL and you are doing nothing with the response. The default tapestry implementation (prototype) has a ZoneManager.processReply() which is used to process an event response. It looks like you are using tapestry-jquery so you will need to find the equivale

Re: tapestry-hibernate and mysql console

2012-11-05 Thread angelochen
you are right, unexpected behavior, it even writes back some value which I set to null directly, of course this is for some testing app. Taha Hafeez wrote > Hi Angelo > > Yes this is not related to Tapestry. Hibernate caches the results for > efficiency(there are different levels of caches invol

Re: ajaxResponseRenderer in event

2012-11-05 Thread nquirynen
I have no client code, so yea that's why it probably doesn't work... First my code was like this: I had a callback function on the ajax request in my .tml: which works. But I wanted to remove javascript from my .tml files and while doing this I thought AjaxResponseRenderer.addCallback would ac

Re: ajaxResponseRenderer in event

2012-11-05 Thread Charlouze
If you can't use the zonemanager.processReply function defined by tapestry, you will have to handle the response yourself. You really should take a look at the tapestry.js file to see what this function does. 2012/11/5 nquirynen > I have no client code, so yea that's why it probably doesn't wor

Re: ajaxResponseRenderer in event

2012-11-05 Thread nquirynen
I think I found it: *$.tapestry.utils.loadScriptsInReply(r);* I put this in the ajax request callback function and looks like its working now. So now my Test page code looks like: public class Test { @Inject private ComponentResources componentResources;

Re: Quick coloring for grid rows text?

2012-11-05 Thread membersound
Ok but this would apply coloring to the whole row. I'd just like to color a the specific output text of the property amount, but not the whole row neither other values. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Quick-coloring-for-grid-rows-text-tp5717652p5717661.ht

Grid Ajax Failiure with Pagination.

2012-11-05 Thread mateen
Hi, I have created a simple that submits and ajax renders a form. This fails with two causes. First my code ` View <#> Here is my backing java class public class

Re: Quick coloring for grid rows text?

2012-11-05 Thread Taha Siddiqi
Then override that column in the grid ${amount} On Nov 5, 2012, at 8:28 PM, membersound wrote: > Ok but this would apply coloring to the whole row. > I'd just like to color a the specific output text of the property amo

Re: Quick coloring for grid rows text?

2012-11-05 Thread membersound
Ok cool I see. Is it further possible to apply some "custom renderer" to an amount class, let's say add a (-) in front of all negative values? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Quick-coloring-for-grid-rows-text-tp5717652p5717664.html Sent from the Tapestry

Re: onPrepare from grid?

2012-11-05 Thread Thiago H de Paula Figueiredo
On Sun, 04 Nov 2012 14:55:53 -0200, membersound wrote: Hi, Hi! can I specify a onPrepareFromGrid() method somehow? I tried onPrepareFromMygrid() { sysout("never gets called"); } Can't I assign a onPrepare method only to a specific grid? No, Grid doesn't trigger any such event. Why

Re: Quick coloring for grid rows text?

2012-11-05 Thread Thiago H de Paula Figueiredo
On Mon, 05 Nov 2012 13:46:28 -0200, membersound wrote: Ok cool I see. Is it further possible to apply some "custom renderer" to an amount class, let's say add a (-) in front of all negative values? See the BeanEditForm documentation in the Tapestry home page and provide your own viewing

Re: onPrepare from grid?

2012-11-05 Thread Charlouze
Hey, I needed a similar behavior and you just need this mixin : public class Prepare { @Parameter private Object[] context; @Inject private ComponentResources componentResources; void setupRender() { componentResources.triggerEvent("prepare", context, null); } }

Show and hide fields based on boolean dynamic property?

2012-11-05 Thread membersound
Hi, how can I show and hide files of a based on a boolean variable within the object that is displayed? class Car { boolean flag; String name; } How can I tell Tapestry to only display the name is flag is marked. And if I uncheck the checkbox in beanEditor, I want the name to disappear.

Re: Quick coloring for grid rows text?

2012-11-05 Thread membersound
Are you talking about thinks like ? That's what I meant, just omited the p-tags. Or are there other "viewing blocks" of what you mentioned? (http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html) -- View this message in context: http://tapestry.1

Re: Quick coloring for grid rows text?

2012-11-05 Thread Thiago H de Paula Figueiredo
On Mon, 05 Nov 2012 14:49:43 -0200, membersound wrote: Are you talking about thinks like ? No. That's what I meant, just omited the p-tags. Or are there other "viewing blocks" of what you mentioned? (http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/BeanEd

Re: Show and hide fields based on boolean dynamic property?

2012-11-05 Thread Thiago H de Paula Figueiredo
On Mon, 05 Nov 2012 14:43:46 -0200, membersound wrote: Hi, Hi! how can I show and hide files of a based on a boolean variable within the object that is displayed? You need to use provide a BeanModel for that. Besides that, just pretty boring Java logic. -- Thiago H. de Paula Figueire

Re: ajaxResponseRenderer in event

2012-11-05 Thread Alex Kotchnev
There was a bug in tapestry-jquery not too long ago that wasn't processing the scripts on ajax events - make sure that you're on the latest tapestry-jquery version. Cheers - Alex K On Mon, Nov 5, 2012 at 9:28 AM, nquirynen wrote: > I think I found it: > > *$.tapestry.utils.loadScriptsInReply(r);

t:if to include a page

2012-11-05 Thread mateen
Hi, I login the user and on the second page i have various roles. Each roles corresponds to certain action that is unique to that role and also common functionality. Now on the second page, i want to include pages based on the users permission. I want to basically show or hide certain parts of t

Re: ajaxResponseRenderer in event

2012-11-05 Thread Howard Lewis Ship
You'll like this in 5.4 better; the page initialization JSON is buried in a new key and handled automatically for you; it can now piggyback on any JSON Object response, not just the standard partial page render response. On Mon, Nov 5, 2012 at 5:09 AM, Charlouze wrote: > Can you send the client

Get and set global beans ?

2012-11-05 Thread mateen
Hi, I am creating a simple application where a user logs in. On the next and all subsequent pages, i want to display the user information. How can i set and then read the values of these beens both in the view as well as the backing java file ? Kind Regards -- View this message in context: h

Re: Get and set global beans ?

2012-11-05 Thread Thiago H de Paula Figueiredo
On Mon, 05 Nov 2012 16:21:59 -0200, mateen wrote: Hi, Hi! I am creating a simple application where a user logs in. On the next and all subsequent pages, i want to display the user information. How can i set and then read the values of these beens both in the view as well as the backing

Re: t:if to include a page

2012-11-05 Thread Thiago H de Paula Figueiredo
On Mon, 05 Nov 2012 16:04:00 -0200, mateen wrote: Hi, Hi! I login the user and on the second page i have various roles. Each roles corresponds to certain action that is unique to that role and also common functionality. Now on the second page, i want to include pages based on the users per

Problems integrating backbone.js with T5.3.6

2012-11-05 Thread Kristian Marinkovic
Hi, i need some advice on how to properly integrate backbone.js in my T5 application. Adding backbone.js with the @Import annotation results in an console error because it can't find the global underscore object _. The reason for that is the mapping of underscore to the T5 namespace in t5-core.js

Re: Problems integrating backbone.js with T5.3.6

2012-11-05 Thread Howard Lewis Ship
I had to put in place a shim before the import of backbone, to fix this: /** * T5 is nice enough to use Underscore in noConflict() mode, but Backbone expects it to be visible as window._, so we hack that. */ window._ = T5._; On Mon, Nov 5, 2012 at 11:35 AM, Kristian Marinkovic < kristian.marin

Re: Problems integrating backbone.js with T5.3.6

2012-11-05 Thread Howard Lewis Ship
Needless to say, this will not be a problem in 5.4. On Mon, Nov 5, 2012 at 11:47 AM, Howard Lewis Ship wrote: > I had to put in place a shim before the import of backbone, to fix this: > > /** > * T5 is nice enough to use Underscore in noConflict() mode, but Backbone > expects it to be visible

Re: Problems integrating backbone.js with T5.3.6

2012-11-05 Thread Kristian Marinkovic
i knew that would come :) i 'm watching the progress closely; it'll be a great leap forward in developing js heavy applications. sometimes there is an easier solution... i just added window._ = T5._ into my copy of backbone.js. i think i was looking to hard to add it without modifying the origina

Re: onPrepare from grid?

2012-11-05 Thread Chris Poulsen
Out of interest: Aren't you just renaming the setupRender event here? Or does this approach allow some nifty things that are not possible using the ordinary events? -- Chris On Mon, Nov 5, 2012 at 5:24 PM, Charlouze wrote: > Hey, > > I needed a similar behavior and you just need this mixin : >

Re: T5 and AppEngine 1.7.3 dev server IllegalStateException

2012-11-05 Thread Alex Kotchnev
Correction, this issue seems to have shown up w/ GAE 1.7.2 instead of 1.7.3 . Reverting the appengine sdk to version 1.7.1.1 resolves the issue whereas staying w/ 1.7.2 does not. Cheers - Alex K On Mon, Nov 5, 2012 at 11:35 PM, Alex Kotchnev wrote: > I was migrating an older application running

Re: onPrepare from grid?

2012-11-05 Thread membersound
setupRender is invoked for the whole page. I have 2 different grids (and thus 2 different models) to be displayed at once on a single page. And therefore would like to catch from which table the "refresh" comes (on..FromTable or so). -- View this message in context: http://tapestry.1045711.n5.n