Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread Lance Java
Can I see the serverside code for your edit page? I get the feeling that onPassivate() is being called on the edit page and returning an id persisted in the session.

Alerts component and Duration.SINGLE

2012-04-24 Thread Poder, Jacob
Hello, I'm using the AlertManager service along with the Alerts component to display messages. For non ajax requests it behaves like I prefer, but for ajax requests messages are appended to the alerts list and old ones are only cleared when the whole page is refreshed. This is of course

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread netdawg
package org.pacificcis.piko.pages.person; import org.hibernate.Session; import org.pacificcis.piko.entities.Person; import org.pacificcis.piko.pages.Persons; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.PageActivationContext; import

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread netdawg
Commenting out onPassivate does not help. Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5661333.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread netdawg
Neither does this work... Object onPassivate() { return new Person(); } Only context=0. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-tp5660049p5661353.html Sent from the Tapestry - User mailing

ioc.Registry Exception Failed Coercion of css to Entity Id type java.lang.Long

2012-04-24 Thread netdawg
For some reason, HTTP request to edit/create page of the entity results in attempted coercion of the word css into the Id parameter (type Long) of the entity -- application workflow seems normal though. Just plenty of vomit in jetty console log...shown below. S T A C K T R A C E

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread Lance Java
I think you want flash persistence rather than the longer lived default session persistence @Persist(PersistanceConstants.FLASH)

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread Lance Java
I have not used @PageActivationContext but the javadoc states that it performs onPassivate() automatically

Re: tynamo resteasy and JDO objects

2012-04-24 Thread Paulo Andrade
I don't think jdo matters as well. Just trying using POJOs and annotations are ignored as well. However, I did discover that annotations are only ignored when I ask for application/json, for application/xml everything seems to be working. Am I mistaken to think that the @Xml* annotations would

Re: ioc.Registry Exception Failed Coercion of css to Entity Id type java.lang.Long

2012-04-24 Thread Lance Java
I think you might be having a name clash with a page name and a CSS file name in the same folder and tapestry is thinking it's an event URL to the page instead of a CSS path. Solution: name the CSS file differently or move it to a different folder

Re: ioc.Registry Exception Failed Coercion of css to Entity Id type java.lang.Long

2012-04-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 Apr 2012 06:45:03 -0300, Lance Java lance.j...@googlemail.com wrote: I think you might be having a name clash with a page name and a CSS file name in the same folder and tapestry is thinking it's an event URL to the page instead of a CSS path. Solution: name the CSS file

Re: How to use messages without @Inject?

