Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT ValidationRule Bug?
XWT ValidationRule Bug? [message #947781] Wed, 17 October 2012 12:31 Go to next message
Jürgen Weinberger is currently offline Jürgen WeinbergerFriend
Messages: 42
Registered: August 2012
Member
Hi!

I'm currently playing around with xwt and its validation mechanism. I wrote a simple test case like in the xwt.tests. There i ran into the problem that i declare 2 ValidationRules in the xwt but only one gets called on validation.
It seems that both rules get loaded and attached to the Binding. But later on validation only the (in the xwt) top-most rule gets called.

Is there a known bug or am i doing something wrong?

<Composite xmlns="http://www.eclipse.org/xwt/presentation" 
		   xmlns:x="http://www.eclipse.org/xwt"
		   xmlns:y="clr-namespace:testapplication.model" xmlns:c0="clr-namespace:org.eclipse.e4.xwt.converters" xmlns:v0="clr-namespace:testapplication.uicontainers"
	 	  >
	<Composite.layout>
		<GridLayout numColumns="3" horizontalSpacing="10"/>
	</Composite.layout>
	 	   
	<Composite.Resources>
		<y:Person x:Key="myData"/>
	</Composite.Resources>
	
	<Text x:Style="BORDER" text="{Binding Path=name, updateSourceTrigger=PropertyChanged, validationRules={v0:ValidatorOne, v0:ValidatorTwo}}">
		<Text.layoutData>
			<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
		</Text.layoutData>
	</Text>

</Composite>


Maybe somebody has an idea?

regards weinma
Re: XWT ValidationRule Bug? [message #947800 is a reply to message #947781] Wed, 17 October 2012 12:56 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I am not sure if the syntax (in your example) is right.
I guess that syntax will provide v0:ValidatorTwo as a parameter to the constructor of c0:ValidatorOne.

You can work around this by transforming your Binding as follows:

	<Text x:Style="BORDER">
		<Text.text>
		  <Binding path="name" updateSourceTrigger="PropertyChanged">
			<Binding.validationRules>
			  <v0:ValidatorOne />
			  <v0:ValidatorTwo />
			</Binding.validationRules>
		  </Binding>
		</Text.text>
		<Text.layoutData>
			<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
		</Text.layoutData>
	</Text>
Previous Topic:How to find DirectMenuItem programmatically
Next Topic:Porting RAP to Eclipse4
Goto Forum:
  


Current Time: Thu Apr 25 06:20:01 GMT 2024

Powered by FUDForum. Page generated in 0.03075 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top