-
hideActionBarButtons
Hi guys
Trying to use the new hideActionBarButtons() function to control which actionbar buttons are visible when we move between sections on a single page app in web. Accordion Behaviour = true
We tried using the Expand/Collapse delegates but no dice. So now we are calling a function from the section.Activate() delegate which contains :
Lianja.get("pcust").hideActionBarButtons("add", "delete");
but nothing seems to happen.
In Runtime using we can make section.Activate() call hideactionbar() work but not in web.
Do we need to call some extra refresh to make hideActionBarButtons() or hideactionbar() work in web?
Thanks in advance.
Simon
-
Hi Simon
The "Activate" delegate is called for a section being selected in an "accordion stack".
Lianja.get("page1").hideActionBarButtons("add,dele te");
and
Lianja.get("page1").showActionBarButtons("add,dele te");
I have updated the example_accordionstack app in the distro to hide and show actionbar buttons as you select the sections by clicking on the footer buttons. Study this.
-
Hi Barry
Thanks for syntax confirmation.
Struggled at first with this but think we have found out why.
When a section is activated using Lianja.showDocument("section:section?action=select ");
as per the example app hideActionBarButtons / showActionBarButtons both work great.
However, when a section is activated from the hamburger menu, nothing happens.
Is there a way that we can get the same behaviour using hamburger menu rather a section menu?
Thanks
Simon
-
Hi Barry
Thanks for syntax confirmation.
Struggled at first with this but think we have found out why.
When a section is activated using Lianja.showDocument("section:section?action=select ");
as per the example app hideActionBarButtons / showActionBarButtons both work great.
However, when a section is activated from the hamburger menu, nothing happens.
Is there a way that we can get the same behaviour using hamburger menu rather a section menu?
Thanks
Simon
-
Hi Simon
The hamburger menu activates pages.
How are you using that to activate sections with stacked accordion behavior?
-
Hi Barry
single page app. page = pcust.
navmenu.txt is :
Welcome#lib:/images/salesman.png#pcust.welcome
Customers#lib:/images/man-woman.png#pcust.scust
Wants#lib:/images/shopping.png#pcust.wants
Part Exchange#lib:/images/car.png#pcust.spx
Appraisal#lib:/images/wrench.png#pcust.appraisal
Image Gallery#lib:/images/camera.png#pcust.images
Notes#lib:/images/note-01.png#pcust.snotes
Does that make sense? We've done it like this for ages.
Cheers
Simon
-
Hi Simon,
All Lianja Apps are SPA (Single Page Apps).
You are referring to the "Navigation Panel" on the left side of a page not the "pages menu" aka the "hamburger menu".
Yes the "activate" delegate was not being called when navigating to stacked sections using the navigation panel. I have corrected this in 7.2Beta23.
-
Hi Barry
That works nicely now thank you.
Have noticed that whichever buttons are hidden, after an edit ie when you save, all the actionbarbuttons return.
Do we need some form of currentpage logic to call again Lianja.showDocument("section:section?action=select "); ?
Cheers
Simon
-
Hi Simon
The hiding of the icons is specific to your section. You have full page edit specified so the edit occurs for all sections. You can try the afteredit delegate for the meanwhile.
As you say, you could deselect a section in the afteredit.
I’ll look into it.
-
This has been corrected. The state of the actionbar is maintained after save.