in a form-type application, a text-autocomplete field with select2 option selected, on event ajax onChange, the “Code” value of the field is not retrieved, it returns empty. Try an echo {Code};
Did you check if what is returned is always the “previous” value?
E.g.
- initially the field is empty, you change its value to 1 and the onChange triggered echo shows en empty value.
- you then change the field value to 2 and the echo shows 1.
if that’s the case I have a workaround
no value returns. Only empty field.
Hello, sorry for the delay. We have reported this issue to our development team.
While you’re at it,
Select2 have other issues as well: often they are not rendered correctly.
To me this happens on apps opened as modal and as a workaround a manual or prograrmmatically-triggered reload of the iframe fix it.
This issue has been reported repetedly on this forum.
One example:
https://forum.scriptcase.net/forum/main-category/main-forum/84113-select2-fields-displaying-only-first-few-characters
Hello, this problem about text-autocomplete was solved. Please, tell me more about this issue. Give us more details.
The issue is that Select2 elements are not rendered correctly on the screen, as you can see in the screenshot this user posted:
https://forum.scriptcase.net/forum/main-category/main-forum/84113-select2-fields-displaying-only-first-few-characters
As you cae see, Select2 elements are very small and basically unsuable.
To me it seems to happen mostly (maybe only?) when forms are run as modal.
When that happens, a reload of the frame (e.g. right click\reload frame in Chrome) fix the issue as Select2 elemets are then rendered correclty.
I’ve also seen the following ajax issue for Select2 (both select and automplete): ajax code reading a Select2 field value, would always get the “previous” value of the field.
Eg: at app execution the Select2 field is initially empy. The field is changed to “1” and an SC ajax event (just echoing the field value) is triggered. The Ajax code woud echo empty (i.e. the value before the change). The field is now changed to “2”. The Ajax code woud echo “1” (i.e. still the value before the change). And so on.
By just editing the app and changing the field to a normal Select, the ajax code will start working as expected.
Create a field like text-autocomplete example: {citta} with a query of the type: SELECT Code, Description FROM …
On an AJAX onChange event, retrieve the value with sc_ajax_message ({citta}, “”); You will notice that the first selection returns an empty value, if we select a second time the value is detected.
And if you select a different value the third time, the second (previous) value is detected? An so on?
If so, that’s the same issue I was describing
Hello, about this i’ll verify and tell you. Thank you for these feedbacks, it’s helpful for solve issues.
Gentlemen of ScriptCase, can you update as soon as possible to solve this blocking problem? Thank you