| Summary: | element property should be optional | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Ling Hao <ling.hao> |
| Component: | Sapphire | Assignee: | Project Inbox <sapphire.ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | konstantin |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Ling Hao
Since this is a question rather than a problem statement, this would have been better started on the forum or the mailing list.
The answer to the question is, yes, this is possible. If you look at the definition of IElementPropertiesGallery.Heterogeneous property, you will see this:
@Type( base = IChildElement.class, possible = { IChildElement.class, IChildElementWithInteger.class, IChildElementWithEnum.class } )
Note that IChildElement is listed among possible types. There is no requirement that the base type is among possible types. Simply remove it from the possible list and you will no longer need to specify a case for it.
Sorry my statement was not clear. I would like the child node <child-with-enum> node to show up as it is now. But if the user selected "child element" or "child element with integer" radio button, that the <child> or <child-with-integer> node not show up. Sorry, that is making no sense. Can you better outline a case where the behavior you describe is desirable? Let say the "Child element with enum" has a lot of value properties which does not fit into a single page. I suppose the following is viable:
Heterogeneous
<child-with-enum>
more-child-with-enum
But instead of duplicating the properties in the <child-with-enum> node, display it in the RHS of the Heterogeneous node and have the following:
Heterogeneous
more-child-with-enum
Instead of duplicating the content of "child element" in the Heterogeneous and the <child>, eliminate the <child> node
Perhaps a UI review of my code is better.
I think I now understand what you are trying to accomplish. You are trying to use the with construct to control the child element's lifecycle while simultaneously using node-factory to display additional content. That is not what node-factory is designed to handle. It isn't even the issue of making it possible to not specify cases. The add and delete actions cease to make sense when used in this manner. The fundamental assumption of the node-factory construct is you should be able to add an element that will correspond to a node, which you can then delete, which will delete an element. In your case, some add operations will not result in a node while others will result in a node that users will not necessarily associate with the element that would be deleted if the node delete action is invoked. I do not at this point know how we would support what you are trying to accomplish. I was trying to eliminate one extra node, but the supported feature works fine. Closing bug. |