Results 1 to 3 of 3

Thread: Inline delegate function syntax with parameter(s)

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

    Inline delegate function syntax with parameter(s)

    Hi guys

    In a web app, we are calling a js function from an in-line delegate. We are using section.field.commandbutton.delegate() and field.change() delegate.

    We are trying to have a function run when a value is changed and enter/tab pressed. The js function calls a server side function which updates the table and then updates the web UI. We have done this successfully several times before but never had to pass a parameter in in-line delegate calls.

    Need some help with the correct syntax please.

    In desktop js, we are using functionname("charparameter") ie Calc("CASH") which works fine in desktop but doesn't run in browser and produces all sorts of errors.

    lib_abcenergy.js?_v=1.0.950-1629396004775:650 Uncaught ReferenceError: lCalc is not defined
    at CalcDeal (lib_abcenergy.js?_v=1.0.950-1629396004775:650)
    at eval (eval at dispatchDelegate (LianjaHtmlClient.js?_v=6.2.1.950-1629396004775:2785), <anonymous>:1:1)
    at window.Lianja.Application.dispatchDelegate (LianjaHtmlClient.js?_v=6.2.1.950-1629396004775:2785)
    at LianjaHtmlClient.js?_v=6.2.1.950-1629396004775:24832
    at Function.window.Lianja.validate (LianjaHtmlClient.js?_v=6.2.1.950-1629396004775:24990)
    at HTMLInputElement.<anonymous> (LianjaHtmlClient.js?_v=6.2.1.950-1629396004775:24815)
    at HTMLInputElement.dispatch (jquery-1.10.2.min.js?_v=6.2.1.950-1629396004775:formatted:2163)
    at HTMLInputElement.v.handle (jquery-1.10.2.min.js?_v=6.2.1.950-1629396004775:formatted:2043)


    What is the correct way to format in-line delegate call? We cannot find any examples with parameters.

    We would like to be able to pass a string and also the current value of the field

    We have tried calc(this.value) / calc({this.value}) / calc({}) but none of them work.

    Any ideas?

    Thanks in advance

    SpringBox

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,163
    Blog Entries
    22
    Hi SpringBox

    On what have you defined this delegate code and what have you specified.
    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
    369
    Hi Barry

    Thanks for the reply.

    Seem to have got this working now using the Calc("CASH") format but not sure why it now works

    Cheers

    SpringBox

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