Re: Reading HTTP headers

2012-04-11 Thread Lance Java
I think the preferred way is to @Inject the Request (or HTTPServletRequest in rare cases)

Re: setting japanese locale in a service

2012-04-11 Thread Lance Java
Have you added jp to the list of supported locales? http://tapestry.apache.org/configuration.html#Configuration-tapestry.supportedlocales

Re: setting japanese locale in a service

2012-04-12 Thread Lance Java
Locale.JAPANESE = "ja" You will need to supply an app_ja.properties. This will also work for Local.JAPAN (ja_JP) Cheers, Lance. On Wednesday, 11 April 2012, angelochen wrote: > i did: > > configuration.add("tapestry.supported-locales", "en,zh,ru,jp"); > > a little confusion is, the doc says 'ja

Re: Issue in re-rendering the zone block

2012-04-12 Thread Lance Java
You will need to set the "encoder" attribute on your so that tapestry can serialize / deserialize the values used to poplulate the form. http://tapestry.apache.org/5.3.1/apidocs/org/apache/tapestry5/corelib/components/Loop.html I'd also try to get rid of your mutable static data (Session) in fav

Re: hibernate @Embedded

2012-04-12 Thread Lance Java
It wouldn't be too hard to write a mixin which looks for the annotation and adds to the underlying model.

Re: setting japanese locale in a service

