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

Thread: using show document to display another record in the form section

  1. #1
    Senior Member
    Join Date
    Jul 2019
    Posts
    175

    using show document to display another record in the form section

    Hi Guys,

    I am trying to create a data grid with a footer button that allows the user to click on any customerID item to display the customer record in the standard form section. Can you guys please help me to check what mistakes that I made in my code?

    function myQueryPickerCallback(key, value)
    {
    Lianja.showDocument("section:section1?action=filte r&text=customerid = '{value}'");
    }


    // Event delegate for 'custommenu' event
    function page1_section1_custommenu(btn)
    {
    // insert your code here
    if (btn === "Data Grid")
    {
    Lianja.showQueryPicker("Customer List", "myQueryPickerCallback()", "southwind", "customers", "database=southwind&table=customers&tabletitle=Cus tomer List&columntitles=*&picklist=customers|*|customeri d=''&columncount=0&columns=customerid,contactname, companyname,contacttitle,address,region,city,posta lcode,country,phone,fax&showcolumns=false&pagesize =800&selectcolumn=customerid",3000)
    }
    };

  2. #2
    Senior Member
    Join Date
    Jul 2019
    Posts
    175
    May I know what this error message means?

    Name:  Capture.jpg
Views: 49
Size:  66.3 KBName:  Capture.jpg
Views: 49
Size:  66.3 KB

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    It means you have a syntax error in the javascript.

    Try it in the console first.
    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 Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    You need to specify an onbuttonclick parameter.

    It is described in the doc:
    https://www.lianja.com/doc/index.php/QueryPicker
    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
    5,734
    Also why use a footer button menu?

    The QueryPicker is customizable with buttons:

    See the doc.

    buttons An optional comma separated list of buttons captions to be displayed in the footer

    onbuttonclick The optional delegate to be called when a custom button is clicked. The delegate is called with two arguments, the button caption and the text of the selected data column.
    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
    Senior Member
    Join Date
    Jul 2019
    Posts
    175
    Hi Barry,

    I just added the onbuttonclick and buttons parameters to my code and tested it in the console but I am still getting the same error message. Can you please help me to check my code again?

    Sat Jan 4 14:59:44 2020
    **** Lianja JavaScript error ****
    Traceback (most recent call last):
    SyntaxError: Parse error

    Sat Jan 4 15:01:05 2020
    **** Lianja JavaScript error ****
    Traceback (most recent call last):
    TypeError: Result of expression ''dataselect()'' [dataselect()] is not a function.


    This is my code:

    function dataselect(select,orderid)
    {
    Lianja.showdocument("section:section2?action=filte r&text=orderid eq '{customers.orderid}'");

    }


    ////////////////////////////////////////////////////////////////
    // Event delegate for 'dialogbutton' event
    function Sales_section2_field58_dialogbutton()
    {
    Lianja.showQueryPickerPanel("Browse Orders", "myCallback()", "southwind", "order_details", "showcolumns=true&selectcolumn=orderid&buttons=Sel ect,Cancel&onbuttonclick='dataselect()'");
    };

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    Remove the quotes around dataselect() as itís a parameter.
    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
    Senior Member
    Join Date
    Jul 2019
    Posts
    175
    Hi Barry,

    May I know what this error message means?

    Sat Jan 4 18:58:32 2020
    **** Lianja JavaScript error ****
    Traceback (most recent call last):
    SyntaxError: Parse error

    function mydataselect(select,customerid)
    {
    Lianja.showDocument("section:section1?action=filte r&text=customerid eq '{customers.customerid}'")

    }


    Thanks & Best Regards
    Attached Images Attached Images  

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    You canít type functions in the javascript console. Single line commands only.
    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

  10. #10
    Senior Member
    Join Date
    Jul 2019
    Posts
    175
    Hi Barry,

    what does BreakPoint mean from this error message?

    Name:  bug three.jpg
Views: 40
Size:  19.7 KB

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