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

Home Forum Omnis General Coding Getting the page number that an object is on, inside a $sendall

  • Getting the page number that an object is on, inside a $sendall

    Posted by Paul Mulroney on August 17, 2021 at 1:04 pm

    Hi $All,
    I’ve done this before, I’m sure of it! But I’m having brain fade.
    We validate our fields on a window by doing a $sendall, and then displaying the result to the user.
    It looks something like this:

    Calculate isErr as ”
    Calculate isWarn as ”
    Do $cwind.$objs.$sendall($ref.$validate)
    If len(isErr)
    OK message Validate {[isErr]}
    Quit event handler (Discard event)
    Else If len(isWarn)
    Yes/No message Validate {[isWarn]Continue anyway?}
    If flag false
    Quit event handler (Discard event)
    End If
    End If

    In this particular case, I have a paged pane, and I only want to validate fields on eg page 2. I know that I can specify a condition in the $sendall, and I know that there’s a $panenumber() method that will tell me which pane an object is on.
    I think it should be something like this:

    Calculate pnCurrentPage as 1
    Do $cinst.$objs.PagedPane.$objs.$sendall($ref.$validate,$cinst.$objs.PagedPane.$panenumber($ref)=pnCurrentPage)

    But this doesn’t do anything. Has anyone done anything like this before?
    All help gratefully received.
    Two Eskimos sitting in a kayak were chilly, so they lit a fire in the craft. Unsurprisingly it sank, proving once again that you can’t have your kayak and heat it too.

    Deleted User replied 10 months, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • Paul Mulroney

    August 19, 2021 at 1:50 am

    Hi Everyone,
    With help from the list, and some personal replies, here’s what I found:
    At first, I couldn’t get the $sendall to work, so I coded this which did work:

    Do vlObjects.$define(vrObject) ;Create a list of objects that we want to work with
    Do $cinst.$objs.PagedPane.$objs.$sendall(vlObjects.$add($sendallref)) ;Add all objects from this page pane into a list
    Begin reversible block
    Set current list vlObjects
    End reversible block
    For each line in list from 1 to #LN step 1
    If $cinst.$objs.PagedPane.$panenumber(vlObjects.vrObject)=pnCurrentPage ;This is on the page that we want to validate
    Do vlObjects.vrObject.$validate() ;Call this specific validate method
    End If
    End For

    Then I received a couple of replies, which led me to this:

    Do $cinst.$objs.PagedPane.$objs.$sendall($ref.$validate(),$cinst.$objs.PagedPane.$panenumber($sendallref)=pnCurrentPage)

    Note using $ref in the first part, and $sendallref in the second part.
    See also this tech note which explains it more fully:

  • Deleted User

    Deleted User
    December 16, 2021 at 6:12 am

    Do you ever notice how deadlines don’t affect everyone in the same way? Many of them are perplexed, while others remain composed. How can one maintain silence when under extreme stress?
    They believe that their teachers are strict deadlines. They teach you how to be in control of your personal and professional lives.
    Here are some tips for you from experts who provide assignment help Johor Bahru. Use them and effortlessly manage your tension.
    1. Relax and stay calm
    Sitting back and relaxing is one of the finest methods to deal with deadline stress. Make an effort to relax your mind. Attempt to meditate regularly. Everything will fall into place after you have regained control of your mind. Create a map and stick to it. assignment writing help Kuching You will accomplish the assignment ahead of schedule.
    2. Set the fake deadlines
    Some people prefer to wait for the final deadline. It can lead to a tense scenario. They frequently failed to turn in their assignments on time.
    Do you ever consider setting a deadline ahead of time? It has the potential to make a significant difference in your life. If you have a Friday deadline, aim to finish your task on Thursday. Create your fictitious deadlines. To acquire buffer times, professionals that provide Petaling Jaya essay writer follow this tip.
    3. Do what you want
    Your thoughts are the only thing you have power over. Prioritize the essential tasks. Allow time to pass. Then go ahead and do the extra job. That is how you should train your thinking. Give it your all. Your efforts will reward you shortly.
    4. Ask for help
    You frequently have a busy schedule and struggle to complete your assignment on time. When you require assistance, seek it. Enlist the help of your friends or teachers Research Paper Helpers. Do not leave it till the last moment. It will help you save time.
    Parting Words,
    Almost every time, students like you face a tight deadline. However, managing them is a challenge. Make a difference in your life by following these suggestions. Best wishes!

Log in to reply.