Candidates Expression for Select or Radio based on ecore Enumeration [message #1745804] |
Mon, 17 October 2016 15:35 |
Joerg Hermann Messages: 15 Registered: September 2012 Location: Munich |
Junior Member |
|
|
Thanks for providing the new properties view. I think, this is really great.
I'm just struggling with displaying enumerated properties from my ecore model
(sth like a property 'color', which could be one of 'RED', 'BLUE', GREEN').
I saw that the default implementation, if I do not specify anything in the VSM
is showing the options provided in the model as radio buttons.
Unfortunately, I was not able to create a correct content for the 'Candidates Expressions' field, which I think should provide a list of the available enum
literals.
I know, I can obtain these as a list from the EPackage, but how can I access this
here?
Or might there possibly be a more elegant solution?
Any help is very much appreciated
best regards,
Joerg
|
|
|
Re: Candidates Expression for Select or Radio based on ecore Enumeration [message #1745829 is a reply to message #1745804] |
Tue, 18 October 2016 06:52 |
|
Hi Joerg,
In order to display a property color, based on an enumeration, you will need to enter the following expressions:
* labelExpression: aql:'Color:'
* valueExpression: aql:nameofyourpackage::Color.getEEnumLiteral(self.color.toString())
* candidatesExpression: aql:nameofyourpackage::Color.eLiterals
* candidateDisplayExpression: aql:candidate.name
And in order to edit this value, you will need a "Set" operation with the feature name "color" and the new value expression "newValue.instance". You will just need to replace in those expression the name of the package of your meta model containing your concept of "Color".
Kind regards,
Stephane Begaudeau
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03363 seconds