Re: property expressions
> Most tapestry folk will agree that putting logic in your templates makes them brittle and hard to maintain, but sometimes need a little something in the template. I created a simple utility binding to help out in these kinds of situations. Example usage: Why | ? because : isn't valid in the text of a binding, or wasn't at the time I wrote this. import org.apache.tapestry5.Binding; import org.apache.tapestry5.BindingConstants; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.internal.bindings.AbstractBinding; import org.apache.tapestry5.ioc.Location; import org.apache.tapestry5.services.BindingFactory; import org.apache.tapestry5.services.BindingSource; /** * Implementation of the if: binding prefix * default binding is literal, other bindings can be used by specifying prefix. * example: "if:prop?selected|prop:x" */ public class IfBindingFactory implements BindingFactory { private final BindingSource _bindingSource; public IfBindingFactory(BindingSource source) { this._bindingSource = source; } public Binding newBinding(String description, ComponentResources container, ComponentResources component, String expression, Location location) { final String[] p1 = expression.split("\\?", 2); final String[] p2 = p1[1].split("\\|", 2); Object testBinding = _bindingSource.newBinding(description, container, component, BindingConstants.PROP, p1[0], location); Object trueBinding = p2[0]; if (p2[0].length() > 0) { trueBinding = _bindingSource.newBinding(description, container, component, BindingConstants.LITERAL, p2[0], location); } Object falseBinding = ""; if (p2.length == 2 && p2[1].length() > 0) { falseBinding = _bindingSource.newBinding(description, container, component, BindingConstants.LITERAL, p2[1], location); } return new IfBinding(testBinding, trueBinding, falseBinding); } public class IfBinding extends AbstractBinding { private Object _test; private Object _true; private Object _false; public IfBinding(Object testBinding, Object trueBinding, Object falseBinding) { _test = testBinding; _true = trueBinding; _false = falseBinding; } public Object get() { final Object o = get(_test); if (o instanceof Boolean) { return o.equals(true) ? get(_true) : get(_false); } return o == null ? get(_false) : get(_true); } @Override public boolean isInvariant() { return false; } @Override public Class getBindingType() { return Object.class; } private Object get(Object o) { if (o instanceof Binding) { return ((Binding) o).get(); } return o; } } } On Tue, Oct 25, 2011 at 2:14 PM, Brian Long wrote: > Hi all, > > was hoping someone could point me in the direction on a good tutorial > on the new property expressions in tapestry 5.2.6? I was using OGNL > previously and would like to update these expression to work with > ANTLR instead. > > The ognl expression i had was to decorate text field with different > classnames depending on whether the field was null > > > > Regards, Brian. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: property expressions
On Tue, 25 Oct 2011 14:57:50 -0200, Brian Long wrote: Hi Thiago, Hi! thanks for the quick reply, I'd already seen the official tapestry property expressions page but as there's no examples given there I was hoping there was something else buried in one of the wiki pages? I don't know any just by taking a look by memory. Have you taken a look at Tapestry JumpStart? I'll take your advise and move this logic to the java class, I'm going to have a lot of helper methods for the logic that was attached to the various fields on my form, but I guess I can't be avoided. Nice. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: property expressions
Hi Thiago, thanks for the quick reply, I'd already seen the official tapestry property expressions page but as there's no examples given there I was hoping there was something else buried in one of the wiki pages? I'll take your advise and move this logic to the java class, I'm going to have a lot of helper methods for the logic that was attached to the various fields on my form, but I guess I can't be avoided. Regards, Brian. On 25 October 2011 14:46, Thiago H. de Paula Figueiredo wrote: > On Tue, 25 Oct 2011 12:14:47 -0200, Brian Long > wrote: > >> Hi all, > > Hi! > >> was hoping someone could point me in the direction on a good tutorial > > on the new property expressions in tapestry 5.2.6? > > http://tapestry.apache.org/property-expressions.html > >> I was using OGNL >> previously and would like to update these expression to work with >> ANTLR instead. > > What do you mean by "to update these expression to work with ANTLR"? I'm not > following you. And don't forget that you can add your own binding > implementations in Tapestry. prop (property expressions) is just one of > them. > >> >> > > Easy: > > > > public String getSurnameCssClass() { > return surname == > null ? 'touch-and-type' : ''; > } > > Logic should be on Java classes, not templates. That's the Tapestry 5 > philosophy (MVC's too). > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: property expressions
In Tapestry 4, we shifted a lot of logic into OGNL because that was the only logic that could be reloaded (with the template) at runtime, during development. This was good in some ways, OGNL is still more versatile than Tapestry 5's property expressions, but came at a huge cost in terms of reflection overhead and a few highly contested code paths that tended to serialize the application. In Tapestry 5, you tend to reference a property from your template, as Thiago pointed out. Both the template and the Java code reload instantly, and the separation makes each part a bit cleaner. On Tue, Oct 25, 2011 at 7:46 AM, Thiago H. de Paula Figueiredo wrote: > On Tue, 25 Oct 2011 12:14:47 -0200, Brian Long > wrote: > >> Hi all, > > Hi! > >> was hoping someone could point me in the direction on a good tutorial >> on the new property expressions in tapestry 5.2.6? > > http://tapestry.apache.org/property-expressions.html > >> I was using OGNL >> previously and would like to update these expression to work with >> ANTLR instead. > > What do you mean by "to update these expression to work with ANTLR"? I'm not > following you. And don't forget that you can add your own binding > implementations in Tapestry. prop (property expressions) is just one of > them. > >> >> > > Easy: > > > > public String getSurnameCssClass() { > return surname == > null ? 'touch-and-type' : ''; > } > > Logic should be on Java classes, not templates. That's the Tapestry 5 > philosophy (MVC's too). > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: property expressions
On Tue, 25 Oct 2011 12:14:47 -0200, Brian Long wrote: Hi all, Hi! was hoping someone could point me in the direction on a good tutorial on the new property expressions in tapestry 5.2.6? http://tapestry.apache.org/property-expressions.html I was using OGNL previously and would like to update these expression to work with ANTLR instead. What do you mean by "to update these expression to work with ANTLR"? I'm not following you. And don't forget that you can add your own binding implementations in Tapestry. prop (property expressions) is just one of them. Easy: public String getSurnameCssClass() { return surname == > null ? 'touch-and-type' : ''; } Logic should be on Java classes, not templates. That's the Tapestry 5 philosophy (MVC's too). -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
property expressions
Hi all, was hoping someone could point me in the direction on a good tutorial on the new property expressions in tapestry 5.2.6? I was using OGNL previously and would like to update these expression to work with ANTLR instead. The ognl expression i had was to decorate text field with different classnames depending on whether the field was null Regards, Brian. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem with property expressions
Hi, I would like to that you and Gunnar Eketrapp for help. It works for me now. thanks Jan Thiago H. de Paula Figueiredo wrote: Em Wed, 02 Dec 2009 08:32:31 -0200, Jan Jirout escreveu: Hi, Hi! I have problem with property expression. When I try to use: // Never use ${} when passing parameters, as it converts its value to a String. In this case, you needed a List. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem with property expressions
Em Wed, 02 Dec 2009 08:32:31 -0200, Jan Jirout escreveu: Hi, Hi! I have problem with property expression. When I try to use: // Never use ${} when passing parameters, as it converts its value to a String. In this case, you needed a List. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem with property expressions
Skip the ${} E.g. context="[item.year,item.weekNum]" works for me! 2009/12/2 Jan Jirout > Hi, > > I have problem with property expression. When I try to use: > > // > > > I expect that result context will be string like "orderdetail/3/2". But > result URL is following: > / > / > > /http://localhost:8080/orderdetail/$005b223$002c$00201$005d/ > > > Context contains encoded sign like '[', ']' and ','. If I understand > specification of property expressions at > http://tapestry.apache.org/tapestry5.1/guide/propexp.html says than I use > valid format of context. I would like to use composite page link context > because I would like to have nice URL. > > Can you please suggest me how to use more that one parameters in page > context. > > regards > > Jan > > -- [Hem: 08-715 59 57, Mobil: 0708-52 62 90] Allévägen 2A, 132 42 Saltsjö-Boo
Problem with property expressions
Hi, I have problem with property expression. When I try to use: // I expect that result context will be string like "orderdetail/3/2". But result URL is following: / / /http://localhost:8080/orderdetail/$005b223$002c$00201$005d/ Context contains encoded sign like '[', ']' and ','. If I understand specification of property expressions at http://tapestry.apache.org/tapestry5.1/guide/propexp.html says than I use valid format of context. I would like to use composite page link context because I would like to have nice URL. Can you please suggest me how to use more that one parameters in page context. regards Jan
Re: Property expressions
Thanks for the quick replay, my updated 'ognless' if condition now reads . . . ${message:EXPORT} /Brian. :-) Howard Lewis Ship wrote: > The not operator (!) coerces the value to a boolean; nil is false, as > is any kind of empty collection. Thus > ... should work. > > On Mon, Oct 5, 2009 at 8:39 AM, Brian Long wrote: > >> Hi all, >> >> just a quick question, looking at the property expressions guide @ >> http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I >> should be able to evaluate whether a property has a null value (handy >> for if conditions) without having to use ognl, >> >> e.g. instead of >> >> >>> t:id="exportButton">${message:EXPORT} >> >> >> I should be able to use the property expression directly, there's a null >> keyword and an notOpt !, but what is the proper synthax? >> >> Regards, Brian. >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >> > > > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Property expressions
The not operator (!) coerces the value to a boolean; nil is false, as is any kind of empty collection. Thus ... should work. On Mon, Oct 5, 2009 at 8:39 AM, Brian Long wrote: > Hi all, > > just a quick question, looking at the property expressions guide @ > http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I > should be able to evaluate whether a property has a null value (handy > for if conditions) without having to use ognl, > > e.g. instead of > > > t:id="exportButton">${message:EXPORT} > > > I should be able to use the property expression directly, there's a null > keyword and an notOpt !, but what is the proper synthax? > > Regards, Brian. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Property expressions
Hi all, just a quick question, looking at the property expressions guide @ http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I should be able to evaluate whether a property has a null value (handy for if conditions) without having to use ognl, e.g. instead of ${message:EXPORT} I should be able to use the property expression directly, there's a null keyword and an notOpt !, but what is the proper synthax? Regards, Brian. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: T5.1 Property Expressions
Congratulations, you have raised the "JIRA Issue of the Beast" as a duplicate of Tap5-663 which I entered last week. ;-) Well that's an easy way round the 666 superstition, just mark as a dup and close... > -Original Message- > From: Howard Lewis Ship [mailto:hls...@gmail.com] > Sent: 27 April 2009 17:29 > To: Tapestry users > Subject: Re: T5.1 Property Expressions > > Congratulations, you have The JIRA Issue Of The Beast: > > https://issues.apache.org/jira/browse/TAP5-666 > > > On Thu, Apr 23, 2009 at 10:37 AM, Andy Blower > wrote: > > > > I just tried out the new T5.1 property expressions for the first time > and got > > an error. I'm trying to replace this: > > > > ${linkTitle} > > > > public String getLinkTitle() { > > return getTitle(false); > > } > > > > With this: > > > > ${getTitle(false)} > > > > > > Which I should be able to do according to the Grammar as far as I can > see, > > since but I get this error when I try it: > > > > Caused by: > > org.apache.tapestry5.internal.services.PropertyExpressionException: > Node > > false (within expression 'getTitle(false)') was type FALSE, but was > expected > > to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, > SAFEDEREF, > > STRING. > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java: > 756) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java: > 730) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:4 > 36) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$Proper > tyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build( > PropertyConduitSourceImpl.java:1206) > > at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create > (PropertyConduitSourceImpl.java:1081) > > at > > > $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f > 0182d.java) > > at > > > org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(Pr > opBindingFactory.java:49) > > at > $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java > ) > > at > $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java > ) > > at > > > org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(Bin > dingSourceImpl.java:81) > > ... 107 more > > > > > > -- > > View this message in context: http://www.nabble.com/T5.1-Property- > Expressions-tp23197478p23197478.html > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > Director of Open Source Technology at Formos > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 Property Expressions
Reminds me of some washroom graffiti I saw, reading: 668 - the neighbour of the beast On Mon, Apr 27, 2009 at 12:28 PM, Howard Lewis Ship wrote: > Congratulations, you have The JIRA Issue Of The Beast: > > https://issues.apache.org/jira/browse/TAP5-666 > > > On Thu, Apr 23, 2009 at 10:37 AM, Andy Blower > wrote: > > > > I just tried out the new T5.1 property expressions for the first time and > got > > an error. I’m trying to replace this: > > > > ${linkTitle} > > > > public String getLinkTitle() { > >return getTitle(false); > > } > > > > With this: > > > > ${getTitle(false)} > > > > > > Which I should be able to do according to the Grammar as far as I can > see, > > since but I get this error when I try it: > > > > Caused by: > > org.apache.tapestry5.internal.services.PropertyExpressionException: Node > > false (within expression 'getTitle(false)') was type FALSE, but was > expected > > to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, > SAFEDEREF, > > STRING. > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:756) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:730) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:436) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1206) > >at > > > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1081) > >at > > > $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f0182d.java) > >at > > > org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) > >at > $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java) > >at > $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java) > >at > > > org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:81) > >... 107 more > > > > > > -- > > View this message in context: > http://www.nabble.com/T5.1-Property-Expressions-tp23197478p23197478.html > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > Director of Open Source Technology at Formos > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: T5.1 Property Expressions
Congratulations, you have The JIRA Issue Of The Beast: https://issues.apache.org/jira/browse/TAP5-666 On Thu, Apr 23, 2009 at 10:37 AM, Andy Blower wrote: > > I just tried out the new T5.1 property expressions for the first time and got > an error. I’m trying to replace this: > > ${linkTitle} > > public String getLinkTitle() { > return getTitle(false); > } > > With this: > > ${getTitle(false)} > > > Which I should be able to do according to the Grammar as far as I can see, > since but I get this error when I try it: > > Caused by: > org.apache.tapestry5.internal.services.PropertyExpressionException: Node > false (within expression 'getTitle(false)') was type FALSE, but was expected > to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, SAFEDEREF, > STRING. > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:756) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:730) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:436) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1206) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1081) > at > $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f0182d.java) > at > org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) > at > $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java) > at > $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java) > at > org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:81) > ... 107 more > > > -- > View this message in context: > http://www.nabble.com/T5.1-Property-Expressions-tp23197478p23197478.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 Property Expressions
Looks like a bug to me. On Thu, Apr 23, 2009 at 10:37 AM, Andy Blower wrote: > > I just tried out the new T5.1 property expressions for the first time and got > an error. I’m trying to replace this: > > ${linkTitle} > > public String getLinkTitle() { > return getTitle(false); > } > > With this: > > ${getTitle(false)} > > > Which I should be able to do according to the Grammar as far as I can see, > since but I get this error when I try it: > > Caused by: > org.apache.tapestry5.internal.services.PropertyExpressionException: Node > false (within expression 'getTitle(false)') was type FALSE, but was expected > to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, SAFEDEREF, > STRING. > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:756) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:730) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:436) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1206) > at > org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1081) > at > $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f0182d.java) > at > org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) > at > $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java) > at > $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java) > at > org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:81) > ... 107 more > > > -- > View this message in context: > http://www.nabble.com/T5.1-Property-Expressions-tp23197478p23197478.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 Property Expressions
Have you tried ${getTitle('false')}? Uli Andy Blower schrieb: I just tried out the new T5.1 property expressions for the first time and got an error. I’m trying to replace this: ${linkTitle} public String getLinkTitle() { return getTitle(false); } With this: ${getTitle(false)} Which I should be able to do according to the Grammar as far as I can see, since but I get this error when I try it: Caused by: org.apache.tapestry5.internal.services.PropertyExpressionException: Node false (within expression 'getTitle(false)') was type FALSE, but was expected to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, SAFEDEREF, STRING. at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:756) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:730) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:436) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1206) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1081) at $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f0182d.java) at org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) at $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java) at $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java) at org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:81) ... 107 more - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.1 Property Expressions
I just tried out the new T5.1 property expressions for the first time and got an error. I’m trying to replace this: ${linkTitle} public String getLinkTitle() { return getTitle(false); } With this: ${getTitle(false)} Which I should be able to do according to the Grammar as far as I can see, since but I get this error when I try it: Caused by: org.apache.tapestry5.internal.services.PropertyExpressionException: Node false (within expression 'getTitle(false)') was type FALSE, but was expected to be (one of) DECIMAL, DEREF, IDENTIFIER, INTEGER, INVOKE, LIST, SAFEDEREF, STRING. at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.unexpectedNodeType(PropertyConduitSourceImpl.java:925) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.subexpression(PropertyConduitSourceImpl.java:637) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:756) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createMethodInvocation(PropertyConduitSourceImpl.java:730) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetter(PropertyConduitSourceImpl.java:711) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:436) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:419) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:272) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1206) at org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1081) at $PropertyConduitSource_120d3f0182d.create($PropertyConduitSource_120d3f0182d.java) at org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49) at $BindingFactory_120d3f0182e.newBinding($BindingFactory_120d3f0182e.java) at $BindingFactory_120d3f01826.newBinding($BindingFactory_120d3f01826.java) at org.apache.tapestry5.internal.services.BindingSourceImpl.newBinding(BindingSourceImpl.java:81) ... 107 more -- View this message in context: http://www.nabble.com/T5.1-Property-Expressions-tp23197478p23197478.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org