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

2012-05-03 Thread wout86
Hi, Well, passing a parameter to the field to configure its validator is exactly what I'm trying to do. The fields I need already take a parameter for this purpose (i.e., t:validate), so it doesn't seem useful to extend them to use Environmentals instead. The issue here is that t:validate works w

Re: T 5.2.6 EventLink and confirm box

2012-05-03 Thread resign
hi, sorry was not at home :-) I made it an other way. I use jQuery at all, so i creeated a dialog with two buttons yes/no and let them fire events CANCEL oder REMOVE. easy :-) Thanks for help resign -- View this message in context: http://tapestry.1045711.n5.nabble.com/T-5-2-6-EventLink-

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread netdawg
Thanks, for chiming in, Howard. Somewhat gratified by your perspective as this being more like "shades-of-grey" rather than "black-and-white". May be I should have asked differently...bit upset with the group, though, for asking me to post code and then essentially ignoring it, even maligning

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Howard Lewis Ship
There's doing things a little different, and then there's driving on the wrong side of the road ... on the highway. There's specific reasons for many of the constraints in Tapestry, often related to efficiency, security, encouraging users to create maintainable code, or simply general correctness.

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread netdawg
All:Again, I appreciate the inputs, efforts and suggestions, even good advice. And, if someone does something differently, it is not "hacky". The blog post, BTW, was for you specifically for your constructive comments. I was inspired to do that since we were just waving hands on this forum

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

2012-05-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 May 2012 16:01:25 -0300, wout86 wrote: Thiago, Hi! I want to apply the same logic that's applied when using a Page property in a tml to output text: I want to use a component's property (render variable in this case) in its body to set the validator for a field in this body.

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 May 2012 15:49:19 -0300, netdawg wrote: Good grief. O well, that is probably more oxygen for others. Thanks for you inputs nevertheless - the ones with substance, anyway. As for "wink, wink, we are already doing magic" - it borders on delusional - suggesting some sort of ins

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Robert Zeigler
You /do/ realize that Thiago has already spent considerable time trying to help you? In any event, your conceptual understanding of Tapestry seems a bit off. Not trying to be mean, just stating fact. For instance: "Basically, is there is a way for a component to "inherit" properties of child co

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-03 Thread wout86
Thiago, I want to apply the same logic that's applied when using a Page property in a tml to output text: I want to use a component's property (render variable in this case) in its body to set the validator for a field in this body. That doesn't seem too wrong to me, does it? -- View this message

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread netdawg
Good grief. O well, that is probably more oxygen for others. Thanks for you inputs nevertheless - the ones with substance, anyway. As for "wink, wink, we are already doing magic" - it borders on delusional - suggesting some sort of inside clique that is bullying everyone else - helping some and

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Thiago H. de Paula Figueiredo
I officially give up. You're using wrong definitions of concepts, and the consequence is that just you will understand what you're talking about. And you can't read my mind to know what I'm thinking. You have proven nothing beyond the fact that you don't know what polymorphism is. In a comp

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

2012-05-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 May 2012 13:33:11 -0300, wout86 wrote: I'm currently unable to access my workstation, but I invoked the /resources.getComponentModel().getEmbeddedComponentIds();/ in both setupRender() and cleanupRender() earlier today. Both invocations returned an empty list. It seems to me th

Re: Issues in a page having multiple forms in tapestry 4

2012-05-03 Thread Howard Lewis Ship
That's pretty darn ugly! Tapestry places some tracking information into a hidden field when it renders; it needs that data to figure out what to do when the form submits. It works fine for reasonably sized forms, but get into that kind of range and you are hitting some limits. It may be possible

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread netdawg
Thiago, I perfectly understand where you are coming from. But it is hardly defensible. And, I suspect you know it. I have just proven to you polymorphic behavior of components using just pageName. Imagine what else can done, in menus alone, with more visibility - multi-level drill-downs etc.

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

