View Full Version : How to write complex resource / data binding expression?

05-22-2006, 12:14 PM

I'd like to write something similar to the following resource binding expression: $this.ultraTabs.FromKey("tabKey").Text

However, the expression parsing fails on the double quote...
[TokenStreamRecognitionException: unexpected char: '"']
Spring.Expressions.ExpressionLexer.nextToken() in c:\projects\daily\Spring.Net\src\Spring\Spring.Cor e\Expressions\Parser\ExpressionLexer.cs:341

I guess the same thing should happen for data binding expression, as these expressions are also supported by antlr...



PS: Aleks (and others Spring.Net guys), haven't you thought to use CodeDom instead of relying on antlr parser, and reinterpreting the AST each time the expression must be evaluated? Besides, the supported language could be VB.NET as well as C#, depending on your language of choice... Yeah right, some people have chosen VB.NET :( Interested in discussing this option?

Bruno Baia
05-22-2006, 08:03 PM
Hi François,

quotes are used for delimited a string in an expression, and '$' is not a recognized token.
Try something like that :

BindingManager.AddBinding("ultraTabs.FromKey('tabKey').Text ", "MyStringProperty");