Binding 2 way to edit TextBlock - TextBlock event listener

Hi @walter, We are doing on changing TextBlock:

At (1): We set editable: true and .makeTwoWay() to TextBlock

At (3): We implement the ModelChangedListener like that

But at onModelChangeListener (2) sometime we can’t get the event.

That’s odd. Could you please characterize (after doing an in-place edit of that text) when you do get the model ChangedEvent and when you do not?


I want to handle event when change the text and update it into state (Angular). But the event not show

Are you asking about how to get an event when the user has finished editing the text? Try implementing either a “TextEdited” DiagramEvent listener or a TextBlock.textEdited event handler:

Thank @walter, I will try it and feedback ASAP

I’m sorry not to clear the expected requirement of our team. When we are typing in the placeholder, we want to catch the event, after that make some specific words suggestion for user. So we are implement like that. But at the record, sometime there are no event have been catch

Do you mean that you want to provide feedback while the user is typing in the HTML TEXTAREA? Then you need to customize that text editor. Please read GoJS HTML Interaction -- Northwoods Software and look at the example text editor extensions, in the extensions directory.

Thank you @walter. We are done base on your recommendation

I want to ask more: Did we have the ability to Handle the Textchange? Because we may do some validation to add Node information to Database

If you have customized the text editor, you can do validation as they are typing.

Furthermore, you can check what they have entered when they finish editing: GoJS Validation -- Northwoods Software

Remember that it is wiser to prevent the user from making mistakes than to let them mess up and then have to explain it to them and have them fix it up afterwards.