Alpha Video Training
Results 1 to 9 of 9

Thread: Set focus in large UX

  1. #1
    Member
    Real Name
    Keith Stansbury
    Join Date
    Sep 2013
    Posts
    91

    Default Set focus in large UX

    I have a large UX with several embedded grids. I want the ux to end up at the top left after it is completely loaded.
    I used {dialog.Object}.setFocus('STOCKNUMBER'); in the onRenderComplete, but it's not working.
    'STOCKNUMBER' is a label control on the top left of the UX.

    I think that the grids are still loading and somehow take the focus back.

    Any ideas would be great.

  2. #2
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,596

    Default Re: Set focus in large UX

    You might try the onInitializeComplete event.

    And if it still doesn't work there, then wrap it with a delay:

    Code:
    setTimeout(function() {
       {dialog.Object}.setFocus('STOCKNUMBER');
       },1000);
    You'll discover you can adjust the delay substantially in most cases without having a problem - even 2 or 3 seconds may end up working quite well.

    That control probably also has a checkbox in the properties to set "Initial Focus". This usually works quite well.
    -Steve


  3. #3
    Member
    Real Name
    Keith Stansbury
    Join Date
    Sep 2013
    Posts
    91

    Default Re: Set focus in large UX

    That didn't work. One thing I think it could be is there are 3 list controls, that are "searched" onRenderComplete

    {dialog.object}.getControl('PHOTOSLIST').searchList({searchMode : 'auto'});

    I'm not sure that the setFocus is happening after the lists are done.

  4. #4
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,590

    Default Re: Set focus in large UX

    Mobile or Desktop? Are you using PANELCARDS? if so select Scroll to top on focus, if you're not as its a browser build just try and wrap the whole thing in a panelcard anyhow and select scroll to top onfocus - see what happens.
    2019-07-22_2341.png
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  5. #5
    Member
    Real Name
    Keith Stansbury
    Join Date
    Sep 2013
    Posts
    91

    Default Re: Set focus in large UX

    I'm still ending up at the top of the last list that finishes loading. It's normally the same one, but sometimes it's a different list, which is why I though at first it was random.

  6. #6
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,590

    Default Re: Set focus in large UX

    What about using delay render until visible on the lower components?
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  7. #7
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,322

    Default Re: Set focus in large UX

    Hi Keith,

    It sounds like the grids are loading a large amount of data.
    Have you considered an initial filter that would limit the number of rows initially returned?
    I have a ux with an embedded grid (over 1/2 million records in the grid) that frustrated me
    because it would take forever to load until I set the initial filter to return 0 rows, then had
    the user provide their criteria for the grid.

  8. #8
    Member
    Real Name
    Keith Stansbury
    Join Date
    Sep 2013
    Posts
    91

    Default Re: Set focus in large UX

    the max load on the embedded grids is 20-30. I added a div in the top left and button it the two places that you end up, with

    document.getElementById('topleft').focus();

    And the button works fine. I have tried timers and onRenderComplete. Nothing works. Is there anywhere I can put the javascript that fires after everything is loaded. UX / Lists / Embedded grids etc...

  9. #9
    Member
    Real Name
    Keith Stansbury
    Join Date
    Sep 2013
    Posts
    91

    Default Re: Set focus in large UX

    Can you do delay render on embedded grids?

Similar Threads

  1. What to do with large MDB
    By gagsoft in forum Alpha Five Version 9 - Desktop Applications
    Replies: 8
    Last Post: 04-17-2009, 06:29 AM
  2. Large .sem
    By charliejohnson in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-26-2006, 01:33 PM
  3. Large ALM file
    By richkerr in forum Alpha Five Version 5
    Replies: 6
    Last Post: 03-30-2003, 03:43 PM
  4. Large Applications
    By Thomas Henkel in forum Alpha Five Version 5
    Replies: 8
    Last Post: 08-23-2002, 05:32 PM
  5. Large Tables
    By Larry Guest in forum Announcements
    Replies: 2
    Last Post: 11-25-2001, 03:01 AM

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
  •