Alpha Video Training
Results 1 to 6 of 6

Thread: Navigation bar, page control

  1. #1
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,699

    Default Navigation bar, page control

    In a list with a navigation bar, I selected the option to enter into the current page control. When I enter a page number I get the attached message saying List1 not found. I don't find a reference to list1 anywhere, and of course that is not the name of my list.

    Bill.
    Attached Images Attached Images

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,549

    Default Re: Navigation bar, page control

    This looks like a bug. Or maybe it's a feature that has not yet been implemented. Either way... you should report it.

    This is the rendered HTML you get for the Navigation Bar Current Page Number input control...

    Code:
    <input class="editPrimary" style="width: 100px" value="1" onkeyup="if(event.keyCode == 13) {window['DLG1_DlgObj']._listNavigateToPage('list1',this.value)}">
    Alpha has hard coded "list1" into the HTML... into the function. Alpha also makes this hard to get to. Every element surrounding this Current Page Number input has an id... this input does not.

    Further, even a change to the onkeyup code gets overwritten by Alpha's static "list1" every time the list is rendered... which means every time you ask for a page.

    So, to implement this feature, we need to use the List control onListDraw event. We need to get access to the control in front of the Page Number input. This control is the Previous Page.

    Using the Previous Page id, we can get access to the next element... which is our Page Number. Now we can change it's behaviour.

    Code:
    setTimeout(function(){
    	var cpnInput = $('{dialog.ComponentName}.V.R1.PERSON_LIST.CONTROL.PREV').nextElementSibling;
    	cpnInput.onkeyup=function onkeyup(event){if(event.keyCode == 13) {window['DLG1_DlgObj']._listNavigateToPage('Person_list',this.value);}};
    },100);
    This grabs the next sibling element of the Previous Page element. Then we change the onkeyup function to something that works.

    I'm not sure how advisable it is to do this... but it works... and doesn't seem to hurt anything. You should actually test cpnInput a bit to ensure it's what you really want... as Alpha could change things at any time and shove something else in between the Prev Page and the Page Number.

  3. #3
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,699

    Default Re: Navigation bar, page control

    David, you are obviously the DOM whisperer. I knew this was going to bring a chuckle when I pasted your code, and it did. :-)

    I fixed this one, and will leave another broken just so I can show the client that there are in fact people that can figure this stuff out!

    I did report it, so hopefully we won't need to rely on the dependencies in this code forever.

    Bill.

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,549

    Default Re: Navigation bar, page control

    Code just needs to be put in place to pick up the proper List name. Many of the Alpha List examples are using "LIST1" and static data. If the Page Number feature was tested it most likely would have worked since the video introducing the Navigation Bar is using "LIST1". It's interesting that there is code in this feature to verify the List used.

    Glad the temp fix worked.

  5. #5
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,699

    Default Re: Navigation bar, page control

    Selwyn said this is fixed in the next pre-release.

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,549

    Default Re: Navigation bar, page control

    This is safer code to use... it uses, as it should, a ComponentName Placeholder... instead of hardcoding "DLG1"...

    Code:
    setTimeout(function(){
    	var cpnInput = $('{dialog.ComponentName}.V.R1.PERSON_LIST.CONTROL.PREV').nextElementSibling;
    	cpnInput.onkeyup=function onkeyup(event){if(event.keyCode == 13) {window['{dialog.ComponentName}_DlgObj']._listNavigateToPage('Person_list',this.value);}};
    },100);

Similar Threads

  1. Pre-release List Page Navigation Bar
    By Davidk in forum Mobile & Browser Applications
    Replies: 7
    Last Post: 11-07-2018, 07:10 PM
  2. Grid locks up on page navigation
    By J.R. Noe in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 04-09-2013, 04:30 PM
  3. Causes of slow page navigation?
    By kingcarol in forum Application Server Version 11 - Web/Browser Applications
    Replies: 36
    Last Post: 03-05-2012, 04:10 AM
  4. Navigation Component in html page
    By rleunis in forum Web Application Server v7
    Replies: 5
    Last Post: 04-26-2006, 09:44 AM
  5. Navigation Bar – Positioning in Web Page
    By chandran in forum Web Application Server v7
    Replies: 5
    Last Post: 03-12-2006, 12:04 PM

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
  •