Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: showDocument out of a rsp file by onclick

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

    showDocument out of a rsp file by onclick

    An rsp file of mine creates a listing of people.

    I would like to access the person page (canvas) from individual lines of the listing in order to correct the person's data.

    I tried in the rsp file a button (could also use a html link etc.) :
    ...
    ? name + prenome + "<button onclick = 'show_person()'>show</button>"
    ...

    In the show_person function I could use Lianja.showDocument (...);

    Unfortunately that doesn't work.
    I would be grateful for an idea.

    Georg

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

    Look at the datalistview.rsp script in the Library and Using WebViewWidgets.

    Regards,

    Yvonne

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    179
    Thank you very much, Yvonne!

    I know these good examples!

    But I need a solution like the one I described.
    The listings are generated due to more complicated selection criteria that are specified in a Section1 (canvas). From this Section1, the Section2 (WebView) is then "called", where the selected persons or addresses are output in variously specified form (e.g. as a list, label, Excel or other output ...)

    Doesn't the "normal" Javascript onclick work in a WebView section?

    Georg

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    Yes georg it does work. As always you can right click on the webview and inspect the console which may help you figure out what’s going wrong.
    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
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    179
    Thank you Barry!
    Yes, it works! (There was a unvisible char in my js function.)

    Lianja.showDocument("page: persons") should open the Page for correcting the data of the person concerned in the listing.
    I could output the record number RECNO() for this in the line.
    However, I am missing the Lianja.showDocument("goto:number") function for the WebApp in order to show to the correct record.

    What could I do?

    Georg

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    You should "search" or "filter" using showDocument() to position on the required record. There is no concept of record numbers in web/mobile apps as internally they use SQL for data access.

    You will also need a "reset" section menu item to clear the filter or search criteria.
    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
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    179
    I have difficulties with the right notation of the action parameters of showDocument.

    My js function is

    function show_person(fnam,pnam) {
    // fnam and pnam are ok shown with alert
    Lianja.showDocument("page: persons?action=filter&text=persons->famname eq fnam");
    };
    - ok: if a constant value f.e. ...eq 'Müller' instead of fnam
    - not ok: ...eq fnam (how is the right notation ?)

    and how is the right notation with both parameters (name=fnam and prenome=pnam) ??

    Georg

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    Code:
    // note the single quote inside the " "
    fnam = "'" + fnam + "'";
    prenome = "'" + prenome + "'";
    Lianja.showDocument("page: persons?action=filter&text=famname eq " + fnam + " and " + prenom eq " + prenome );
    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
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    179
    Perfect! Thank you very much!

    It would be good to have such an example in the docu at
    https://www.lianja.com/doc/index.php...26text.3Dvalue...

    Difficult to understand for a Foxpro programmer
    as I know 'xyz' as a constant with the value xyz and
    yxz as a variable with any value ...

  10. #10
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    Yes but what you need to remember is that JavaScript is running in the browser and it sends the filter to the server that knows nothing about the JavaScript arguments.
    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 2 12 LastLast

Tags for this Thread

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