View Full Version : Menu and submenu

2016-02-18, 10:07
Dear all,
I would like to know if someone can assist on how to create submenu (level2 and 3) in a form.
I can only create a 1level menu using the option "custom menu" of the form. For example Fichiers(Juridiction|Confrere|Client|Affaire|Dossi er|Honoraire|Documents|Audience).
What is I want to add 2 submenus for menu item like Client in this example?



2016-02-18, 13:31
Hi Esperant,

Lianja menus are fairly simplistic.
You can only have 1 level submenu and as soon as a submenu is added, if you have keyboard shortcuts (ex. &Help), they will not work.

Menu item are separated by a comma.
Submenus are created in parentheses.

Here is an example with 2 menu items and one sub level.


As far as I'm aware, Lianja does not support any further submenus.


2016-02-22, 13:06

Lianja is very flexible in that you can approach issues from different directions.
If you have the need to create menus with many nested layers, you may want to look at adding a webview section on top of your form section and use bootstrap or jquery for the menu.

I did a demo that sort of covered this some time back.



In this case I was using a third party product to copy and past the code, but you can easily find examples on the web.

Additionally, you can try the Jquery UI menu.


Check out the example_jquery app that comes with Lianja.


Note - Last I looked, pinegrow was using bootstrap 3.3.4,so just be aware in case you want to go that route.

2016-02-22, 13:58

I will put together a full working example later today.
Something that you can just plug in and modify.


2016-02-22, 14:35

Actually - that looks like it may not work since I cant overflow the dropdown into the form section.

This is an interesting challenge. I am going to try some other approaches1241.


2016-02-22, 16:02
Here is an idea.

It's funky, but works :)

1 - create a Jquery menu (just copy it from the Jquery page)
2 - Save it as an RSP page.
3 - Set it as your custom menu panel.

Since at this time, I cant get it to overflow the form items, I set the height of the panel to 250 and set visble to false.

Then I set the custom search Icon to visible on the section.
In the custom search command delegate, I use the following code.

proc page1_section1_customsearch()
if Lianja.get("page1.section1").menuvisible = .t.
Lianja.get("page1.section1").menuvisible =.f.
Lianja.get("page1.section1").menuvisible = .t.


So this will allow you to use Jquery menu to nest as many options as you like in section menu. Not the greatest solution, I know, but it will work.

I still want to try some ideas when I have the time.

I'm also sure Barry can think of ten better ways to do this, but I thought this was a interesting question.


2016-02-22, 18:22
I need to look into our code and see why menus are limited to 2 level. If you are building a desktop app you may be able to put a custom section above the form section and create a multi level menu programmatically using the core VFP UI classes.

2016-02-23, 09:41
Hi Barry,

I have done than in the past and it works fine if you don't nest them too deep.
You and I went back and forth on that on a thread called popupmenu.

Which got me thinking about two other approaches.
1. An actual VFP style popupmenu.
2. a borderless dialog box where you can just have the menu as an RSP page..

Like so. But without the border.1244

Just my 2 pennies.


2016-02-28, 00:49
Thank you guys for your advices about how to create submenus.
But tfrom my point of view, I think menu is an important Ui component which must be easy to create in a RAID tool like Lianja.
So, I hope to see in future improvments an easiest way to built a menu in a wysiwyg way.