Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] refreshing "visible when" conditions

In my model I have an element called <task> (aka ITask in sapphire model).   This element has as child xml element <assignments> that under it can have 4 possible elements types but they are mutually exclusive (XSD choice).  Only one of those 4 element types can be there at a time.  So I'm trying to figure out how to edit this visually.  What I have right now in my model is on the <task> content outline node I have 4 child content nodes (one for each element type) and each of those child nodes has a "visible when" condition.  The visible when condition just checks to see which of those 4 child types are currently in the model and returns true/false accordingly.  So when you have a task with a particular child node, only that child node shows up in the Content Node outline.

The problem is that the user needs to be able to change which of these 4 node types they want to specify.  I tried to do this with a enum type and a custom binding on the enum type (along with enum property editor to let them select which "type" of child they want).  In the custom enum binding I just want to mutate the underlying xmlResource based on which new child type they want to now specify.  The problem is that when the underlying model changes, the "visible when" conditions are not reevaluated to show that a new child node now needs to be displayed.

How do I make sapphire "refresh" the visible when conditions?  or is there a better way to accomplish this thing without using visible when conditions on child nodes?

Thanks!

--
Greg Amerson
Liferay, Inc.


Back to the top