-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Dear all,
I have some tabs inside a form and I need to validate the fields when user submit the form. When user click submit button, the form is validated first then submit. Custom server constraint is used.
However the Textbox
is not rendered if the user haven't click on the tab. the error message cannot be shown using the following function.
Clients.wrongValue((Component) this, "Empty is not allowed!");
How can I force the tabpanel content to render?
Try this :
throw new WrongValueException(tab,"Your message");
If you are using MVVM and have no clue how you get your tabPanel(or other component) :
<tabbox width="400px">
<tabs>
<tab label="Tab 1" />
<tab label="Tab 2" />
</tabs>
<tabpanels>
<tabpanel id="panel1">This is panel 1
<button onClick="@command('save',comp = panel1)">
</tabpanel>
<tabpanel id="panel2">This is panel 2</tabpanel>
</tabpanels>
</tabbox>
Java :
@Command
public void save(@BindingParam("comp")Tabpanel tab) {
//...
}
Greetz chill.
Asked: 2014-09-02 02:46:57 +0800
Seen: 17 times
Last updated: Sep 08 '14
Please help me in form binding
Where can I find a good template?
How close "father" window after creating "child" window
Notify Form of property change
How to handle lists and complex types with form?
ZK phone masking not working in IE11
Set Click in a textbox with zk
How to link the ZK form with submit button
Thanks for your answer, however I need to render the tabpanel first to validate them. It seems that it is not a good idea to put some textbox inside the tabpanel .
alexhk ( 2014-09-02 10:49:26 +0800 )editsorry, I see now the comment cause you didn't commented on mine post I'll get no notification. Possible solution => put the submit button in the tab or select the tab by code? Possibel to add (part) zul and controller/vm?
chillworld ( 2014-09-04 12:33:55 +0800 )editThanks for your answer. However I have more than one tabpanel inside my form. =[
alexhk ( 2014-09-08 02:06:16 +0800 )edit