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.
It does sound like the jquery used for autocomplete fields is conflicting with the javascript used in events.
[SIZE=5]This definitely does need to be fixed, [/SIZE][SIZE=5]Autocomplete[/SIZE][SIZE=5] is an important feature that I use all the time by client request. And I can’t have its use invalidated by[/SIZE][SIZE=5] on events javascript[/SIZE][SIZE=5] that also has to be added.[/SIZE]
Yes, It’s very urgent be fix it soon.
Other error i can see with fields type Autocomplete the fields requerides are not validates by SC.
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.
What alternatives are there then, to work around this problem?
[QUOTE=rr;41288]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.[/QUOTE]
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?
It would be nice hearing from the Scriptcase development team.
[QUOTE=alvagar;41297]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?[/QUOTE]
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
...
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>
...
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.
So. It is working in the onScriptInit Event - why didn’t it work before for you?
[QUOTE=alvagar;41330]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.[/QUOTE]
Before i used:
Onscriptini:
?>
<link rel=“stylesheet” href="…/_lib/sweet/sweet-alert.css" />
<script src="…/_lib/sweet/sweet-alert.min.js"></script>
<?
Hi,. i am getting same problem again.!!!
It worked a time, now i have same problem.
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).