It it possible to bind to a component's property?

asked 2013-02-26 14:10:00 +0800

RetoH gravatar image RetoH flag of Switzerland
44 5

updated 2013-02-26 14:11:02 +0800

I tried:

<textbox id="box" />
<button label="OK" disabled="@bind(empty box.value)" />

Nothing happens. Is binding only supported to properties of the view model?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-26 17:23:17 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

You can directly bind textbox and Button directly from Java class

<textbox id="box" value="@bind(vm.textboxValue)"/>
<button label="OK" disabled="@bind(empty vm.textboxValue)" />

Will it work for you?

link publish delete flag offensive edit


I'm sure your suggestion works, I wanted to avoid having to create a vm property. So I guess it is only possible to bind to the view model, not to properties of components? Currently I use: <textbox onChanging='buttonId.disabled = (event.value.length() == 0)' />

RetoH ( 2013-02-27 16:27:54 +0800 )edit

It should be a solution in Zscript but i never prefer it even in my company we already ban this Zscript

sjoshi ( 2013-02-27 17:21:48 +0800 )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: 2013-02-26 14:10:00 +0800

Seen: 19 times

Last updated: Feb 26 '13

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