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

Thread: dfcc

  1. #1
    Join Date
    Sep 2017
    Location
    Bangkok
    Posts
    31

    Default dfcc

    I get an error on the browser side

    Unhandled program error on the client

    Could not find class 'dfcc.WebMsgBuilder'
    Error: 999
    Object

    I am not quite sure if this is a DF or JS side error.

    I am not keen on JS, just following the tutorial.

    Thanks,
    Charles

  2. #2
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: dfcc

    Charles,

    This is at the JS side and either as forgotten JS include or a cache error.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  3. #3
    Join Date
    May 2010
    Location
    Minas Gerais/Brasil
    Posts
    56

    Default Re: dfcc

    Wonderful. I was getting the same error on OAuth2 tests and it was resolved by clearing the cache. Thanks.
    []s

    Renato Antonacci
    Minas Gerais, Brasil
    Dataflex/Dataflex Web

  4. #4
    Join Date
    Sep 2017
    Location
    Bangkok
    Posts
    31

    Default Re: dfcc

    Did try clearing the cache but it still came up with the same error.

    Now I am not quite sure whether it is the dfcc library itself or some coding error on JS side.

    Regards,
    Charles

  5. #5
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: dfcc

    Charles

    Can you see the package in the browser's debugger? If not, you are either not including it in Index.html or it has an error. In thr latter case, try looking at the package code in the (free) Visual Studio Code tool, which will help you spot any errors.

    Mike

  6. #6
    Join Date
    Sep 2017
    Location
    Bangkok
    Posts
    31

    Default Re: dfcc

    Mike,

    Thanks for your advise. It does show up on the browser. I am sure it is a JS error. I am not an JS expert. I will probably have to spend some time on it. By the way I am using subline and did try Visual Studio Code, they both did not indicate any error.

    Thanks,
    Charles

  7. #7
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: dfcc

    Charles

    The fact that it shows up in the browser debugger generally indicates that the JS is technically OK (if the browser can't parse it properly, it generally won't show up there).

    The next possibility is that there is some mis-match going on... can you publish the code involved (both the JS code and the DF class, especially the Construct_Object procedure) here, using [ code] ... [/ code] tags (without the spaces).

    Mike

  8. #8
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: dfcc

    this generally happens if either the class does not exist (js file not included in index.html) or there is an error in the class js code and the class cannot be instantiated

    start the browser debugger and refresh your page and check the error. it should point you to the issue
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  9. #9
    Join Date
    Sep 2017
    Location
    Bangkok
    Posts
    31

    Default Re: dfcc

    Mike,

    Please see the DF code follow by JS.

    Thanks,
    Charles

    Use cWebBaseControl.pkg


    Class cWebMsgBuilder is a cWebBaseControl

    Procedure Construct_Object
    Forward Send Construct_Object

    {WebProperty = Client}
    Property Integer piMaxLength 0

    { WebProperty = Client }
    Property Boolean pbServerOnAddBtnClick False

    Set psJSClass to "dfcc.WebMsgBuilder"


    End_Procedure

    Procedure AddMessageItem String sText
    String [] aParams
    Move sText to aParams [0]
    Send ClientAction "addMessageItem" aParams
    End_Procedure


    Procedure End_Construct_Object
    Forward Send End_Construct_Object


    WebPublishProcedure ReceiveMessage
    WebPublishProcedure OnAddBtnClick
    End_Procedure

    Procedure ReceiveMessage String sMsg tWebValueTree tVt
    String [] aMsgParts
    Get ptActionData to tVt
    ValueTreeDeserializeParameter tVt to aMsgParts
    Send OnReceiveMessage sMsg aMsgParts
    End_Procedure

    { MethodType = Event }
    Procedure OnReceiveMassage String sMsg String [] aMsgParts
    // argument with application logic
    End_Procedure


    { MethodType = Event }
    Procedure OnAddBtnClick String sVal

    End_Procedure


    End_Class

    -----------------------------------
    JS code
    ----------------------------------

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">

    <title></title>

    <link rel="shortcut icon" href="favicon.ico" sizes="48x48" />

    <!-- Hiding Safari User Interface Components -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- DataFlex Engine -->
    <script>
    // Uncomment the following line to optimize the initialization (make sure that the right theme is set)
    //var sDfPreloadTheme = "Df_Material";
    </script>

    <script src="DfEngine/df-include.js"></script>

    <!-- DataFlex Custom Controls (do not remove this line, used for automatic insertion) -->
    <script src="WebMsgBuilder/WebMsgBuilder.js"></script>
    <link rel="stylesheet" type="text/css" href="WebMsgBuilder/WebMsgBuilder.css">

    <!-- Initialization of the WebApp -->
    <script>
    var oWebApp = new df.WebApp("WebServiceDispatcher.wso");

    oWebApp.displayApp("#viewport");
    </script>

    <style>
    html, body{
    height: 100%;
    }
    </style>
    </head>
    <body>
    <div id="viewport" style="width: 100%; height: 100%;">

    </div>
    </body>
    </html>

  10. #10

    Default Re: dfcc

    Charles,

    First thing is that you seem to have a typo here:
    Code:
    Procedure OnReceiveMassage String sMsg String [] aMsgParts
    which should be
    Code:
    Procedure OnReceiveMessage String sMsg String [] aMsgParts
    Although I like the former better if it is the traditional version, not the tourist one.
    This however is not the problem you are currently facing.

    Your html page does list that you added these lines:
    Code:
    <script src="WebMsgBuilder/WebMsgBuilder.js"></script>
        <link rel="stylesheet" type="text/css" href="WebMsgBuilder/WebMsgBuilder.css">
    In principle that should work.
    Did you also create the folder "WebMsgBuilder" in your AppHtml folder?
    Did you add the file WebMsgBuilder.js in there as well?
    Is the casing exactly the same? eg. Did you not by accident create a folder named "webmsgBuilder"?

    Is the WebMsgBuilder.js a file that is provided by the course or did you create it yourself.
    if the latter what is the contents of that?

    --
    Wil

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •