Revision history [back]

click to hide/show revision 1
initial version

asked 2020-09-10 16:51:20 +0800

tinawang gravatar image tinawang

button onClick update value then execute @command

I have a button refresh, after it clicked, the searchTextbox need to be cleared and also trigger a method in my view model.

clear the searchTextbox.

<textbox id="searchTextbox"/>
<button label="search" onClick="@command('search', keyword=searchText.value)"/>
<button label="refresh" onClick="searchTextbox.value = null"/>

refresh command in defined in view model.

<textbox id="searchTextbox"/>
<button label="search" onClick="@command('search', keyword=searchText.value)"/>
<button label="refresh" onClick="@command('refresh')"/>

If there a way that combine both behavior together only set in zul file?
onClick="searchTextbox.value = null; @command('refresh')"
I hope not to wired Textbox in view model, because I can use @BindingParam get the value.

button onClick update value then execute @command

I have a button refresh, after it clicked, the searchTextbox need to be cleared and also trigger a method in my view model.

clear the searchTextbox.

<textbox id="searchTextbox"/>
<button label="search" onClick="@command('search', keyword=searchText.value)"/>
<button label="refresh" onClick="searchTextbox.value = null"/>

refresh command in defined in view model.

<textbox id="searchTextbox"/>
<button label="search" onClick="@command('search', keyword=searchText.value)"/>
<button label="refresh" onClick="@command('refresh')"/>

If there a way that combine both behavior together only set in zul file?
onClick="searchTextbox.value = null; @command('refresh')"
I hope not to wired Textbox in view model, because I can use @BindingParam get the value.

-- Updated --
Is it possible combine both behavior together only set in zul file? I knew that view model can do it.

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