Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: hideActionBarButtons

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    369

    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

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,164
    Blog Entries
    22
    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.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    369
    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

  4. #4
    Senior Member
    Join Date
    Jan 2014
    Posts
    369
    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

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,164
    Blog Entries
    22
    Hi Simon

    The hamburger menu activates pages.

    How are you using that to activate sections with stacked accordion behavior?
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Senior Member
    Join Date
    Jan 2014
    Posts
    369
    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

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,164
    Blog Entries
    22
    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.
    Last edited by barrymavin; 2022-04-11 at 20:55.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    Senior Member
    Join Date
    Jan 2014
    Posts
    369
    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

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,164
    Blog Entries
    22
    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.
    Last edited by barrymavin; 2022-04-12 at 06:26.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,164
    Blog Entries
    22
    This has been corrected. The state of the actionbar is maintained after save.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us