Announcement

Collapse
No announcement yet.

Bug of SCriptcase with Javascript and fields type Autocomplete

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug of SCriptcase with Javascript and fields type Autocomplete

    Hi, Scriptcase has a bug, if i include a script javascript in event onscriptini and i use fields type autocomplete, This one does not work. But if change the field autocomplete to type Select, It Works fine.
    I tested on some forms and got same Bug.

  • #2
    It does sound like the jquery used for autocomplete fields is conflicting with the javascript used in events.

    This definitely does need to be fixed, Autocomplete is an important feature that I use all the time by client request. And I can't have its use invalidated by on events javascript that also has to be added.

    Comment


    • #3
      Yes, It's very urgent be fix it soon.
      Last edited by alvagar; 10-05-2015, 12:02 PM.

      Comment


      • #4
        Other error i can see with fields type Autocomplete the fields requerides are not validates by SC.

        Comment


        • #5
          It is not a bug, it is by design (sadly).
          In order to find it out in detail make a very very simple form app and place an echo on every event.
          Then deploy the code in your local webserver and test it.
          You will not see the echo from OnApplicationInit appear.
          In order to understand it in detail start using xdbg to follow the entire flow.

          Comment


          • #6
            What alternatives are there then, to work around this problem?
            Originally posted by rr View Post
            It is not a bug, it is by design (sadly).
            In order to find it out in detail make a very very simple form app and place an echo on every event.
            Then deploy the code in your local webserver and test it.
            You will not see the echo from OnApplicationInit appear.
            In order to understand it in detail start using xdbg to follow the entire flow.

            Comment


            • #7
              Ok. Thanks you rr. Now i can know why It does not works. I wasted my time thinking how solve it.
              Is possible fix it any other way?

              Comment


              • #8
                It would be nice hearing from the Scriptcase development team.
                Originally posted by alvagar View Post
                Ok. Thanks you rr. Now i can know why It does not works. I wasted my time thinking how solve it.
                Is possible fix it any other way?

                Comment


                • #9
                  i didnt do this on sc8.1 but I again made a form (single record) and added a little bit of code on each event.
                  echo "OnAfterDeleteAll<br>"; (with the proper event name belonging to that event).
                  And what did I see when running it?

                  OnApplicationInit
                  OnScriptInit
                  OnLoad

                  Hence OnApplicationInit does appear...So the javascript does get put to the client. So you can use it... I guess they changed some things for the better... I recall it being different in SC6
                  Code:
                  ...
                  OnApplicationInit
                  <br>
                  OnScriptInit
                  <br>
                  OnLoad
                  <br>
                  <div id="idJSSpecChar" style="display: none;">
                  </div>
                  <script type="text/javascript">
                  function NM_tp_critica(TP)
                  {
                  if (TP == 0 || TP == 1 || TP == 2)
                  {
                  nmdg_tipo_crit = TP;
                  }
                  }
                  </script>
                  <form name="F2" method="post" action="./" target="_self">
                  <input name="nr" value="7" type="hidden">
                  <input name="nm_form_submit" value="1" type="hidden">
                  <input name="nmgp_opcao" value="" type="hidden">
                  <input name="master_nav" value="off" type="hidden">
                  <input name="sc_ifr_height" value="" type="hidden">
                  <input name="nmgp_parms" value="" type="hidden">
                  <input name="nmgp_ordem" value="" type="hidden">
                  <input name="nmgp_clone" value="" type="hidden">
                  <input name="nmgp_fast_search" value="" type="hidden">
                  <input name="nmgp_cond_fast_search" value="" type="hidden">
                  <input name="nmgp_arg_fast_search" value="" type="hidden">
                  <input name="nmgp_arg_dyn_search" value="" type="hidden">
                  <input name="script_case_init" value="8269" type="hidden">
                  <input name="script_case_session" value="scu5i16o4ulot8b8lcvfmn2ah7" type="hidden">
                  </form>
                  ...

                  Comment


                  • #10
                    Thanks you rr, It can work fine!!!. i can include my libs of javascript:

                    Onscriptini:
                    echo '<link rel="stylesheet" href="../_lib/sweet/sweet-alert.css" />';
                    echo '<script src="../_lib/sweet/sweet-alert.min.js"></script>';

                    Thanks you a lots.
                    Last edited by alvagar; 10-07-2015, 10:59 AM.

                    Comment


                    • #11
                      So. It is working in the onScriptInit Event - why didn't it work before for you?
                      Originally posted by alvagar View Post
                      Thanks you rr, It can work fine!!!. i can include my libs of javascript:

                      Onscriptini:
                      echo '<link rel="stylesheet" href="../_lib/sweet/sweet-alert.css" />';
                      echo '<script src="../_lib/sweet/sweet-alert.min.js"></script>';

                      Thanks you a lots.

                      Comment


                      • #12
                        Before i used:

                        Onscriptini:
                        ?>

                        <link rel="stylesheet" href="../_lib/sweet/sweet-alert.css" />
                        <script src="../_lib/sweet/sweet-alert.min.js"></script>

                        <?

                        Comment


                        • #13
                          Hi,. i am getting same problem again.!!!!!!
                          It worked a time, now i have same problem.

                          Comment


                          • #14
                            I assume you did check with firebug (and firefox) what your generated page delivers you (on the spot where you have the code of course).

                            Comment

                            Working...
                            X