2012-05-03 Thread wout86
Lance, I'm currently unable to access my workstation, but I invoked the /resources.getComponentModel().getEmbeddedComponentIds();/ in both setupRender() and cleanupRender() earlier today. Both invocations returned an empty list. -- View this message in context: http://tapestry.1045711.n5.nabble.

Displaying the current locale's language

2012-05-03 Thread Julien Martin
Hello, I need to be able to specify the anchor's hreflang attribute in a T5 action link. 1. There does not seem to be any such attribute for the tapestry action link. Is there a workaround? 2. I want to use the current locale's language such as "fr" or "en". Here is what I tried: @Inject private

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: 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 wout86
Yup I know about the page render variables, but that works. The problem is getting access to the embedded field.. (i.e., the TextField, or any field with a specific name, in the body of the custom component) The custom component itself doesn't have a tml file, it just employs the render phase event

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
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 wout86
Thanks, that'll work indeed. Do you happen to know whether it's also possible to inject such a field from the body of a custom component in that custom component? For instance, let's say we have: Where I'd like to access the tf1 textfield in mycomponent's java class to create the validator

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

2012-05-03 Thread wout86
No go :/. org.apache.tapestry5.ioc.Registry - Exception assembling root component of page MyPage: Could not convert 'prop:validate:validators' into a component parameter binding: Error parsing property expression 'validate:validators': Unable to parse input at character position 9. -- View this

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
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 wout86
That'd be a great solution, but it doesn't seem to work :-(. Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure reading parameter 'validate' of component MyPage:name: Unexpected character ':' at position 5 of input string: prop:validators. -- View this message in conte

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: Igor Drobiazko Book

2012-05-03 Thread Nicholoz Kiknadze
Thanks for update. First chapters I got under early access from Manning were very promising. Looking forward for full version. Regards, Nicholoz Kiknadze On Wed, May 2, 2012 at 10:45 PM, Igor Drobiazko wrote: > Sorry for the late reply. I somehow managed to miss this mail. I had a big > progres

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

2012-05-03 Thread wout86
Hi, I was wondering whether it is possible to add Validators to a Tapestry field (e.g., TextField) at render-time (based on a runtime property)? More specifically, I'd like to know whether I can avoid doing: and change it by something like with public String getAndRequired {

Re: Help with Dynamic Number of Form Elements

2012-05-03 Thread Thiago H. de Paula Figueiredo
Hi! On Wed, 02 May 2012 20:56:18 -0300, Ryon Day wrote: @property private List _questionSelectModels; // This is never null; it's populated during onPrepareForRender(); @propertyprivate SelectModel _currentModel Here is my Template: t:formState="ITERATION"> Question: t:value="selectedQue

Re: Can Component Template be Informed by Page Class

2012-05-03 Thread Thiago H. de Paula Figueiredo
On Wed, 02 May 2012 21:28:05 -0300, netdawg wrote: OK. Lets leave it at that, I guess. Agree to disagree ;-). 1. Polymorphism is not about implementation at all. It is about interfaces, which is what Components can aspire to be, sort of. In that case, components, do not get tied to page

Cookies: Invalid cookie. Value not a token or quoted value

2012-05-03 Thread karthi
Hi, I have developed an application in tapestry and yesterday that application went to live where I have faced a problem in tapestry cookies. I have used the cookies to store the user related informations import org.apache.tapestry5.services.Cookies; @Inject private Cookies cookies; cookie

Re: CSS Driven Tabs

2012-05-03 Thread netdawg
Thanks, Geoff. Love Jumpstart. Sticking with my counsel on this onejust doing a simple one-level menu, so pretty sure I nailed it, for now ;-) I selected the unravel CSS 2.0 tabs since it makes CSS do all the heavy-lifting. Always a better approach, if feasible. And the CSS itself is "pure

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: Reading out a Component's formal parameters' values

2012-05-03 Thread wout86
Thanks for the tip! Having read the documentation on Environmentals, it looks to me like I have to push the required values in the outer component in a method that will lead to the invocation of the validator method where I need them, and pop the values, for instance, when this method returns. I