Revision history [back]

click to hide/show revision 1
initial version

asked 2010-05-29 12:51:39 +0800

gramberg gravatar image gramberg

DataBind: how to reload the value ?

Hi,

I try the first time with ZK + Databind.

*How do I reload teh values, when I changed data. *

The databinding works fine, I see two field with the values, now I try to have a buttom, which change a value and I want to show the changed data in the field.

I tried it like this. (see below). but the "binder.loadAll" does not show the new value "* New *".

Any idea, what could be wrong ?

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<zk>

<zscript>
<![CDATA[
    import de.gramberg.model.Gutacht;  

    Gutacht gut = new Gutacht();

    //prepare the AnnotateDataBinder
    AnnotateDataBinder binder = new AnnotateDataBinder();
    binder.bindBean("gut", gut);

]]>
</zscript>

.........

<button label="new-value / Reload" 
        onClick='gut.setKurz( "*** New ***");binder.loadAll()' />

            <intbox value="@{gut.nr,    save-when='self.onChange'}" />
            <textbox    value="@{gut.kurz, save-when='self.onChange'}" />

....

</zk>

Java Code

    public String getKurz() {
        return _kurz;
    }

    public void setKurz(String kurz) {
        _kurz = kurz;
    }
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More