How to prevent menu from showing in landscape

How to prevent menu from showing in landscape

  

The menu is showing by default in landscape (P10 mobile).  I would like to stop this on a particular screen (a wizard) to ensure correct navigation behaviour.  Is there a simple way of toggling that behaviour?

Hi Trevor,

Are you referring to the menu accessed by swiping from the left side of the screen? Could you share an OML or screenshot to help us better understand what you're talking about?

Hi Yes ... as apposed to all the other menus in P10 mobile that open when a tablet is in landscape .....  

sorry ... to avoid confusion ... I would like to be able to stop the mobile app menu .....  the default and only menu .... from showing automatically when a tablet is held in landscape mode ......   I could send screen shots with arrows pointing to the menu ... but I am rather hoping that my description of the menu ... you know that thing that slides in from the left ....  will suffice and that you might be able to understand the bit I am talking about without a video link...    its the fly out menu ... do you know what I mean ? .....  the bit thats called menu ... i.e. the menu block .....?  I am hoping this will help you better understand ... what I mean when I say ... the menu .....   !    I am not feeling confident here. Id rather not have to send screen shots OMLs or any other means of clarifying what the menu is ... to the people who created the product.....   

Hi Trevor,

No need for the sarcasm, we're all here to learn and to help each other.

Also, I'm flattered that you think I do, but I don't actually work for Outsystems. :)

Now, since you've clarified that you were referring to the menu automatically shown in tablets when in landscape mode, I've managed to find a way to disable it in particular screens. Create a client action to handle the screen's "On Render" event and add a "JavaScript" element with the following code:

document.getElementsByTagName("body")[0].className = "tablet";

You'll also have to handle the screen's "On Destroy" event to restore the default menu behavior. So, in that action, use the following JavaScript code:

document.getElementsByTagName("body")[0].className = "landscape tablet";

I hope that helps.

Hi Aurelio

Please accept my most sincere apologies .....   I did assume that you worked for out systems.   I get frustrated with their support.  Every time you ask a question it becomes a major drama ... and I end up working it out for myself.  I come from a non web dev background (c++, c# etc) so i don't think java script ...... but I pick things up quick  :-)

I thank you in advance ....

I did feel better after the sarcasm though :-)

Aurelio Santos wrote:

Hi Trevor,

No need for the sarcasm, we're all here to learn and to help each other.

Also, I'm flattered that you think I do, but I don't actually work for Outsystems. :)

Now, since you've clarified that you were referring to the menu automatically shown in tablets when in landscape mode, I've managed to find a way to disable it in particular screens. Create a client action to handle the screen's "On Render" event and add a "JavaScript" element with the following code:

document.getElementsByTagName("body")[0].className = "tablet";

You'll also have to handle the screen's "On Destroy" event to restore the default menu behavior. So, in that action, use the following JavaScript code:

document.getElementsByTagName("body")[0].className = "landscape tablet";

I hope that helps.

Hi Aurelio

That worked perfectly .... except that when the orientation is changed the render event is not triggered so if the orientation is changed to portrait and back to landscape the menu comes back .....  i need an OnOrientationChanged event ?