Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum $currentlayoutbreakpoint not behaving as expected

  • $currentlayoutbreakpoint not behaving as expected

    Posted by Uwe Smidt on November 16, 2023 at 5:01 pm

    Dear $all,

    I’m using the current Omnis 11 release, and when trying to figure out which layout is rendered during runtime, I’m evaluating the $currentlayoutbreakpoint property.

    First problem is that using $cinst. or $iremoteforms.$currentlayoutbreakpoint throws a notation not supported error.

    Second problem: when using $remoteforms.rfMyForm.$currentlayoutbreakpoint it only gives the Layout breakpoint selected in design mode, not the one just being rendered in the browser..

    Any ideas?

    Thanx in advance!

    Uwe

    Homer Miranda replied 2 days, 22 hours ago 4 Members · 6 Replies
  • 6 Replies
  • Michael Monschau

    Member
    November 16, 2023 at 8:54 pm

    Hi Uwe,

    The notation $cinst.$currentlayoutbreakpoint must be executed in a client executed method as that is where the property $currentlayoutbreakpoint applies. It does not exist on the server.

    The notation $remoteforms.rfMyForm… addresses the remote form class, not the runtime form instance and hence it only reports the breakpoint set in design mode.

    The. notation $iremoteforms.$currentlayoutbreakpoint is not valid without the instance name of the remote form instance, i.e. $iremoteforms.rfMyForm.$currentlayoutbreakpoint, however as I mentioned above, $currentlayoutbreakpoint can only be read on the client so addressing $iremoteforms will be of no use.

    Kind regards,

    Michael

  • Uwe Smidt

    Member
    November 17, 2023 at 11:21 am

    Hi Michael,

    This makes perfect sense – thanks for your help!

    Best regards

    Uwe

  • Uwe Smidt

    Member
    November 19, 2023 at 4:10 pm

    Damn… still not working!

    I put

    Do inherited
    Calculate myVariable as $cinst.$currentlayoutbreakpoint
    If $cinst.$currentlayoutbreakpoint=320
    Do $cinst.$objs.native_list.$width.$assign(10)
    Else If $cinst.$currentlayoutbreakpoint=768
    Do $cinst.$objs.native_list.$width.$assign(100)
    Else
    Do $cinst.$objs.native_list.$width.$assign(0)
    End If

    in my remote forms $init, but $cinst.$currentlayoutbreakpoint just doesn’t do anything

    Any ideas?

    Thanks in advance

    Uwe

    • Götz Krija

      Member
      November 20, 2023 at 12:39 pm

      Hi Uwe,

      You can override the Remoteform’s $event method and use evLayoutChanged which has a parameter pBreakpoint that contains the integer value of the (new) layout break point:

      On evLayoutChanged
      If pBreakpoint=320
      Do $cinst.$objs.native_list.$width.$assign(10)
      Else If pBreakpoint=768
      Do $cinst.$objs.native_list.$width.$assign(200)
      Else
      Do $cinst.$objs.native_list.$width.$assign(0)
      End If

      Götz

      • This reply was modified 8 months, 1 week ago by  Götz Krija.
  • Uwe Smidt

    Member
    November 21, 2023 at 4:54 pm

    Dear Götz,

    Yep, that worked fine!

    Thank you!

    Uwe

  • Homer Miranda

    Member
    July 24, 2024 at 7:17 am

    If the PostgreSQL database is the foundation of your application, you may use programs like pg_dump to produce a database dump. This will generate a file with your database’s structure and contents in it. Once restored, the receiver can use this dump with their PostgreSQL instance. Although installing PostgreSQL is necessary for this method, it is a standard procedure and less complicated than manually configuring a whole database structure.</div><div> You may be able to package your application as an executable standalone or bundle it into an installation, depending on its characteristics. https://stackoverflow.com/questions/57770303/how-to-copy-and-use-existing-postgres-data-folder-into-docker-postgres-container geometry dash lite

Log in to reply.