2012-04-24 Thread Beat Durrer
You could overwrite the FieldValidatorSource and the FieldValidatorImpl, which is responsible for creating validator instances, so that it . Or you use this hack in your Validator. It uses the message object of the current field: public void validate(Field aField, Integer aConstraintValue,

Re: How to use messages without @Inject?

2012-04-24 Thread Lance Java
Tapestry has already passed an instance of MessageFormatter to you in the Validate method. Use this instead of the Messages directly as the actual message key is dependent on the field being validated. Download the tapestry source and take a look at an existing Validator (eg Required)

Re: How to use messages without @Inject?

2012-04-24 Thread pradeepchy
You need to use an additional constructor in the Custom validator class. public MyPasswordValidator() { super(null, String.class, msg-key); } Where msg-key is the key for the validation message displayed on the the field. You can put this key in ValidationMessages.properties file. --

Re: ioc.Registry Exception Failed Coercion of css to Entity Id type java.lang.Long

2012-04-24 Thread Howard Lewis Ship
Most likely, your template has a relative path to it ... you've done: link rel=stylesheet src=css/site.css/ That works great inside a static page, where you know exactly what the browser URL is going to be. In Tapestry, once you add page activation contexts, various folders, and other mappings

Re: Best place to put application/page parameters?

2012-04-24 Thread Rural Hunter
Sorry I thought this was a very basic question. Anyone? ?? 2012/4/23 17:33, Rural Hunter : Hi, We put parameters in context parameters or servlet parameters web.xml for normal java web application. But where is the best place to put application or page parameters in tapestry? is it a

Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread Chris Mylonas
Hello! I just read Howard's response in regards to using Tapestry's ${context:css/blah.css} stuff so T5 handles the stuff as an Asset. Is this a concept that people generally do not use because they know of other ways of handling assets (i.e. insert relative paths), or is it new in T5? It

Re: Best place to put application/page parameters?

2012-04-24 Thread Lance Java
There is no silver bullet solution for this and it's a matter of taste. Tapestry has a number of built in SymbolProviders. You can specify a combination of system properties, init-params to the tapestry filter, factory defaults and application defaults http://tapestry.apache.org/symbols.html If

Tapestry-jQuery

2012-04-24 Thread arterzatij
Hi all, Just a quick question, how do I do to make dinamic content in an accordion component. Thanks! -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-jQuery-tp5662365p5662365.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Best place to put application/page parameters?

2012-04-24 Thread trsvax
There are several ways of doing this and I don't think there is any consensus. Personally I don't like storing things in text/xml files because you can't refactor them. Symbol providers are final and Strings if that works for you (but are run thru Type Coercion) I prefer to use Environmental

Re: Tapestry-jQuery

2012-04-24 Thread Chris Mylonas
Hi, Using this demo: http://jqueryui.com/demos/accordion/ I would take a guess to put an ${accordionPage1} within the first p tags in the tml below. and in the java file have a getAccordionPage1(){ return Some text goes here ;} You can then take it further and get down into your lower layers

Re: Best place to put application/page parameters?

2012-04-24 Thread Rural Hunter
ok, thanks a lot. I don't care if it has to be in my own properties file or not. I just want it easy to edit/chage. Now I work this way with your hint: 1. define the parameter as context-param in web.xml, eg. myParam 2. inject it in my page class: @Inject @Value(${myParam}) String myParam;

Re: Tapestry-jQuery

2012-04-24 Thread arterzatij
Hi, I actually did in this way an it works, but I want to use the jquery accordion provided on Tapestry-Jquery... div id=accordion t:loop t:source=nodes t:value=node # ${node.name} div ul

Re: Best place to put application/page parameters?

2012-04-24 Thread Howard Lewis Ship
I prefer to narrow things down to one system property: the Tapestry execution mode: http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes This determines which Tapestry IoC modules(s) will be loaded. The modules make contributions to the @ApplicationDefaults and

Re: Tapestry-jQuery

2012-04-24 Thread Chris Mylonas
That last email was all tapestry5-jquery. It was a copy of the jqueryui.com demo as an example. All you have to do is substitute where h3 begins with your loop. HTH :D On 25/04/2012, at 1:43 AM, arterzatij wrote: Hi, I actually did in this way an it works, but I want to use the jquery

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread trsvax
For modules you really have to use Assets because you need to serve them from the classpath. For an app you could just hard code paths but it's harder than using Assets because you have to deal with the context plus they handle compression, expires etc. Lastly you can override the url lookup part

Re: Best place to put application/page parameters?

2012-04-24 Thread Rural Hunter
Thanks for the info Howard. Actually my requirement is like this: my application generates reporting files in doc/pdf format. I need to set a path where to store the generated reporting files. It maybe different when the app is deployed on different servers. So I think the execution mode way

Re: Best place to put application/page parameters?

2012-04-24 Thread arterzatij
That kind of config I prefer to do it by db and handle them by page config, Just an opinion :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Best-place-to-put-application-page-parameters-tp5658805p5662525.html Sent from the Tapestry - User mailing list archive at

Re: Best place to put application/page parameters?

2012-04-24 Thread Howard Lewis Ship
That's another advantage of configuration in Java code ... you can put more complex decisions about these things in code, such as looking at the hostname to decide symbol defaults. On Tue, Apr 24, 2012 at 9:04 AM, Rural Hunter ruralhun...@gmail.com wrote: Thanks for the info Howard. Actually my

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread Chris Mylonas
Sound reasoning to do it the right way :) On your last point re: CDN delivery - I only found this http://tapestry.1045711.n5.nabble.com/Referencing-external-assets-td4346215.html There's no further mention of CDN/Asset overrides in the tapestry documentation for Assets There's a JIRA here

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread trsvax
While it seems like a good idea (and believe me I've tried) to have one page handle create/update it turns out that many things conspire to make this more difficult than it seems and I've just returned to having a PersonNew and a PersonEdit. The first problem is if you use @Persist like you are

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread trsvax
You can override AssetPathConverter -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-s-css-js-coming-from-other-languages-frameworks-tp5662291p5662599.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread Chris Mylonas
awesome quote: ... This is the hook needed to make use of a Content Delivery Network... http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/AssetPathConverter.html Thanks On 25/04/2012, at 2:34 AM, trsvax wrote: You can override AssetPathConverter -- View this

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread Lance Java
Did you try flash persistence as I suggested earlier? Flash persistence only stores in the session momentarily so that state can be maintained through a redirect after post.

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread trsvax
Flash will change it but I don't think it will fix it. For example if you go to editPerson/5 and then save, Person 5 will be in the session and you return to Persons Now press new and you go to editPerson The first read will return Person 5 but what you want is a blank form. It's possible to

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread Chris Mylonas
https://code.google.com/p/corner/source/browse/corner3/trunk/src/main/java/corner/asset/services/impl/CDNAssetPathConverterImpl.java Excuse my lack of knowledge up in these levels of tapestry stuff, but... In this example - does it mean that all assets will be delivered from CDN, or that can be

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread trsvax
I think that example serves everything from a CDN but you can do pretty much anything you like. I have one that checks S3 and if the Asset is there is serves it via cloudfront. If it's not there it schedules a copy just serves the Asset locally. This way you just deploy and all your Assets

Re: Tapestry's css/js coming from other languages/frameworks

2012-04-24 Thread Chris Mylonas
cross that bridge when i need to i guess :) sounds pretty cool, thanks for clarifying stuff cheers chris On 25/04/2012, at 3:02 AM, trsvax wrote: I think that example serves everything from a CDN but you can do pretty much anything you like. I have one that checks S3 and if the Asset is there

