Skip to main content



      Home
Home » Eclipse Projects » Sirius » [Properties View] How to access a text fields value
[Properties View] How to access a text fields value [message #1744740] Thu, 29 September 2016 14:49 Go to next message
Eclipse UserFriend
Hi all,

I'm trying to create a text field in my diagram representation's properties view that allows me to change the values of certain attributes.

All the values are represented but I'm unable to change them permanently in the model elements. I tried using an external java action and furthermore using the text field's value as parameter but I'm not sure on how to access that value.
Anybody got any advice?

Greetings,
Michael
Re: [Properties View] How to access a text fields value [message #1744776 is a reply to message #1744740] Fri, 30 September 2016 03:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

As explained in the documentation in the section edit text [1], you should define the behavior of the text edition below an Initial Operation.
To define the behavior of the text when a change occurs, you simply specify the behavior associated to the edition inside the Begin element using all the standard model operations.
The expressions defined under the Begin can use the newValue variable which represents the value entered by the user.
Sirius automatically invokes the edit operation a short time after the user performs a change in the text or when the focus leaves the widget.

Your odesign should looks like something like this:
<widgets
xsi:type="properties:TextDescription"
labelExpression="Text"
valueExpression="aql:self.name">
<initialOperation>
<firstModelOperations
xsi:type="tool:SetValue"
featureName="name"
valueExpression="var:newValue"/>
</initialOperation>
</widgets>

Best regards,
Mélanie

[1] https://www.eclipse.org/sirius/doc/specifier/Properties_View_Description.html#widgets
Re: [Properties View] How to access a text fields value [message #1744787 is a reply to message #1744776] Fri, 30 September 2016 04:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mélanie,

thanks a lot, it works now Smile. The auto completion didn't work for me which is why I didn't get the newValue variable when entering var:

Kind regards,
Michael
Re: [Properties View] How to access a text fields value [message #1744814 is a reply to message #1744787] Fri, 30 September 2016 08:34 Go to previous message
Eclipse UserFriend
Quote:

The auto completion didn't work for me which is why I didn't get the newValue variable when entering var:


FYI, this should be fixed in the upcoming Sirius 4.1.0. (If you're using a recent nightly build for 4.1 and still see the bug, please let me know in https://bugs.eclipse.org/bugs/show_bug.cgi?id=496014).
Previous Topic:Sub Node vs. Bordered Node
Next Topic:Working with a container to group model elements by dragging
Goto Forum:
  


Current Time: Fri Mar 21 23:48:08 EDT 2025

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

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

Back to the top