1

How to pass parameter with Command

asked 2014-11-30 11:24:22 +0800

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

updated 2014-12-01 05:24:47 +0800

I have below condition

   <listcell>
    <label value="${each}"></label>
    <menupopup id="${each}">
        <menuitem label="@load(vm.getText('AccountBillFeeDetail:CB_BILL_REPORT'))" onClick="@command('printBill',billNumber = '${each.value}')" />
        <menuitem label="Void" />
        <menuitem label="Show GL" />
        <menuitem label="Edit Details" />
    </menupopup>
    <div class="btn-group">
        <button dir="reverse" class="btn-default dropdown-toggle" popup="${each}, after_start" iconSclass="caret">
            Action
        </button>
    </div>
</listcell>
</zk>

in the above code i want to pass parameter with a command how to achieve this ?

@Command
   @NotifyChange("*")
   public void printBill(@ContextParam(ContextType.VIEW) Component comp,@BindingParam("billNumber") String value) {
    }

Edit:-

<template name="model:group" var="groupNameList">
<listgroup>
    <zk forEach="${groupNameList}">
        <zk if="${each != '' || 'Paid' || 'Cancelled'}">
            <zk if="${c:startsWith(each,'Outstanding')}">
                <listcell>
                    <label value="${each}" style="font-weight:bold;font-size:13px;color:red;"></label>
                </listcell>
            </zk>
            <zk if="${c:startsWith(each,'Date')}">
                <listcell span="2">
                    <label value="${each} "></label>
                </listcell>
            </zk>
            <zk if="${c:startsWith(each,'Due')}">
                <listcell span="2">
                    <label value="${each} "></label>
                </listcell>
            </zk>
            <zk if="${c:startsWith(each,'Bill')}">
                <listcell>
                    <label value="${each}"></label>
                </listcell>
            </zk>
        </zk>

        <zk if="${c:startsWith(each,'id')}">
            <listcell>
                <label value="${each}"></label>
                <menupopup id="${each}">
                    <menuitem label="@load(vm.getText('AccountBillFeeDetail:CB_BILL_REPORT'))" onClick="@command('printBill',billNumber =  'each.value' )" />
                    <menuitem label="Void" />
                    <menuitem label="Show GL" />
                    <menuitem label="Edit Details" />
                </menupopup>
                <div class="btn-group">
                    <button dir="reverse" class="btn-default dropdown-toggle" popup="${each}, after_start" iconSclass="caret">
                        Action
                    </button>
                </div>
            </listcell>
        </zk>

        <zk if="${each eq 'Paid'}">
            <listcell>
                <headerpanel status="Paid"></headerpanel>
            </listcell>
        </zk>
        <zk if="${each eq 'Cancelled'}">
            <listcell>
                <headerpanel status="Cancelled"></headerpanel>
            </listcell>
        </zk>
    </zk>
</listgroup>

</template>

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-12-01 08:55:59 +0800

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

I found this solution which is working for me

<custom-attributes b="${each}"/>
<menuitem label="@load(vm.getText('AccountBillFeeDetail:CB_BILL_REPORT'))"
        onClick="@command('printBill',billNumber = b)" />
link publish delete flag offensive edit

Comments

1

nice that you have found your answer.

chillworld ( 2014-12-01 09:08:56 +0800 )edit

Yes thanks

sjoshi ( 2014-12-01 11:46:22 +0800 )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-11-30 11:24:22 +0800

Seen: 50 times

Last updated: Dec 01 '14

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