Results 1 to 7 of 7

Thread: How to navigate in js to a special data record, recno is known

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    304

    How to navigate in js to a special data record, recno is known

    I search for and find a specific data record by a prg file (called from Lianja.evaluate). And I get the recno().
    Then I return to the js file by "return recno" and want to display the found data record with the js file.
    How do I position the found data set in js (to display e.g. with Showdocument)
    Note: Web app

    Greetings and thanks
    Georg

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,913
    Hi Georg,

    You should be able to use the following, where mytable is your table name, xx the record number and page1.section1 the section id:

    Code:
    mycurs = Lianja.getcursor('mytable');
    mycurs.movebookmark(xx);
    Lianja.get('page1.section1').refresh();
    Regards,

    Yvonne

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    304
    Thank you very much!
    That looks very good at first. But as always, the devil is in the details.

    I assume
    - Lianja.getcursor => Lianja.getCursor
    - mycurs.movebookmark => mycurs.MoveBookmark => undefined, no function
    see: https://www.lianja.com/doc/index.php/Cursor#Notes

    Grüße
    Georg

  4. #4
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,913
    Hi Georg,

    Please use the same case as in my post.

    Regards,

    Yvonne

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    304
    >> Please use the same case as in my post <<
    OK. Sorry I had only tested with AppBuilder Desk

    Code:
    mycurs = Lianja.getcursor('ereignis');
    mycurs.movebookmark(myrecno);
    Lianja.get('page1.section1').refresh();
    AppBuilder Desk:
    1st line: TypeError: Result of expression Lianja.getcursor (undefinded) in not a function

    With Cloudserver localhost ok :-)
    But strange: f.e. is the record I searched for is #100, refresh shows the next record.

  6. #6
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,913
    Hi Georg,

    Check that the value being returned is what you are expecting.

    Also, bear in mind that if records are deleted in the web App or in a different order from the record number order then their position in the SQL recordset will not correspond to the record number in the table.

    In this case, you will need to add in a field that uniquely identifies the record. Then you will be able to filter on that value in the web App.

    Regards,

    Yvonne

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    304
    Thank you again and have a nice evening

Bookmarks

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
  •  
Journey into the Cloud
Join us