Element Factory to return Null Child

Hello,

Is it possible to return a null child in an element factory?  I'm trying to force children to NOT be created upon certain conditions.

I currently have a constraint set up as mentioned here, but would like to set it up so that children are not created at all rather than just showing that the model is invalid.

If this is not possible, is there a way to customize the message for the invalid model?

1 comment

Hi Tyson,

you could block creating children by specifying an action map for the collection cell, which will ignore the INSERT and INSERT_BEFORE actions:

action map Dummy
applicable concept: CommandList
actions:

action INSERT description : <no description>
  can execute : true
  execute : (editorContext, node)->void {
    <no statements>
  }
  action INSERT_BEFORE description : <no description>
  can execute : true
  execute : (editorContext, node)->void {
    <no statements>
  }

Vaclav

 

0

Please sign in to leave a comment.