2012-04-12 Thread Lance Java
Saying that your locale is "jp" is not really valid, you either specify your language OR you specify your language/country (eg either "ja" or "ja_JP) but never just the country as some countries speak multiple languages. en_GB and en_US will both default to "en" if a more specific message bundle c

Serving images outisde of war in tapestry

2012-04-13 Thread Lance Java
I always keep a copy of the tapestry source code handy. If I search "*Module.java" for AssetFactory I find out how tapestry adds a ContextAssetFactory and a ClasspathAssetFactory. @Marker(ContextProvider.class) public AssetFactory buildContextAssetFactory(ApplicationGlobals globals, AssetP

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
I know it's not ideal but you could deploy an exploded war.

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
So, I think that eliminates the problem that howard was mentioning on his blog. Can you paste the page / component that is trying to run? I'm trying to think of where a "jsp" component would be references inside the tapestry archetype.

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
I wonder if this has something to do with how tomcat 7 is trying to serve the root. Are you able to hit http://localhost:8080/newapp/about

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
The tapestry source code does not have a single reference to "jsp". I think that tomcat might be trying to "help" somehow.

Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
I think you've now hit this https://issues.apache.org/jira/browse/TAP5-1729 Try commenting out the following in your pom.xml org.apache.tapestry tapestry-yuicompressor ${tapestry-release-version}

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Inspect the HTTP logs, is Tomcat trying to redirect from root to some other page (index.jsp or something)? There might be some config in tomcat that you can tweak / remove.

Re: Render Queue Error in Expansion

2012-04-13 Thread Lance Java
Your ajax event handler method will need to initialize any properties that are required in the rendering block Draggables can have a "draggablecontext" attribute. Although I've not used it I'm sure that you could pass the context required to initialize your property.

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
It looks like you will need to remove all entries from the in $TOMCAT_HOME/conf/web.xml See "How do I override the default home page loaded by Tomcat?" here http://wiki.apache.org/tomcat/HowTo

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Another option might be to tell tapestry to ignore the welcome file list public static void contributeIgnoredPathsFilter(Configuration configuration) { configuration.add("(index\\.html)|(index\\.htm)|(index\\.jsp)"); } http://tapestry.apache.org/configuration.html#Configuration-ConfiguringIgno

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Please try the following: public static void contributeIgnoredPathsFilter(Configuration configuration) { configuration.add("/index\\.(?:html|htm|jsp)"); } If it works, we'll close the JIRA and put some tomcat specific documentation somewhere

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Perhaps you can override the tomcat defaults by adding an empty to your web.xml Then no tapestry config required?

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Redirect will cause an extra request and will change the URL in the browser. Try forward instead

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
How about getting rid of index.jsp and adding "index" to your web.xml in the welcome file list. I'm assuming tomcat will try your config before the default

Re: Tomcat 7 deployment TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Component Index does not contain embedded component 'jsp'.

2012-04-13 Thread Lance Java
Have you tried: Or with jstl

Re: Render Queue Error in Expansion

2012-04-13 Thread Lance Java
Create a ValueEncoder for your currentExtension Object Then use ValueEncoder.toClient(V value) to create a string which will be used in your draggablecontext. Then, in your drop event, use ValueEncoder.toValue(String value) on the context value to deserialise the Object.

Re: Render Queue Error in Expansion

2012-04-13 Thread Lance Java
Something like this: ${extension.name} ${extension.number} ${droppedExtension.name} ${droppedExtension.number} Page.java - @InjectComponent private Zone extensionZone; @Property private Item extension; @Property pri

Re: Render Queue Error in Expansion

2012-04-13 Thread Lance Java
If you want to know which dropzone received the dragabble, just pass the zone id in the context along with the extension id. I can't remember exatly how but I'm sure you can lookup zones by id by @Inject'ing the ComponentResources

Render Queue Error in Expansion

2012-04-13 Thread Lance Java
Ignore my prev post about adding the drop zone to the context as this is not associated with the draggable when the page is drawn. I think that you need a handle on the ComponentEventRequestParameters so that you can call getNestedComponentId() which will have the id of the zone which fired the ev

Re: how to get component event source?

2012-04-13 Thread Lance Java
Well... to say it's not possible is wrong. To say it's hacky is correct ;) He's using a library which doesn't pass the information and might not want to wait for a new release of the library The information is there... Worst case scenario you could @Inject the request and parse the component id f

Re: how to get component event source?

2012-04-14 Thread Lance Java
If the URL is the same then the zone id is the same. Im guessing that your droppables are defined in a loop too? (I'm talking t:id not client id) I think that the droppable mixin needs to accept a droppablecontext in a similar way to draggablecontext and the serverside event should have both conte

Re: File System Asset Factory help needed and petition wanted

2012-04-16 Thread Lance Java
The J2EE specification states that you should never read or write to the local file system. Using the local file system raises many issues including security, portability, transactions, clustering and thread safety. I don't really agree with including a FileAssetFactory in the Tapestry source as th

Re: Not serializable: org.apache.tapestry5.tree.TreeExpansionModel

2012-04-16 Thread Lance Java
I think that SeleniumTestCase should inject a Session implementation that fails when setAttribute() is called with a non-Serializable object so that we can catch this in the future

how to get component event source?

2012-04-16 Thread Lance Java
Hi Chris, the ZoneDroppable mixin is only a few lines of code https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/mixins/ZoneDroppable.java You could quite easily create another mixin by copying/tweaking the code or better yet, clone the repository and send

Re: how to get component event source?

2012-04-16 Thread Lance Java
Now I'm starting to doubt myself, I'm starting to think that the @Parameter will be null when the ajax method is invoked. You will need to pass the droppablecontext in the AJAX event URL in a similar way to how the draggablecontext is passed. https://github.com/got5/tapestry5-jquery/blob/master/s

Re: Not serializable: org.apache.tapestry5.tree.TreeExpansionModel

2012-04-17 Thread Lance Java
A simpler option could be to serialize the data to a temp OutputStream instead of checking instanceof Serializable.

Re: File System Asset Factory help needed and petition wanted

2012-04-17 Thread Lance Java
> So what would you choice be? I know that no database manifacture actually recommend to store the files into DB. Say that you have huge files, or a lot of them and your db is on another server, it is a lot of mess. Caveat: I must admit that i've never needed to deal with large blobs (eg video) be

Re: Not serializable: org.apache.tapestry5.tree.TreeExpansionModel

2012-04-17 Thread Lance Java
That just flags that you don't have enough test coverage then ;) Running through the object reflectively won't work. In the case of List the generic type is lost at runtime through type erasure.

Re: Why @EagerLoad services come before @Startup methods?

2012-04-19 Thread Lance Java
Instead of initializing your @EagerLoad service in it's constructor, you could add an init() method to the service. Then you call init() inside a @Startup method after you have initialized any dependencies. http://tapestry.apache.org/registry-startup.html Lance.

Re: Tree leaf not selectable

2012-04-19 Thread Lance Java
Hi Geoff, from what I've seen, the tree nodes don't do anything when selected. You can set the "label" parameter if you'd like to do something special. ${myTree.node.label}

Re: Why @EagerLoad services come before @Startup methods?

2012-04-20 Thread Lance Java
Mutable static data is the root of all evil ;) Statics are (almost) impossible to mock and make testing and clustering very difficult. Is there any way you could refactor your code to use a singleton service instead of the static? You could then @EagerLoad the singleton service or initialize it i

Re: Tree leaf not selectable

2012-04-20 Thread Lance Java
Are you sure that you are returning consistent values for hasChildren() and getChildren(). It sounds like you might be returning true for hasChildren() but getChildren() is returning an empty list.

Re: Make Report PDF

2012-04-23 Thread Lance Java
Funny you should mention this, I actually had a quick try at doing this myself but I got a bit stuck... here's what I learned. 1. I was trying to use this technique http://wiki.apache.org/tapestry/Tapestry5HowToGetAnHTMLStringFromARenderCommandParameterto specify a FOP parameter to a Page (or Comp

Re: Make Report PDF

2012-04-23 Thread Lance Java
I have thought of a way of doing this which only involves a couple of internal classes. 1. Create a new event response type (lets call is FopPdf) public class FopPdf { private RenderCommand fopRenderCommand; private String fileName; } 2. Create a FopPdfComponentEventResultProces

Re: problem while submitting the form

2012-04-23 Thread Lance Java
Try clearing your browser's cache See the jira for TAP5-1777

Re: problem while submitting the form

2012-04-23 Thread Lance Java
See the last comment on the issue Since this is fixed by clearing the browser cache, I'm marking this as resolved. If anyone feels strongly that Tapestry should have a better mechanism for preventing old JavaScript from hanging around after an app is upgraded to a newer Tapestry version (such as h

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.

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: 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: 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: 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

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-25 Thread Lance Java
> @Persist(PersistenceConstants.FLASH) makes nullifies Person in Persons page (listing page), thereby breaking it... This sounds like bad design if your ListPersons page is referencing an object persisted by your EditPerson page. It sounds like the flash persistance should instead be on your ListP

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

2012-04-25 Thread Lance Java
Please stop saying that there is a bug in tapestry or that tapestry is forcing bad design on you. Thiago has pointed out that he often uses a single page for create and edit. This grid issue seems to have nothing to do with that. Of course you need a property to store the current row in a grid. T

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

2012-04-25 Thread Lance Java
I agree with trsvax that avoiding session use is good. I can see that by adding appropriate onActivate / onPassivate methods to my ListPersons example, you could avoid session use. I had a quick look at the PageActivationContextWorker and from what I can see, @PageActivationContext is mandatory so

Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
Try adding the following attribute: t:mixins="renderInformals" If it works, there's a bug ;) On Wednesday, 25 April 2012, Felix Scheffer wrote: > Hi, > > i am using a BeanEditForm and added a class attribute to it, i.e.: > > > ... > > > but the class attribute does not appear in the actual h

Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
No sarcasm intended It seems that the beanEditForm needs a one-liner added to it ComponentResources.renderInformals(writer) On Wednesday, 25 April 2012, Chris Mylonas wrote: > was the sarcasm meter on that Lance? > :) - hard to tell at nearly midnight > > On 25/04/2012, at 11:

Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
It seems that BeanEditor has the same bug. Pls put that in the Jira too Might be an idea to search all components with @SupportsInformalParameters that don't call renderInformalParameters to find any others

Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
I'm happy to call a bug a bug but I shall valiantly defend my baby (tapestry) from FUD

