Update cells in a cross table [message #1738387] |
Tue, 19 July 2016 07:54  |
Eclipse User |
|
|
|
Hi
thanks to the help of this forum I got the visualization of my cross-table working. Now I have 2 problems:
1) I cannot update the content of a previously filled cell. I can change it in the table but it is not persisted in the table nor is it in the underlying model.
2) How to create a new instance of the cell itself a "ColumnAssignment" in my case.
<?xml version="1.0" encoding="UTF-8"?>
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/table/description/1.1.0" name="blabla" version="11.0.0.201601261200">
<ownedViewpoints name="BlaBlaInstance" modelFileExtension="myfile">
<ownedRepresentations xsi:type="description_1:CrossTableDescription" name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
<metamodel href="http://www.blabla.com/dsl/BLABLA#/"/>
<ownedLineMappings name="Decision" domainClass="Decision"/>
<ownedColumnMappings name="Column" headerLabelExpression="[self.name + ' : ' + self.typeName/]" domainClass="ColumnDeclaration"/>
<intersection name="Value" lineMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']" columnMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedColumnMappings.0" labelExpression="[self.val/]" useDomainClass="true" columnFinderExpression="[self.column/]" lineFinderExpression="[self.eContainer()/]" domainClass="ColumnAssignment"/>
</ownedRepresentations>
</ownedViewpoints>
</description:Group>
thanks for your help
|
|
|
Re: Update cells in a cross table [message #1738413 is a reply to message #1738387] |
Tue, 19 July 2016 10:44   |
Eclipse User |
|
|
|
Hi,
1) Under your Intersection mapping, you need to add a "Label Edit tool"
in order to process the information how your want. In your case, you
should probably use a "Set" operation to update the val field of
ColumnAssigment.
2) Still under your Intersection mapping, your need to add a "Create
Cell tool" in order to add a new ColumnAssigment. The operations needed
by this tool would be:
- a CreateInstance, to create a new ColumnAssigment and add it to the
columnAssignements reference of Decision;
- a Set, to reference the ColumnDeclaration using the column reference
- a Set, to give a default value to the new ColumnAssigment (optional).
For further information on these tools you can check:
https://www.eclipse.org/sirius/doc/specifier/tables/Tables.html#cross_table_tools
Regards,
Steve
Le 19/07/2016 à 13:54, Steve Hostettler a écrit :
> Hi
>
> thanks to the help of this forum I got the visualization of my
> cross-table working. Now I have 2 problems:
> 1) I cannot update the content of a previously filled cell. I can change
> it in the table but it is not persisted in the table nor is it in the
> underlying model.
> 2) How to create a new instance of the cell itself a "ColumnAssignment"
> in my case.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:description="http://www.eclipse.org/sirius/description/1.1.0"
> xmlns:description_1="http://www.eclipse.org/sirius/table/description/1.1.0"
> name="blabla" version="11.0.0.201601261200">
> <ownedViewpoints name="BlaBlaInstance" modelFileExtension="myfile">
> <ownedRepresentations xsi:type="description_1:CrossTableDescription"
> name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
> <metamodel href="http://www.blabla.com/dsl/BLABLA#/"/>
> <ownedLineMappings name="Decision" domainClass="Decision"/>
> <ownedColumnMappings name="Column"
> headerLabelExpression="[self.name + ' : ' + self.typeName/]"
> domainClass="ColumnDeclaration"/>
> <intersection name="Value"
> lineMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']"
> columnMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedColumnMappings.0"
> labelExpression="[self.val/]" useDomainClass="true"
> columnFinderExpression="[self.column/]"
> lineFinderExpression="[self.eContainer()/]"
> domainClass="ColumnAssignment"/>
> </ownedRepresentations>
> </ownedViewpoints>
> </description:Group>
>
>
> thanks for your help
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
|
|
|
Re: Update cells in a cross table [message #1738524 is a reply to message #1738518] |
Wed, 20 July 2016 10:10  |
Eclipse User |
|
|
|
Ahah no problem, this is unfortunatly a common issue that we hope to be
fixed in Human 2.0 :)
By the way, note that there is autocompletion in any interpreted
expression field (Fields with a yellow background) as soon as the kind
of expression is know (for instance, starting by "feature:" for a
feature direct access or encapsulated by "[/]" for an Acceleo expression).
Le 20/07/2016 à 15:40, Steve Hostettler a écrit :
> Thanks a lot, the problem was indeed between the chair and the keyboard
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03386 seconds