Re: tynamo resteasy and JDO objects

2012-04-24 Thread Paulo Andrade
Yes I was. Jackson has @Json* annotations for json output. On Apr 24, 2012, at 10:43 AM, Paulo Andrade wrote: Am I mistaken to think that the @Xml* annotations would also influence the JSON output?

Re: Best place to put application/page parameters?

2012-04-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 Apr 2012 11:52:46 -0300, Rural Hunter ruralhun...@gmail.com wrote: Sorry I thought this was a very basic question. Anyone? I'd say configuration symbols. 于 2012/4/23 17:33, Rural Hunter 写道: Hi, We put parameters in context parameters or servlet parameters web.xml for

Re: Best place to put application/page parameters?

2012-04-24 Thread Giulio Micali
the best solution I found in order to point on external folders (generally on J2ee, not Tapestry specific) without a fixed or a common base path is a deployment plan in Weblogic. Basically, you put in web.xml one(or more) env-entry with a fixed key and your path(or url, or every config value) as

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread yazdog8
Tried several pre-compilation tricks as well, and it still renders things out as text, and I think that's a result of the CDATA being XML whereas that data is rendered and read differently in the browser. I have read Mr. Shipp's blog about JS and the 5.4 release. I would love to know more about

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread yazdog8
So...been experimenting more...and from the fine folks at Stack Overflow...this solution for pulling HTML out of CDATA. Fine point, it has to be CDATA and not the JS/CSS commented CDATA. You will then have to unescape the content before compiling with Handlebars.compile. var

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread trsvax
I'd create a component so you can do something like this t:handlebars id=entry-template p:template /p:template /t:handlebars Then use something like this to write out the script tag

Re: Temporary input fields in beaneditform?

2012-04-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 Apr 2012 08:34:56 -0300, membersound memberso...@web.de wrote: I would like to create a temporary input field, and use it for validating of a password. Check the add parameter of BeanEditForm (and BeanEditor) in its documentation. Regarding validation, check the validation

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 Apr 2012 17:26:09 -0300, trsvax trs...@gmail.com wrote: You still need the CDATA but I'd say the benefits of tml files being valid XML easily out weight the drawbacks. Agreed. In addition, to support other formats besides XML, we would need to write a parser for it. Not easy,

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread trsvax
Something like this was on my TODO list. I wanted to pass scripts via p:script /p:script So here it is. public class Handlebars { @Parameter(required = true) private RenderCommand template; @Parameter(defaultPrefix = literal) private String id;

Re: Tapestry and inline Handlebars.js

2012-04-24 Thread yazdog8
Thanks. I'll give it a shot and report back. I still think there has to be a better way to handle client side templating, and one that should be baked into the system. If 5.4 is going to support more MVC style JavaScript, this is going to get a lot of use. -- View this message in context:

Recommended method to reference assets in .css file?

2012-04-24 Thread David Rees
What's the recommended method to reference assets in a .css file - for example background images? Currently I use a hard-coded relative URL, but this has the drawback of causing the browser to cache the resource after it's changed leading to browsers caching old resources unless I change the name

Re: Recommended method to reference assets in .css file?

2012-04-24 Thread Chris Mylonas
Hi Dave, Good question - I don't know about from within a CSS file. However within a template it offers this: img src=${asset:context:image/tapestry_banner.gif} alt=Banner/ from this page: https://tapestry.apache.org/assets.html image/tapestry_banner.gif lives in

Re: Recommended method to reference assets in .css file?

2012-04-24 Thread yazdog8
If you're using Less CSS (or maybe sass possibly), you can set some basic variables at the top of your file that can be used as a cache buster in your paths. http://lesscss.org/#-variables -- View this message in context:

Re: Recommended method to reference assets in .css file?

2012-04-24 Thread David Rees
On Tue, Apr 24, 2012 at 4:04 PM, Chris Mylonas ch...@opencsta.org wrote: Good question - I don't know about from within a CSS file. ... Looking into the tapestry source, specifically   src/main/resources/org/apache/tapestry5/tapestry-console.css it uses relative links to the pics in

Re: Pagelink above grid picks up context from last pagelink in grid

2012-04-24 Thread netdawg
Thanks, guys. LANCE: @Persist(PersistenceConstants.FLASH) makes nullifies Person in Persons page (listing page), thereby breaking it... THIAGO: return person.getId() breaks the Edit Page completely with Render queue error in BeginRender... Here is probably the clincher that this is a bug or

Re: ioc.Registry Exception Failed Coercion of css to Entity Id type java.lang.Long

2012-04-24 Thread netdawg
Aha. Thanks, Howard. Makes sense. That is probably what was going on. I am, however, using the context: in all my templates and corresponding java classes, as intended. And, for the life of me, I am unable to trap the issue any longer. The logs seem to be free of it last time I checked