Re: BeanEditForm does NOT support informal parameters?

2012-04-25 Thread Lance Java
Chris Mylonas > >> was the sarcasm meter on that Lance? >> :) - hard to tell at nearly midnight >> >> On 25/04/2012, at 11:22 PM, Lance Java wrote: >> >> > Try adding the following attribute: >> > t:mixins="renderInformals"

Re: Dynamic forms

2012-04-25 Thread Lance Java
BeanEditForm and BeanEditor both accept a BeanModel parameter. You will need to implement a custom BeanModel which is likely based on config stored in a database

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

2012-04-26 Thread Lance Java
I still get the feeling that you are using a single Person property instead of two. You MUST have two properties of type Person One will be used by your grid to store each row as it the grid iterates through. This MUST NOT be tied to onActivate() / onPassivate(). The other will store the Person c

Re: Extract navigation to own menu component - links stop working

2012-04-26 Thread Lance Java
Seems like it should work to me. Try viewing the HTML source for both and compare the diffs

Re: Possible to build a Table from multiple sources?

2012-04-26 Thread Lance Java
If I understand correctly, you read your data into multiple lists. To read a single record, you use the same index in each list... Correct? This sort of model often leads to a maintenance nightmare. Create a bean which represents a single row in the grid and read your data into a single list. Yo

