Results 1 to 10 of 10

Thread: Equivalent of <cursoradapter>.refresh in WebApp

  1. #1
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,940

    Equivalent of <cursoradapter>.refresh in WebApp

    I have a view with a complex WHERE clause, parameterized (actually, I've got over 1,000 of them, not counting the 2,000 auto-generated parameterized views).

    In VFP-land, I can get the cursoradapter() object reference, set the parameters, and issue .refresh(). Works great.

    What's the equivalent in a web app?

    thanks,

    Hank

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Hi Hank,

    The view is defined in sysodbc.ini (after it is created and until drop) in the folder(s) where database resides.
    lianja\server\data\southwind
    lianja\cloudserver\tenants\public\data\southwind
    lianja\data\southwind
    ...
    Maybe I am wrong, but I do not see the way to change VIEW definition and refresh in VFP-style,
    I suppose low-level modifying these INI-files to put your complex where clauses is not the way to go.
    Better ask Lianja team for ER, to simplify this.

    Josip
    Last edited by josipradnik; 2018-01-24 at 01:47.

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Hi hank

    there is no cursoradaptor on the client but you can set a filter and refresh()
    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

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,940
    Hi Barry,

    with a WHERE clause like this...

    Code:
    WHERE dPoProd.cdPo_FK LIKE ?PARENTPKVALUE ;
        AND  dPoSKU.cdStatus_FK NOT LIKE 'PDCNCL' ;
        AND  dPoProd.cdStatus_FK NOT LIKE 'PDCNCL' ;
        AND dPoSKU.lDeleteMe = 0 ;
        AND  dPoProd.lDeleteMe = 0     ;
    ORDER BY  6  , 7
    I am not seeing how a filter could work.

    One suggestion: setting a filter to a JSON object with param/value pairs, to be set by the cursoradapter on the backend where the data gets processed, e.g.:

    Code:
    {parentpkvalue: "    AH",cursku: 123456}
    For reporting, we have upwards of 11 parameters that get set to filter on the various dimensions.

    The filter processing would look to see if it's JSON, and if so set the params and refresh the cursoradapter on the backend (where it is available).

    I can submit an ER if you want. Parameterized queries are the heart of highly-relational business apps, so something that accomplishes this in web/mobile is essential.

    thanks,

    Hank

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    A filter on the client is sent in the odata call to the server. So, I do not see why it would not work as it is used as the WHERE condition. Try it and see.
    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 MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,940
    Hi Barry,

    I'll give it a try, but as I remember it replaces the entire WHERE clause, and that would wreak havoc. Plus, in some views the same parameter is used in a subquery, I believe (will check tomorrow). That would be a stopper to the filter method as it works now: even passing the entire WHERE clause wouldn't work.

    thanks,

    Hank

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Hi Hank

    Let me have a think about the best way to handle paramerized calls to refresh().
    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

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    After giving some thought I will add some new methods to both the cursoradaptor class and the cursor class.

    setNamedParameter(“somename”, “somevalue”)
    clearParameters()

    When a VT is opened or refreshed if there are any named parameters specified then they are automatically declared as server side variables and can then be substituted in any {macros} in the VT definition e.g in the sql select statement or the stored procedure parameters.
    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
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,940
    Hi Barry,

    so this would work using getCursor() in web/mobile, right? That's fantastic. Solves all the issues.

    If there were an emoji for jumping up and down in joy, I'd put it right here.

    thanks,

    Hank

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,767
    Correct.

    Sections
    cursoradaptor
    cursor
    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

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