Results 1 to 9 of 9

Thread: Getting there but a Few pointers please

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

    Getting there but a Few pointers please

    Hi guys

    Sorry this was accidentally posted in the Deploy forum - makes more sense here.

    We are redesigning an old Lianja app and want to make it in to a web app. Have to say we are pretty impressed - Lianja just keeps getting better...

    We have rebuilt it as a VFP app and works well. Then we rebuilt it as a js app & that is now working pretty well too. js front end calling VFP server procs.

    However, when we run it as a web app, it is struggling a bit & we could do with a couple of pointers please.

    1) When we try to run the view in browser (by pressing the cloud button next to the runtime arrow top right of the screen), we get the app center 90% of the time. The other 10% it launches correctly as a web preview. Don't understand why.

    2) We don't seem to be able to declare any global variables. In desktop js just omitting the "var" word, makes js memvars global and that works well. But in web, they go out of scope and all our init() prep work is lost.

    3) In desktop VFP and js, the record pointers are rock solid when we change pages but in web, the correct record is displayed for a fraction of a second and then changes to a seemingly random record. However, the parent/child relation seems to be good. We have tried changing the refresh on activation setting but makes no difference. We are not moving the record pointer programatically.

    In web, do we have to re-search the correct record every time we activate a page? We tried that but the record still flicks to another.

    Sure it is something minor.

    Any thoughts?


    Thanks in advance.


    SpringBox

  2. #2
    Senior Member
    Join Date
    Jan 2014
    Posts
    284
    Update on this issue.

    Looks like the record pointer issue was a grid. In web, clicking on a record in the grid did not move the record pointer (either grid section or gadget) and we cannot find a way to do that.

    We were using a form section with fields AND a grid section on the same page referencing the same table, which worked fine on desktop but no good on web. It looks good though. Is it possible to have 2 sections on the same page keeping synch on the same table? None of the demo apps do that. We have tried split grid but aesthetically not fab.

    So, in web, if we have a grid as a customer "picker", how can we move the record pointer reliably?

    Also, the database table triggers don't seem to fire in web so we will have to add those manually in code but have tried just about every delegate that makes any sense for both section and page but they wont fire.

    Any ideas?

    Thanks in advance


    SpringBox
    Last edited by SpringBox; 2021-08-08 at 11:01.

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    284
    OK spent 30 hours this weekend on this, looked at every sample app and read everything we can find and cannot make any headway at all. VFP app is fine, desktop js app ok but web version...

    Absurd really as the example apps are wonderful, feel solid are everything they should be. And are SO simple.

    Our app is structurally very simple too (in the interface one parent table and 2 child tables) but currently is more like a blind man unicycling....

    We can't even get a 2 page, 2 table app working in web.

    To be clear, it seems that the table triggers (afterInsert and afterUpdate) do not fire in web. That means we have to mimic the adding of child table records and injection of unique ids programatically.

    We have been unable to accomplish changes to the values of a couple of fields in either the parent or child tables and have those changes persist after the edit, even though we have changed the field.text and also used getcursor().Setdata() but that doesn't seem to work at all.


    If we are finding this difficult, we must be doing this wrongly.

    So, in conclusion, in web :

    1) Can we make the table triggers fire as we cannot seem to mimic that programatically?

    2) is there a way to use a grid to change records?


    Thanks in advance


    SpringBox

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Sorry for the late response but our staff don’t work over the weekends.

    It’s better to ask one question per post not a long list .

    nevertheless.

    1. if your app is in debug mode “preview in browser” will display the app rather than the app center. This speeds up testing.

    2. The variables go out if scope where? You can create global variables in javascript like this.

    Lianja.public = {};
    Lianja.public.myvar = “hello world”;

    3. Web apps are client/server. What do you mean by record pointers. How are you searching for records in the client? If you have a parent/child relationship changing the parent will change the child by relating it.
    Last edited by barrymavin; 2021-08-09 at 08:20.
    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
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Once again please ask one question per post.

    Split grid does that for you.

    no you cannot have two data bound sections on the same table using a grid. It’s not logical. You have asked this previously and the answer remains the same.

    look at navigation panels.

    What are you referring to? Database triggers of section delegates? These are two different things.
    Last edited by barrymavin; 2021-08-09 at 08:20.
    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

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Table triggers execute on the server. They have nothing to do with the UI. That uses section delegates.

    Without looking at your app I have no idea what you are doing or trying to do. Submit a ticket and attach your app with a description of what you want to achieve and what’s not working the way you are expecting your logic to 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

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    284
    Hi Barry

    Thank you for the replies. You are right - specific questions.

    When we add a new record to our parent table, we need to inject in to it a unique ID so that the child relationships will work. We normally use guid() as that unique ID. In this app, there is 1 parent table and 3 child tables. There is only 1 relational record in each of the child tables. So as soon as the parent record is created, we need to add 1 record to each of the child tables and inject the parent record's unique ID. Now all the relationships will work.

    1) In desktop, the unique ID is added to the parent record using either table defaults or table triggers and then the section is updated automatically. Obviously in web, that is not possible so how would we do that?

    2) Once we have the parent record saved with the unique ID, we then need to call a server side function to insert a record in each of the child tables with the parent's unique ID. Which delegate would be best to use to do that and how do we update the existing sections, bound to the child tables?

    We looked at all the web apps but none of them have auto-populating customer IDs - they are picked from a list or entered manually.

    Hope that clarifies and will be of use to others.

    Thanks in advance

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Hi SpringBox

    1. table defaults and triggers work on the server. You can specifiy guid() as the default for the formitem in your form also. Alternatively the initFormDefaults delegate https://www.lianja.com/doc/index.php..._Form_Defaults can be used.

    2. You can call your server side proc to populate child records in the parent section afterInsert delegate.
    https://www.lianja.com/doc/index.php...er_Data_Create

    3. If your relationships are setup calling refresh() on the parent section afterwards will refresh the parent and it’s child sections that are related by the parent guid.
    Last edited by barrymavin; 2021-08-09 at 12:05.
    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
    284
    Thanks Barry - great & thoughtful support as always.

    Think we have tried every permutation but now got it working thanks. As usual simple works...

    Field defaults followed by AfterDataUpdate() delegate to call the server routine.

    Now we have the basic framework working, we can bolt the engine back in.


    Cheers
    Last edited by SpringBox; 2021-08-09 at 16:03.

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