Revision history [back]

click to hide/show revision 1
initial version

asked 2024-01-18 07:11:59 +0800

lramellavotta gravatar image lramellavotta flag of Italy

How retrieve old value for dirty fields

Hi,

I use Simple Form to retrieve old value from a form field to check some condition. I used, some years ago, ZK Ver.6. I tried to start new project with ZK 9.6.0.1 to test some idea... with a little bit of problems. Retrieve old value from SimpleForm is fundamental for me. Any idea? Thanks Luca

Form: form="@id('gbD') @init(vm.myForm) @load(vm.selected) @save(vm.selected, before='save')" id="formGroup" visible="@load(not empty vm.selected)" hflex="true" mold="3d" validationMessages="@id('vmsgs')" contentStyle="border: none"> <grid hflex="true"> <columns> <column label="Campo" width="150px"/> <column label="Contenuto"/> </columns> <rows> <row> Operatore <hbox> Tipo <hbox> <radiogroup id="chkTipoUtente" selecteditem="@bind(gbD.tipo_operatore)"> <radio label="Amministratore" value="A"/> <radio label="Utente" value="U"/> <radio label="Segreteria" value="S"/> </radiogroup> </hbox> </row>

Controller: ... if(myForm.getField("tipooperatore").equals("A") && selected.GetTipooperatore().equalsIgnoreCase("U") ...

How retrieve old value for dirty fields

Hi,

I use Simple Form to retrieve old value from a form field to check some condition. I used, some years ago, ZK Ver.6. I tried to start new project with ZK 9.6.0.1 to test some idea... with a little bit of problems. Retrieve old value from SimpleForm is fundamental for me. Any idea? Thanks Luca

Form: Form:

form="@id('gbD') @init(vm.myForm) @load(vm.selected) @save(vm.selected, before='save')"
id="formGroup" visible="@load(not empty vm.selected)" hflex="true"
mold="3d" validationMessages="@id('vmsgs')" contentStyle="border: none">
<grid hflex="true">
<columns>
    <column label="Campo" width="150px"/>
width="150px" />
    <column label="Contenuto"/>
label="Contenuto" />
</columns>
<rows>
    <row>
    Operatore
    <hbox>
    Tipo
    <hbox>
    <radiogroup id="chkTipoUtente" selecteditem="@bind(gbD.tipo_operatore)">
selectedItem="@bind(gbD.tipo_operatore)">
    <radio label="Amministratore" value="A"/>
value="A" />
    <radio label="Utente" value="U"/>
value="U" />
    <radio label="Segreteria" value="S"/>
value="S" />
    </radiogroup>
    </hbox>
    </row>

Controller: ... if(myForm.getField("tipooperatore").equals("A") </row>

Controller:

if(myForm.getField("tipo_operatore").equals("A") && selected.GetTipooperatore().equalsIgnoreCase("U") ...

selected.GetTipo_operatore().equalsIgnoreCase("U")

How retrieve old value for dirty fields

Hi,

I use Simple Form to retrieve old value from a form field to check some condition. I used, some years ago, ZK Ver.6. I tried to start new project with ZK 9.6.0.1 to test some idea... with a little bit of problems. Retrieve old value from SimpleForm is fundamental for me. Any idea? Thanks Luca

Form:

<div form="@id('gbD') @init(vm.myForm) @load(vm.selected) @save(vm.selected, before='save')"
id="formGroup" visible="@load(not empty vm.selected)" hflex="true"
mold="3d" validationMessages="@id('vmsgs')" contentStyle="border: none">
<grid hflex="true">
<columns>
    <column label="Campo" width="150px" />
    <column label="Contenuto" />
</columns>
<rows>
    <row>
    Operatore
    <hbox>
    Tipo
    <hbox>
    <radiogroup id="chkTipoUtente" selectedItem="@bind(gbD.tipo_operatore)">
    <radio label="Amministratore" value="A" />
    <radio label="Utente" value="U" />
    <radio label="Segreteria" value="S" />
    </radiogroup>
    </hbox>
    </row>

Controller:

if(myForm.getField("tipo_operatore").equals("A") && 
selected.GetTipo_operatore().equalsIgnoreCase("U")
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More