Revision history [back]

click to hide/show revision 1
initial version

answered 2014-03-22 05:29:31 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

Its normal that that doesn't update your fx. You don't call the notify change for product.

do this :

@Command("select_recent")
@NotifyChange({"myForm","product"})
public void selectRecent(){
    ....
}

Its normal that that doesn't update your fx. You don't call the notify change for product.

do this :

@Command("select_recent")
@NotifyChange({"myForm","product"})
public void selectRecent(){
    ....
}

I don't know if myForm was also changed so I let that stay. Idf that is not changed, remove from the notifyChange.

Greetz chill.

You use @init(vm.myForm) what means initialization, so run once. The fx is loaded with vm.product.

Its normal that that doesn't update your fx. You don't call the notify change for product.

do this :

@Command("select_recent")
@NotifyChange({"myForm","product"})
@NotifyChange("product")
public void selectRecent(){
    ....
product.setName("recent_product_name");
    product.setDescription("recent_product_name");
    product.setPrice(100.0);
}

I If you don't know if myForm was also changed so I let that stay. Idf that is not changed, remove from want it already with the notifyChange.command in product yet, you can pass the middle object fx with the command like this :

<button id="load_product" label="Select Most Recent Product" onClick="@command('select_recent', product = fx)"/>

and in your vm it will result in :

@Command("select_recent")
public void selectRecent((@BindingParam("product") Product fx){
    fx.setName("recent_product_name");
    fx.setDescription("recent_product_name");
    fx.setPrice(100.0);
    BindUtils.postNotifyChange(null, null, fx, "*");
}

Greetz chill.

You use @init(vm.myForm) what means initialization, so run once. The fx is loaded with vm.product.

Its normal that that doesn't update your fx. You don't call the notify change for product.

do this :

@Command("select_recent")
@NotifyChange("product")
public void selectRecent(){
    product.setName("recent_product_name");
    product.setDescription("recent_product_name");
    product.setPrice(100.0);
}

If you don't want it already with the command in product yet, you can pass the middle object fx with the command like this :

<button id="load_product" label="Select Most Recent Product" onClick="@command('select_recent', product = fx)"/>

and in your vm it will result in :

@Command("select_recent")
public void selectRecent((@BindingParam("product") Product SimpleForm fx){
    fx.setName("recent_product_name");
fx.setField("name", "recent_product_name");    
 fx.setDescription("recent_product_name");
fx.setField("description", "recent_product_name");    
 fx.setPrice(100.0);
fx.setField("price", 100.0);
    BindUtils.postNotifyChange(null, null, fx, "*");
}

Greetz chill.

You use Remove the private SimpleForm from your vm and make it a bindingparam. Remove also the @init(vm.myForm) what means initialization, so run once. The fx is loaded with vm.product.from your zul.

Its normal that that doesn't update Now change your fx. You don't call the notify change for product.

do this :

@Command("select_recent")
@NotifyChange("product")
public void selectRecent(){
    product.setName("recent_product_name");
    product.setDescription("recent_product_name");
    product.setPrice(100.0);
}

If you don't want it already with the command in product yet, you can pass the middle object fx with the command like zul and controller to this :

<button id="load_product" label="Select Most Recent Product" onClick="@command('select_recent', product = fx)"/>

and in your vm it will result in :

@Command("select_recent")
public void selectRecent((@BindingParam("product") SimpleForm fx){
    fx.setField("name", "recent_product_name");    
    fx.setField("description", "recent_product_name");    
    fx.setField("price", 100.0);
    BindUtils.postNotifyChange(null, null, fx, "*");
}

Greetz chill.

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