Re: Ajaxl 'RPG non legge nulla..
Von: lb (lberti@eurojersey.it) [Profil]
Datum: 15.02.2008 10:13
Message-ID: <b2b0b5d8-c291-4c9c-b152-18cc5c0a9faf@s13g2000prd.googlegroups.com>
Newsgroup: it.comp.as400
Datum: 15.02.2008 10:13
Message-ID: <b2b0b5d8-c291-4c9c-b152-18cc5c0a9faf@s13g2000prd.googlegroups.com>
Newsgroup: it.comp.as400
Scusa, non ho letto tutto il meccanismo... Dato che a me funziona tutto regolarmente, prova a mettere un bel alert(CLIEW1) tra > var CLIEW1 = document.getElementById("CLIEW1").value; e > var url = "/webp/ORCL01.pgm?CLIEW1=" + escape(CLIEW1); Vorrei ricordarti che i vari browser sono parecchio rompicoglioni nel recupero dei campi del form... io faccio tutto che lavora SOLO con FireFox in quanto usa il DOM standard; di conseguenza non va con IE, di nessun tipo. Lo so, ma ne son felice per quel che ci serve. Per il resto, mi appare tutto sufficientemente corretto; se poi viene richiamato il programma su AS, è corretto per forza. Ci fossero altri problemi, non arriveresti lì. Ciao. Milton67 ha scritto: > salve, st� provando l'ajax + CGIDEV2.... > > nella parte HTML ho messo.. > > <script TYPE="text/JavaScript"> > > function createXMLHttp() { > > if (typeof XMLHttpRequest != "undefined") > > { > > return new XMLHttpRequest(); > } else if (window.ActiveXObject) { > var aVersions = ["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0", > "MSXML2.XmlHttp.3.0","MSXML2.XmlHttp", > "Microsoft.XmlHttp"]; > for (var i = 0; i < aVersions.length; i++) { > try { > var oXmlHttp = new ActiveXObject(aVersions[i]); > return oXmlHttp; > } catch (oError) { > } > alert("Could not connect"); > } > } > throw new Error ("Could not create an XMLHttp object"); > } > > > function callServer() { > > var CLIEW1 = document.getElementById("CLIEW1").value; > var url = "/webp/ORCL01.pgm?CLIEW1=" + escape(CLIEW1); > var xmlHttp = createXMLHttp(); > > alert(url); > > xmlHttp.open("GET", url, true); > > xmlHttp.onreadystatechange = function() { > if (xmlHttp.readyState == 4) { > if (xmlHttp.status == 200) { > document.getElementById("CLIEW1").innerHTML > = xmlHttp.responseText; > } else { > alert("An error occurred trying to contact the server." ); > } > } > } > xmlHttp.send(null); > } > > > </script> > > <html> > > <head> > <title>Getione ordini Clienti</title> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"><style type="text/css"> > <!-- > body { > background-color: #CCCCCC; > } > --> > </style></head> > > <body> > <center> > <h1 class="biggest ">Gestione Ordini Clienti</h1> > <h1> </h1> > </center> > /$CTL01 > <table width="685" class="normale"> > > <tr> > <td width="202" >Cliente: > <input name=CLIEW1 type="text" id = CLIEW1 value="/%CL IEW1%/" > onChange="callServer()" size=17 maxlength =17> > </td> > > <td width="10"><div id="CLIEW1" ></div></td> > > > <td width="97"></td> > <td width="146">Movimentati dal</td> > <td width="19"> > > <input name=ANNOW1 type="text" id = ANNOW1 value="/%AN NOW1%/" > size=2 maxlength=2> > </td> > <td width="97"></td> > <td width="94"> > <input type="submit" name="Submit" value="Ricerca"> </td> > </tr> > > </table> > > <p> </p> > <table width="1201" border="1"> > <tr class="titolo"> > <td width="300">Ragione Sociale </td> > <td width="219">Indirizzo</td> > <td width="218">Località</td> > <td width="90">Codice</td> > <td width="50">Ultimo Mov.</td> > <td width="223">Agente</td> > </tr> > > /$SFL01 > > > <tr class="normal"> > <td width="300">/%XXXX%/</td> > <td width="219">/%YYYY%/</td> > <td width="218">/%ZZZZ1%/</td> > <td width="90" align="right">/%CODIS1%/</td> > <td width="50" align="right">/%KKKK%/</td> > <td width="223">/%BBB%/</td> > </tr> > /$FINE > </table> > <p> </p> > <p> </p> > </body> > </html> > > nella parte RPGILE > > Callp GetHtmlIfs('/web/orcl01.html' > :'/$') > > Move *Blanks CLIEW1 17 > > Callp wrtSection('top') > > Eval CLIEW1 = zhbgetvar('CLIEW1') > > > per� nella variabile CLIEW1 nellRPG � vuota.. ? > > Buona serata ![ Auf dieses Posting antworten ]
