i've try to modify and modify...
but I can not get it to work ...
In the last, I've try to insert my "filterComments" function inseide the file, in this way is inside of the iframe, now work until che line
var innerHTML = Lianja.evaluate(execute);
but I think it's still the right way ..
If I enter the "filterComments" function inside the iframe .. then when the call again, I create a new iframe ... inside the iframe ..
The best is, from the iFrame, call the function in the page, delete the frame then recreate...
but from the frame, onchange="window.parent.filterComments('Z')" not work..
thanks
Fabio
Code:
<script type="text/javascript">
function filterComments(m_empty)
{
window.Lianja = window.parent.Lianja;
var search_str;
var data = "cod_art,catmercgam,des_web";
var dataquery = "cod_art|,catmercgam|,des_web|";
var table = "aricoli";
var cursor = "cur_articoli";
var caption = "Cod. art,Cat merc,Des WEB";
var target = "cod_art";
var execute = "";
var datasets = [];
var querysets = [];
var i;
var value;
var query = "";
var valore;
window.alert("FilterComments");
if (data.indexOf(",") > 0)
{
window.alert("Data ok");
datasets = data.split(",");
querysets = dataquery.split(",");
for (i=0; i<datasets.length; ++i)
{
window.alert("1");
value = datasets[i];
if (m_empty == "X")
{
valore = "";
valore = querysets[i];
}
else
{
window.alert("2");
valore = document.getElementById(value).value ;
};
query = query + ";" + value + "|" + valore;
}
window.alert("Query ok");
query = query.substr(1);
document.getElementById('Query').innerHTML = 'Query = select ' + table + " where " + query;
window.alert("prepara execute");
execute = 'sup_Search_sectionRefresh("' + table + '","' + cursor + '","' + query + '","' + caption + '","' + target + '")';
window.alert(execute);
var innerHTML = Lianja.evaluate(execute);
window.alert("Call read text");
document.getElementById("DivTabella").innerHTML ='<iframe src="http:/localhost:8002/' + innerHTML + '" width="100%" height="90%" scrolling="yes" frameborder="0" name "masterframe"></iframe>';
}
else
{
Lianja.showMessage("Criteri non configurati correttamente");
return;
}
};
</script>
<p id="Query"> </p>
<table width="100%" height="10%" cellpadding="5" cellspacing="2" bgcolor="white" border=2px id="tabella">
<tr bgcolor="gray">
<td align="center" colspan="3">
</td>
</tr>
<tr bgcolor="#eaeaea">
<tr bgcolor="&rowcolor" class="datacellgridline">
<td valign=top align=left> <b>
Articolo
</td> </b>
<td valign=top align=left> <b>
Cat. merc.
</td> </b>
<td valign=top align=left> <b>
Descrizione
</td> </b>
</tr>
<td>
<input width="100%" type="text" value="" id="cod_art" onchange="filterComments('Z')" >
</td>
<td>
<input width="100%" type="text" value="" id="catmercgam" onchange="window.parent.filterComments('Z')" >
</td>
<td>
<input width="100%" type="text" value="" id="des_web" onchange="filterComments('Z')" >
</td>
</tr>
<tr bgcolor="#f1f6fe" class="datacellgridline">
<td valign=top align=left>
<a href="javascript:selectitem('VICRG')">VICRG</a>
</td>
<td valign=top align=left>
VBR
</td>
<td valign=top align=left>
DesWeb VINOgggg 150 COPROVI
</td>
</tr>
<tr bgcolor="#FFFFFF" class="datacellgridline">
<td valign=top align=left>
<a href="javascript:selectitem('VILFAG')">VILFAG</a>
</td>
<td valign=top align=left>
ZMINE
</td>
<td valign=top align=left>
LAMBRUSCO AMABILE CL 150 TERREFORTI
</td>
</tr>
Bookmarks