Re: [ANN] JumpStart gets Tree From Database, With Zones example

2012-04-26 Thread Lance Java
Great work Geoff!! Thanks for all your hard work. A couple of q's 1. Is it necessary to update the "treeZone" in onLeafSelected()? 2. Both BigInteger and Integer extend Number so you could avoid the HSQLDB case by casting to Number. Cheers, Lance

Does the Tree component need to use the session?

2012-04-26 Thread Lance Java
The current tree implementation requires the session to store the TreeExpansionModel. As with most of you, I like to avoid using the session wherever possible to improve scalability and to avoid issues when a user opens multiple browser windows for the same page. In my mind, the TreeExpansionModel

Re: Does the Tree component need to use the session?

2012-04-26 Thread Lance Java
Client persistence wont get rid of the multiple window error. It will also introduce the possibility that the client has cookies disabled so nothing will work.

Re: Does the Tree component need to use the session?

2012-04-26 Thread Lance Java
I take that back... I always assumed client persistence was based on cookies. It seems it uses a request parameter... That could work but has max URL length restrictions

Re: Does the Tree component need to use the session?

2012-04-26 Thread Lance Java
> I thought client persist was via the url not cookies, but as I said I never really used it See my previous post, I was wrong > The issue is the URL gets too long Agreed, perhaps gzip compression can help there > and bookmarking is iffy since the id can change. Hopefully the URL won't be bookmar

Re: Does the Tree component need to use the session?

2012-04-27 Thread Lance Java
I'm not sure how I'd manage it either. 1. It would be nice if you could pass a "persistenceType" parameter of "session" or "client". Is that possible? 2. Is there a "hook" where you can specify how to serialize / deserialize an object to the client persistence? 3. Tree accepts an "expansionModel

Re: Live Traffic Feed

2012-04-27 Thread Lance Java
Let me rephrase your question: "I have given you absolutely no information, can you please design my website for me?" I'm not sure you will get much help that way ;)

Re: grid dont link hibernate.classic.session?

2012-04-27 Thread Lance Java
The grid is decoupled from hibernate, your implementation of "source" is tied to hibernate. tapestry-hibernate provides a service of type org.hibernate.Session and you have declared an instance of org.hibernate.classic.Session in your page.

Re: T5: ValidationException from validate event leads to ERROR level logger statement

2012-04-27 Thread Lance Java
1. Validators are designed to cause a single failure each. If you want to validate multiple things, add multiple validators to a field. http://tapestry.apache.org/forms-and-validation.html 2. Validators must throw a ValidationException in order to fail, the issue you are responding to is discussi

Re: Hibernate Search Fix

