Revision history [back]

click to hide/show revision 1
initial version

answered 2020-09-10 23:39:31 +0800

LuigiFabbri gravatar image LuigiFabbri

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

public void search()
{
System.out.println("searchValue="+this.searchValue);
}

public void clear()
{
this.searchValue="";
BindUtils.postNotifyChange(null, null, this, "searchValue");
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

public @Commandpublic void search()
{
System.out.println("searchValue="+this.searchValue);
}

public void clear()
{
this.searchValue="";
BindUtils.postNotifyChange(null, null, this, "searchValue");
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

@Commandpublic @Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}

public void clear()
{
this.searchValue="";
BindUtils.postNotifyChange(null, null, this, "searchValue");
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}

public void clear()
{
this.searchValue="";
BindUtils.postNotifyChange(null, null, this, "searchValue");
}
@Command
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}

@Command
@Command 
public void clear()
{
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}

@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}

@Command 
public void clear()
{
    this.searchValue="";
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
    BindUtils.postNotifyChange
}

@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}

@Command 
public void clear()
{
    this.searchValue="";
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
    BindUtils.postNotifyChange
}
 @Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}
 @Command 
public void clear()
{
    this.searchValue="";
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
    BindUtils.postNotifyChange
}
@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}
@Command 
public void clear()
{
    this.searchValue="";
    BindUtils.postNotifyChange(null, null, this, "searchValue");
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
private String searchValue="";

public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
    BindUtils.postNotifyChange
}
@Command 
public void search()
{
System.out.println("searchValue="+this.searchValue);
}
@Command 
public void clear()
{
    this.searchValue="";
    BindUtils.postNotifyChange(null, null, this, "searchValue");
}
}

Regards

When using the MVVM approach you do not take the values from the view objects but you have to use the binding technique where the object values are copied into the viewmodel property. In your case you need to do as follows:

ZUL:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="new page title" border="normal" viewModel="@id('vm')     @init('myviewmodel')">
<textbox value="@bind(vm.searchValue)" />
<button label = "search" onClick ="@command('search')" />
<button label = "refresh" onClick ="@command('clear')" />
</window>
</zk>

VIEWMODEL:

import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
public class myviewmodel {
 private String searchValue="";

 public String getSearchValue() {
 return searchValue;
}
    }
    public void setSearchValue(String searchValue) {
 this.searchValue = searchValue;
}
    }
    @Command 
 public void search()
{
    {
        System.out.println("searchValue="+this.searchValue);
}
    }
    @Command 
 public void clear()
{
    {
        this.searchValue="";
     BindUtils.postNotifyChange(null, null, this, "searchValue");
 }
}

Regards

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