Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Moving records in web

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    262

    Moving records in web

    Hi guys

    In our web app, we are using a grid to choose an existing customer record - click on the row, return the record number, go to that record number & refresh - easy.

    We are using Lianja.getCursor("customer").moveBookmark(lnrecno) ;

    Which seems to work fine

    However when we change sections, we cannot get them to mirror the change.

    We are calling

    Lianja.getElementByID("page1.section1").goto(lnrec no);

    for each section in turn

    How do we get the record number change to be reflected across the app in web? Obviously it works fine in dev but that is totally different.


    Anyone got any ideas?

    Thanks in advance

    Simon

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Using record numbers like that is desktop bound. It is better to search based on a key if you need to manually relate sections like that. Why don’t you just relate the sections and let the framework take care of it rather than coding things manually when you don’t need to.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    Thanks Barry

    Ok - search on a key and locate the corrct record but what is the best way (syntax) to then update the record for all the sections on the page so that both the display and the edit all works correctly in synch?

    If we are not using record numbers (because, as you say, it is not appropriate in web) to tell the section which record to display, how do we do that?

    Would it make more sense to search in js or serverside? We have looked at all the web demo apps but cannot see anything like this.

    Cheers

    Simon
    Last edited by SpringBox; 2019-11-26 at 17:34.

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Can you explain what you mean by all in sync. Are you data binding more than one section to the same data source?

    Records in a grid are editable both inline and by a slide in Dialog when you double click.

    Show me a screenshot.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    We have added an additional readonly grid section to allow the user to quickly find a partaicular record. The grid is the only thing in the section

    Once they click on a row, we want to take that selected record and change the record pointer in all the other sections that are bound to the same table. This record changing would be the same effect as clicking on navigation buttons - ie all the other sections match the newly chosen record.

    If there s a better way than the the way we are thinking, that is great too.

    Sent you a screenshot.

    Cheers

    Simon
    Last edited by SpringBox; 2019-11-26 at 18:05.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Just set a filter on all of the sections you want updated and then refresh them.

    Whats wrong with using "Instant Search".
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    Instant search works great for a quick search but sometimes you want to see all the "Smiths" so you can pick the right one, based on address, postcode, email or something else. Cycling through them one at a time is too slow when there are many.

    We have tried setting a filter and it does work in dev and persists but in web it changes for a second then the record reverts to the previous one when the section is activated.

    To set the fileter we are using :

    lcustid = guid()


    function pcust_sgrid_changed(lcustid)
    {

    // get selection from the grid and mover record pointer.

    var lfilter = "cust_id == " + lcustid;

    Lianja.getElementByID("page1.section1").filter = lfilter;
    Lianja.getElementByID("page1.section1").refresh();

    };


    Where would be the best place to remove the filter?

    Thanks in advance


    Simon

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    As I stated in my email to you...

    Your code is all wrong. You need to construct a string on the right hand side of the ==. see below.

    function pcust_sgrid_changed(lcustid)
    {
    var lfilter = "cust_id == '" + lcustid + "'";

    Lianja.getElementByID("pcust.welcome").filter = lfilter;
    Lianja.getElementByID("pcust.scust").filter = lfilter;
    Lianja.getElementByID("pcust.spx").filter = lfilter;
    Lianja.getElementByID("pcust.appraisal").filter = lfilter;
    Lianja.getElementByID("pcust.wants").filter = lfilter;
    };


    And the reason the data you just looked up reverts what you have filtered is that you have the grid on the same page so it is refreshed when you select any of the forms in the accordion stack.


    Put the grid in its own page and it will work.


    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    262
    Thanks Barry

    That works well.

    Given the event firing sequence, where would be the best place to automatically remove the filtercondition - section.Refresh() or somewhere else?

    Cheers

    Simon

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Removing the filter will select all records starting at the first.

    If you have designed your UI to select records based on clicking on the grid then how else are you wanting to navigate the data.

    You could have a section menu on each of your form sections with a single menu pad “Reset Filter” or whatever you want to call it.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Page 1 of 3 123 LastLast

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