After further investigating, I've noticed that Subaction is not passed to
the .pm file when the event change() occur. Thus, the .pm file answer is
not a Json answer and this triggers the parser error.

What I  don't understand is why FormUpdate does not send the Subaction
param to the pm file...



2016-03-23 8:54 GMT+01:00 Finetti, Stefano <sfine...@lynx-international.com>
:

> Hi, I'm trying to use some of the advanced features of Json/Ajax on OTRS 5.
> Basically I'd like to update the content of a form when changing the value
> of an element of the same form, like when you select a queue in a new
> ticket creation form.
>
> My code is here:
>
> [% WRAPPER JSOnDocumentComplete %]
>
> <script type="text/javascript">//<![CDATA[
>
> $('#SystemSelection').bind('change', function (Event) {
>
> Core.AJAX.FormUpdate($('#AS400Company'), 'AJAXUpdate', 'SystemSelection',
> [ 'CompanySelection' ] );
>
> }
>
> );
>
> //]]></script>
>
> [% END %]
>
>
> where SystemSelection is the select control in the template, AJAXUpdate is
> the subaction i created in the .pm file and CompanySelection is the control
> that should be updated (I need to launch a db query using the value
> obtained from SystemSelection as a WHERE condition to get values to
> populate the CompanySelection control).
>
>
> Now, every time I try to use that selection, I get this:
>
> [ERROR] CommunicationError: Error during AJAX communication. Status:
> parsererror, Error: SyntaxError: JSON.parse: unexpected character at line 1
> column 1 of the JSON data
>
> The perl module is never recalled with the new subaction. If I remove the
> Formupdate function and put a stupid window.alert box with the
> SystemSelection.value, I get the right value.
>
> I don't think it's something in the .pm file, since I've also tried to
> completely remove ANY Json code from the file and just see if the subaction
> is called, and it isn't.
>
> Any hint?
>
> --
> *Lynx International Srl*
> *Stefano Finetti*
> *http://www.lynx-international.com <http://www.lynx-international.com>*
>
> *Lynx International Srl is a part of AXED Group*
> Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina
>
>


-- 
*Lynx International Srl*
*Stefano Finetti*
*http://www.lynx-international.com <http://www.lynx-international.com>*

*Lynx International Srl is a part of AXED Group*
Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina

-- 
This e-mail and any files transmitted contain documentation which is highly 
confidential and intended solely for the use of the individual or entity to 
whom they are addressed. All written data and other information in the 
documentation is and shall remain the property of the disclosing party. If 
you are not the intended recipient you are hereby formally notified that 
any disclosure, dissemination, forwarding, storing, copying or use of any 
of the information is strictly prohibited and will be legally pursued. If 
you received this in error, please contact the sender and destroy the 
documentation including deletion of the same from any computer. Thank you.
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to