# Pop-up in lists (Apple style)

**URL:** <https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434>\
**Category:** Classic Servoy\
**Created:** [September 11, 2006, 4:15pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434 "2006-09-11T16:15:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 11, 2006, 4:15pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/1 "2006-09-11T16:15:00Z")

</div>

Hello All

As the normal pop-up (drop-down) menues are not so well suited for lists I would like to use the ones Apple uses in its applications (Mail, iCal, …) where a pop-up in a list shows only the two flat (up/down) arrows (not the usual three dimensional aqua blue pop-up). Does anybody use them for lists and how can they be achieved?

A hint is very much appreciated!

Best regards, Robert

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [September 11, 2006, 4:27pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/2 "2006-09-11T16:27:24Z")

</div>

> Robert Huber:  
> A hint is very much appreciated!

Here is one hint:

popup menu plugin ![;)]( "Wink")

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 11, 2006, 4:32pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/3 "2006-09-11T16:32:24Z")

</div>

Hi Robert

Thanks for the hint ![;-)]( "Wink") Have you got a little screenshot to see how the result would look like ![:-?]( "Confused")

Thanks and best regards, Robert

> ROCLASI:
> 
> > Robert Huber:  
> > A hint is very much appreciated!
> 
> Here is one hint:
> 
> popup menu plugin ![;)]( "Wink")

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [September 11, 2006, 6:36pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/4 "2006-09-11T18:36:40Z")

</div>

Hi Robert,

Here is one.

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 15, 2006, 3:18pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/5 "2006-09-15T15:18:00Z")

</div>

Hi Robert

Looks good! I would like it to use in lists instead of the normal popup but can’t figure out how to program it. The sample code looks quite complicate. Is it (quite) easily to use as a replacement for lists and would you lend me a programming example?

Thanks a lot in advance, Robert

> ROCLASI:  
> Hi Robert,
> 
> Here is one.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [September 15, 2006, 4:07pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/6 "2006-09-15T16:07:53Z")

</div>

Hi Robert,

I guess the small arrows up and down are a picture. When you have that the rest is easy.

attach a method to the picture with the following content:

```auto
var menu = new Array(
	plugins.popupmenu.createMenuItem('choice 1',choiceMethod),
	plugins.popupmenu.createMenuItem('choice 2',choiceMethod),
	plugins.popupmenu.createMenuItem('choice 3',choiceMethod),
	plugins.popupmenu.createMenuItem('choice 4',choiceMethod),
	plugins.popupmenu.createMenuItem('choice 5',choiceMethod),
	plugins.popupmenu.createMenuItem('-'),
	plugins.popupmenu.createMenuItem('choice 6',choiceMethod)
)

menu[0].setMethodArguments([1]);
menu[1].setMethodArguments([2]);
menu[2].setMethodArguments([3]);
menu[3].setMethodArguments([4]);
menu[4].setMethodArguments([5]);
menu[6].setMethodArguments([6]);

var elem = elements[application.getMethodTriggerElementName()]
if (elem != null) {
	plugins.popupmenu.showPopupMenu(elem, menu);
}

```

Now create a method choiceMethod() (can be global or not) and evaluate the arguments like```  
application.output(arguments[0]);

```auto

Don't forget to name the parent button/element
```

---

<div class="post-metadata">

**Author:** ![grahamg](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@grahamg](https://forum.servoy.com/u/grahamg)\
**Post date:** [September 15, 2006, 4:10pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/7 "2006-09-15T16:10:05Z")

</div>

Hi Robert H

Drop down menus are very useful - some quick code follows to get you started:

First method sets up the Items that will show in the popMenu list and methods they will trigger. This method is called from a Search icon on Contacts Form.

> \*-----------------  
> CP\_Search\_popMenu
> 
> create popup menu array  
> display popup menu  
> -----------------\*
> 
> var menu = new Array(  
> plugins.popupmenu.createMenuItem(‘Detailed Search’, CP\_Search\_popActions),  
> plugins.popupmenu.createMenuItem(‘Clients’, CP\_Search\_popActions),  
> plugins.popupmenu.createMenuItem(‘Suppliers’, CP\_Search\_popActions),  
> plugins.popupmenu.createMenuItem(‘Admin’, CP\_Search\_popActions),  
> plugins.popupmenu.createMenuItem(‘Hotlist’, CP\_Search\_popActions)  
> )
> 
> //create arguments for the method calls  
> var x = 0  
> while (menu)  
> {  
> menu.setMethodArguments(x)  
> x ++  
> }
> 
> //pop up the menu  
> plugins.popupmenu.showPopupMenu(elements.PopMenu, menu);

You could call individual Methods directly but for ease of reading/debugging later I use a seperate Method to group everythying together. As you will see you can either set fields/variable or call a new method.

> \*-----------------  
> CP\_Search\_popActions
> 
> get Action selected from CP\_Search\_popMenu
> 
> -----------------\*
> 
> var vAction = arguments[0] // arg from popupMenu plugin
> 
> switch( vAction )  
> {  
> case 0: globals.g\_NotAvailable(); break;
> 
> case 1: globals.gText01 = ‘Client’; break;
> 
> case 2: globals.gText01 = ‘Supplier’; break;
> 
> case 3: globals.gText01 = ‘Admin’; break;
> 
> case 4: forms.wx\_j\_cont\_hotlist.loadHotlist(globals.gcurr\_Staff\_ID); break;
> 
> }

Hope this helps

Graham Greensall  
Worxinfo Ltd

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [September 15, 2006, 4:13pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/8 "2006-09-15T16:13:59Z")

</div>

Graham, I have beaten you with 3 minutes ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![grahamg](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@grahamg](https://forum.servoy.com/u/grahamg)\
**Post date:** [September 15, 2006, 4:18pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/9 "2006-09-15T16:18:32Z")

</div>

. . . . . and you used half as much code. Maybe I’d better sign up for your SW Javascript course instead of having a day off ![:)]( "Smile")

Graham

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [September 15, 2006, 4:22pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/10 "2006-09-15T16:22:26Z")

</div>

Not really Graham, your example explains a little more… Just take a day off ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 15, 2006, 5:05pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/11 "2006-09-15T17:05:40Z")

</div>

Hi Marcel, Hi Graham

Thanks a lot for your examples, I will try them in my application ![:-)]( "Smile")  
is it also possible to show values from a table or is it intended for fixed menu items (only)?

Best regards, Robert

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [September 15, 2006, 5:10pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/12 "2006-09-15T17:10:33Z")

</div>

You (can) create the popup every time over again so yes, you can of course also use table contents.

Simply a little more coding but not much more I guess…

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [September 19, 2006, 4:42pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/13 "2006-09-19T16:42:54Z")

</div>

**Be aware** - the popUpMenu plug-in is NOT Web Client compatible…

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 19, 2006, 5:05pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/14 "2006-09-19T17:05:17Z")

</div>

Thanks Bob for this Info!

Best regards, Robert

> bcusick:  
> **Be aware** - the popUpMenu plug-in is NOT Web Client compatible…

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [September 19, 2006, 5:06pm UTC](https://forum.servoy.com/t/pop-up-in-lists-apple-style/6434/15 "2006-09-19T17:06:20Z")

</div>

Thanks Bob for this Info!

Best regards, Robert

> bcusick:  
> **Be aware** - the popUpMenu plug-in is NOT Web Client compatible…
