Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Enable/disable individual FormEditorPage (or page contents) based on model properties?
Enable/disable individual FormEditorPage (or page contents) based on model properties? [message #1106834] Wed, 11 September 2013 16:04 Go to next message
Ellen Badgley is currently offline Ellen Badgley
Messages: 35
Registered: October 2012
Member
I have a Sapphire editor declared as a class with several FormEditorPages as members (following the Architecture example, among others). I'd like to be able to hide/show these individual pages depending on certain property values of the root model. Is this possible?

As a backup, I'd be happy with hiding the contents of those pages/panels using the <visible-when> tag on the .sdef, but I've run into some issues making this work. For example, I had the following in my .sdef:

<form-editor-page>
  <id>FusionCenterPage</id>
  <element-type>org.mitre.ref.jieddo.scenario.fusion.input.model.FusionCenter</element-type>
  <page-name>Fusion</page-name>
  <page-header-text>Sensor Fusion Scenario: ${ Name == null ?
			&quot;&quot; : Concat( Name, &quot; &quot; ) }</page-header-text>
  <content>
    <section>
      <label>fusion centers</label>
      <content>
        <include>fusion.center.panel</include>
      </content>
      <visible-when>${Type != "feature"}</visible-when>
    </section>
  </content>
</form-editor-page>


However, when I try the above, the section never becomes visible, even when changing the property and I can confirm via other tests (of the Sapphire expression language) that the condition is "true".
Re: Enable/disable individual FormEditorPage (or page contents) based on model properties? [message #1106851 is a reply to message #1106834] Wed, 11 September 2013 16:27 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 942
Registered: July 2009
Senior Member
We haven't had a usecase before for visible-when on editor pages, so its not implemented yet. Please open an enhancement request.

Please open a bug if visible-when on sections isn't reacting appropriately. There might be a problem with this usecase in the form-editor-page container as it works in other contexts.
Re: Enable/disable individual FormEditorPage (or page contents) based on model properties? [message #1106890 is a reply to message #1106851] Wed, 11 September 2013 17:32 Go to previous message
Ellen Badgley is currently offline Ellen Badgley
Messages: 35
Registered: October 2012
Member
Thanks - I'll do both of those ASAP.

I found a third option, in the form of hiding the actual panel (Composite) on the tab in question. That appears to be operating as desired, and is a fine workaround for me for the time being, especially since I can add an additional Label that shows up when necessary to explain that, no, this property can't be edited right now. Smile
Previous Topic:How to programatically select a node from the outline?
Next Topic:Expensive @NoDuplicates
Goto Forum:
  


Current Time: Fri Oct 31 00:01:17 GMT 2014

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

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