0

@NotifyChange not refresh textbox

asked 2014-02-19 19:03:07 +0800

osmarjoel gravatar image osmarjoel
1

I have this zul:

<window id="altaCuenta"
    apply="com.agr.ac.MyViewModel">

    <div apply="org.zkoss.bind.BindComposer"        viewModel="@id('vm') @init('com.agr.ac.MyViewModel')"
        form="@id('ac') @Load(vm.ac) @save(vm.ac, before='submit') ">

. .. and this textbox:

<textbox value="@bind(ac.dtPer.lastName)" />

in a method I do this:

@NotifyChange("ac")
public void viewInfo(String lastName) {
    ac.getDtoPer().setLastName(lastName);
}

My problem is that the textbox not refresh the lastName value with the @NotifyChange I've tried writing @NotifyChange("ac") and not work

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-19 22:03:15 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

@NotifyChange("ac") works only on setters and commands.

Now that your method isn't one of both you need to use :

public void viewInfo(String lastName) {
    ac.getDtoPer().setLastName(lastName);
    BindUtils.postNotifyChange(null,null,ac,"*");
}

Now just one remark to be sure : Are you sure that you have to save before submit? So you will save it also when costraints fails of the form.

Greetz chill.

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

Follow
1 follower

RSS

Stats

Asked: 2014-02-19 19:03:07 +0800

Seen: 59 times

Last updated: Feb 19 '14

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