0

How to get UUID of a component in zul file in ZK framework

asked 2014-12-19 11:48:22 +0800

jpsraga gravatar image jpsraga
1

I have requirement where I need to pass a UUID of a component(zk textbox in my case) in an applet param tag in .zul file. I tried to google as to how to get UUID in .zul but no luck. Please help me out.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-19 12:01:19 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

a few samples:

<textbox id="message" w:onOK="sendMessage();" />

JavaScript sample:

/*
 * Send message.
 */
function sendMessage() {

    // send only if text exists
    var str = zk('$message').$().getValue();
    if (str.length === 0) {
        return;
    }

/*
 * Collapse / Expand a div (panel). CALL in zul: 
 *<button ... w:onClick="ox_CollapseUnCollapsePanel('divUserRoleList1',this)" /> 
 * where the divname is in the tag attribute 'name' like:
 * 
 * <n:div name="divUserCRUD1" class="panel-collapse collapse in">
 */
function ox_CollapseOrUnCollapsePanel(panelID, btn) {

    if (panelID !== null) {

        if ($("[name~=" + panelID + "]").hasClass('collapse') && $("[name~=" + panelID + "]").hasClass('in')) {
            // close panel
            $("[name~=" + panelID + "]").removeClass('in');
            // change button 'close' icon
            $('#' + btn.uuid).removeClass('fa-arrow-up');
            $('#' + btn.uuid).addClass('fa-arrow-down');
        } else {
            // open panel
            $("[name~=" + panelID + "]").addClass('in');
            // change button 'open' icon
            $('#' + btn.uuid).removeClass('fa-arrow-down');
            $('#' + btn.uuid).addClass('fa-arrow-up');
        }
    }
}
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-12-19 11:48:22 +0800

Seen: 28 times

Last updated: Dec 19 '14

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