0

Give ID to Popup using Binding

asked 2014-05-29 14:45:43 +0800

elmetni gravatar image elmetni
145 7

hello everyone

I m working on Zk project what i need to do is create a popup for every element inside a loop using binding .

here what i have tried to do so far but it s not seem to work

<hlayout children="@bind(menu.listMenu)" style="  padding:0px; margin:0px;"  >

            <template name="children">
                     <a sclass="menuItem" tooltip="'@bind(each.icon)' , position=after_center"   iconSclass="@bind(each.info)"  href="@bind(each.link)"  ></a>
                     <popup id="@bind(each.info)">
                            <div>
                            <label value="@bind(each.info)"> </label>
                            </div>
                     </popup>
             </template>
     </hlayout>

Can you help me pls ? thx

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-29 21:15:07 +0800

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

updated 2014-06-02 08:47:04 +0800

Well you need to set the context to your popup id.
Setting a popup only shall never show your popup.
The popup is always connected with popup or context depending on how you want to show it.

<hlayout children="@bind(menu.listMenu)" style="  padding:0px; margin:0px;"  >
    <template name="children">
        <popup id="@bind(each.info)">
            <div>
                <label value="@bind(each.info)"> </label>
            </div>
        </popup>
        <a sclass="menuItem" tooltip="'@bind(each.icon)' , position=after_center"   
               iconSclass="@bind(each.info)"  href="@bind(each.link)" 
                context="@load(each.info)"/>
    </template>
</hlayout>

Edit :After your comment I get what the problem is. Do the following:

<hlayout children="@bind(menu.listMenu)" style="  padding:0px; margin:0px;"  >
    <template name="children">
        <a sclass="menuItem" tooltip="'@bind(each.icon)' , position=after_center"   
               iconSclass="@bind(each.info)"  href="@bind(each.link)" 
                label="@load(each.info)" autodisable="self" />
    </template>
</hlayout>

Greetz chill.

link publish delete flag offensive edit

Comments

i have tried it with replacing @bind(each.info) with @bind(each.icon) ( to give iit same ID) and it still not working

elmetni ( 2014-05-29 22:47:12 +0800 )edit

tooltip is not a popup! You have to use popup or context in your anchor. Do you just want to show some tekst in a tooltip?

chillworld ( 2014-05-30 19:50:05 +0800 )edit

ya i just want to show some text

elmetni ( 2014-05-30 22:57:29 +0800 )edit

updated answer

chillworld ( 2014-06-02 08:47:15 +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-05-29 14:45:43 +0800

Seen: 12 times

Last updated: Jun 02 '14

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