0

How to force Tabpanel to be renderer?

asked 2014-09-02 02:46:57 +0800

alexhk gravatar image alexhk
3 2

updated 2014-09-05 10:58:11 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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?

delete flag offensive retag edit

Comments

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 )edit

sorry, 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 )edit

Thanks for your answer. However I have more than one tabpanel inside my form. =[

alexhk ( 2014-09-08 02:06:16 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-09-02 04:58:25 +0800

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

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.

link publish delete flag offensive edit
0

answered 2014-09-08 03:27:18 +0800

alexhk gravatar image alexhk
3 2

i have solve it by calling

zk.Widget.$("ID").forceRender()

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-09-02 02:46:57 +0800

Seen: 17 times

Last updated: Sep 08 '14

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