Cannot change tbeditor value

asked 2021-06-01 22:15:15 +0800

softteam gravatar image softteam
120 8


I would like to use @bind annotations to change tbeditor value. However, this value is never changed when I change the variable annotated with @bind.

I do not want to change the tbeditor using its id because I use it inside a template. I tried to use BindUtils.postNotifyChange(null,null,this,"testEditor"); and @NotifyChange({"testEditor"}) but is not working. How can I do that?

An example: https://zkfiddle.org/sample/15o8161/11-tbeditor-do-not-show-value#source-1

Thank you, Javier

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-02 16:23:59 +0800

MDuchemin gravatar image MDuchemin
1901 1 5
ZK Team

Hey There,

found that the issue is not related to viewmodel, but to tbeditor setValue directly.

Posted a bug ticket: zk-4916

it contains a workaround script to restore the normal behavior.

On a side note, the provided fiddle would not have worked, but for a different reason. The sample is using both MVVM and MVC patterns at the same time.

Composer classes won't wire if they are used as viewModel, and listener conventions like onClick$btn cannot work in this context.

You should use either commands in a view model, or listener in a composer.

Mixing both styles is not recommended, as it's likely to introduce pattern breaches from either directions, and will make debugging much more difficult.

Here's the pure MVVM version of your sample, with the workaround already included ;) https://zkfiddle.org/sample/15o8161/28-tbeditor-do-not-show-value

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2021-06-01 22:15:15 +0800

Seen: 6 times

Last updated: Jun 02

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More