2012-04-27 Thread Lance Java
You could add this to your app module: private static class LazyFullTextSession { private HibernateSessionManager sessionManager; public LazyFullTextSession(HibernateSessionManager sessionManager) { this.sessionManager = sessionManager; } publi

Re: Does the Tree component need to use the session?

2012-04-27 Thread Lance Java
I don't think this would work, for instance the grid component persists String, Integer and Boolean. Also, if there were 2 trees in the app, they would both need the same persistence I'd prefer a component parameter. I was assuming this would require invoking tapestry's underlying persistence API'

Re: Possible n+1 hibernate bug with tapestry crud.

2012-04-28 Thread Lance Java
Geoff describes it here http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/onactivateandonpassivate/3 Basically you shouldn't do db lookups in onActivate() and should use onPrepare() instead. For this same reason, I think it's a bad idea to use @PageActivationContext with a hibern

Re: Validators of field

2012-04-30 Thread Lance Java
All fields in tapestry have a FieldValidator property @Parameter(defaultPrefix = BindingConstants.VALIDATE) private FieldValidator validate; This will either be an instance of FieldValidatorImpl for a single validator or CompositeFieldValidator if there is more than one validator on a fie

Re: Configuring pom to use .properties from root.

2012-04-30 Thread Lance Java
I'm a bit of a maven purist and I think that src/main/java is for java files only and any resource files should go in src/main/resources If you still want to do this, instead of whitelisting property files, you should blacklist *.java instead. Also, you don't need to include **/* in your second

Re: How do you feel about requiring JRE 1.6 for Tapestry 5.4?

2012-05-02 Thread Lance Java
+1 -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-do-you-feel-about-requiring-JRE-1-6-for-Tapestry-5-4-tp5679713p5679911.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To uns

Re: Sidepanel with pagespecific items

2012-05-02 Thread Lance Java
The example here http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent shows how to use the delegate component to have a default "left" block which can be overridden. -- View this message in context: http://tapestry.1045711.n5.nabble.c

Re: Sidepanel with pagespecific items

2012-05-02 Thread Lance Java
I'm not 100% exactly what you're trying to do but it sounds like you should make components for the bits you want to re-use and then pass a block parameter to the layout. Take a look at the RenderCommand class too. This is a way of providing markup programatically and it may make sense for you to

Re: Sidepanel with pagespecific items

2012-05-02 Thread Lance Java
Given your example... The Simulation and Dashboard pages could implement PolicyProvider Then, in your Layout public class Layout { @InjectPage private Page page; public Policy getPolicy() { if (page instanceof PolicyProvider) { return ((PolicyProvider) page).getPolicy();

Re: Can Component Template be Informed by Page Class

2012-05-02 Thread Lance Java
It might be possible but it's not recommended ;) Can you just pass a property from the page to the layout? http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent

Re: Can Component Template be Informed by Page Class

2012-05-02 Thread Lance Java
I totally agree with Thiago... you are trying to break tapestry's (very sensible) principles. Take a look at the link I sent you originally... pass a component parameter (not a request parameter) from the page to the layout or use the Environment. On 2 May 2012 21:06, netdawg wrote: > OK...I th

Re: Help with Dynamic Number of Form Elements

2012-05-03 Thread Lance Java
Lets assume your application looks like this: public class QuestionAndAnswers { private Question question; private List possibleAnswers; } public class AnsweredQuestion { private Question question; private Answer answer; } public interface WebService { public List getQuiz(String q

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
You should be able to use two bindings together like this: public String getValidators() { StringBuilder validators = new StringBuilder("a,b,c"); if (required) { validators.append(",required"); } return validators.toString(); } -- View this message in context: http://tapest

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
Hmm... try validate="prop:validate:validators" -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683113.html Sent from the Tapestry - User mailing list archive at Nabble.com. ---

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
Another option is: @Inject Field textField; @Inject FieldValidatorSource fieldValidatorSource; public FieldValidator getValidators() { StringBuilder validators = new StringBuilder("a,b,c"); if (required) { validators.append(",required"); } fieldValidatorSource.createValidators

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
I think that the "var:" binding is a bit of an edge case and I think it's best to avoid it. I've never needed it and have always managed to get by with component properties. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-tim

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
In your example, you are reading from the textfield's render variables (using var:) but you are storing on the page's render variables (resources.getPage().getComponentResources().storeRenderVariable()) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-F

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
Correction: In your example, you are reading from mycomponent's render variables but are writing to the page's render variables. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683292.html Sent from the Tapes

Re: Is it possible to add Field validators at render-time?

2012-05-03 Thread Lance Java
1. What is the value of resources.getComponentModel().getEmbeddedComponentIds(); 2. Try afterRenderBody() instead of beforeRender() -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683326.html Sent from the Tap

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Lance Java
Netdawg, this is not the first time you've come on the list, been given good advice, ignored it and done your own hacky thing This blog post of yours is ignoring every piece of advice you were given on the list http://crudsqbe.wordpress.com/2012/04/29/tapestry I can understand thiago's frustratio

Re: Is it possible to add Field validators at render-time?

2012-05-04 Thread Lance Java
There was a slight typo in my solution before (I used @Inject instead of @InjectComponent) Is there something stopping you from doing this in your component? public class MyComponent { @InjectComponent private Field textField; } -- View this message in context: http://tapestry.1045711.n5

Re: Can Component Template be Informed by Page Class

2012-05-04 Thread Lance Java
I've just gone through the thread here http://tapestry.1045711.n5.nabble.com/Pagelink-above-grid-picks-up-context-from-last-pagelink-in-grid-td5660049.html And I've taken out a few comments: --- Can I see the serverside code for your edit page? I get the fe

Re: Is it possible to add Field validators at render-time?

2012-05-04 Thread Lance Java
setupRender() will not be called on form submission http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen I'm still not sure I entirely understand what it is that you are doing but perhaps you need to put your logic in onActivate() -- View this message in contex

Re: Is it possible to add Field validators at render-time?

2012-05-04 Thread Lance Java
The onPrepare() event will be fired in both cases (rendering the form and submitting the form). -- View this message in context: http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5685917.html Sent from the Tapestry - User mailing list archive at

Re: Getting Session State Object from another servlet alongside Tapestry

2012-05-09 Thread Lance Java
Instead of implementing a HttpServletRequestFilter that is not managed by tapestry, you could contribute a org.apache.tapestry5.services.RequestFilter instead. In your AppModule add the following public void contributeRequestHandler(OrderedConfiguration configuration) { configuration.

tapestry-push - proof of concept

2012-05-09 Thread Lance Java
Hi guys, I've been thinking about a "push" component for a while and I thought I might make a start when I got some free time. I will be using an abstraction on top of DWR's reverse ajax to achieve this. Basically, it will look something like this: ItemsComponent.tml ${i

Re: tapestry-push - proof of concept

2012-05-09 Thread Lance Java
Interesting to know you are thinking about push for tapestry. I know that DWR have done quite a bit of work to abstract the underlying mechanism for push (comet / polling / piggyback), do you think that you would roll-your-own push mechanism or do you have a library in mind? -- View this message i

Re: tapestry-push - proof of concept

2012-05-09 Thread Lance Java
I see... I might keep going with the DWR approach then. So If I understand your proposal. 1. Use the incoming page request (& component resources) to generate a URL. Should this URL be to "activate" to component or to do the actual work (eg "doPush" in my example)? 2. In the asynchronous event (n

Re: Null Pointer Exception

2012-05-09 Thread Lance Java
I think you might be explicitly calling close() on the response outputstream somewhere in your code which you shouldn't do. It's the servlet container's responsibility and I think it's failing when tomcat is trying to close() a stream that has already been closed. I could be wrong too ;)

Re: Null Pointer Exception

2012-05-10 Thread Lance Java
I hastily jumped to the conclusion that it was your code which was calling close(). It could also be a bug in Tapestry. As I said before, I could be wrong but this sounds like a strange issue that I have had in the past. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Null-

<    9   10   11   12   13   14   15   16   17   >