-
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>
-
Hi Fabio,
How are you specifying the parent rsp file, is this set as the WebView Section's Data 'Custom filename'?
If so, set it in the URL instead and specify it using the internal web server, e.g.
Code:
http://localhost:8002/desktopwebservice/pagex_sectionx.rsp
Then when you create the iframe, you will not have cross-domain issues and calling parent.filterComments('Z') will call the function in the parent.
Regards,
Yvonne
-
Yvonne forgive me, but I do not understand .. is an English too complicated for me ..
-
2 Attachment(s)
Hi Fabio,
When you specify the iframe source as "http:/localhost:8002/...", your original rsp file (on C: or other drive) and the iframe file are treated as being in separate domains, which stops you doing lots of things in JavaScript. In your case, the parent.function() can no longer be called and the Lianja object reference is not inherited from the parent.
So, try specifying the rsp file as a URL through through "http:/localhost:8002/..." as well as the iframe.
Attachment 1283
For anyone else using the internal web server, remember to Enable services in the App Settings:
Attachment 1284
(easily forgotten - or is that just me :o)
Regards,
Yvonne
-
now I understand .. :-)
thanks, I try.
But returning on the main question: is possible read a ASCII file..
reading this post (http://www.lianja.com/community/show...-Web-service):
If the result returned starts with "file:" then the file specified e.g. "file:mytempfile.txt" is read and the result is sent back to the client. This provides the ability to query large amounts of information not limited by internal string length.
If the result returned starts with "tempfile:" then the file specified e.g. "tempfile:mytempfile.txt" is read and the result is sent back to the client. The file mytempfile.txt is then deleted.
I felt it was possible to read the file ..
and much simpler ..
-
I call my rsp page with a showdialog command,
I've try:
Lianja.ShowDialog("Search & Find", "http:/localhost:8002/desktopwebservice/sup_search.rsp?table=vt_articoli_artico...
or
Lianja.ShowDialog("Search & Find", "http:/localhost:8002/library/sup_search.rsp?table=vt_articoli_artico...
but not work...
:(
-
I have no hope of finding the solution ..
-
Hi Fabio,
Try copying sup_search.rsp to the App.
Regards,
Yvonne
-
thank for the support Yvonne,
I've try:
Lianja.ShowDialog("Search & Find", "http:/localhost:8002/desktopwebservice/sup_search.rsp?table=vt_articoli_artico...
or
Lianja.ShowDialog("Search & Find", "http:/localhost:8002/sup_search.rsp?table=vt_articoli_artico...
but not work... the page is empty..
by the way, when I try to use the Web Inspector, the window is "under" the dialog .. then you fail.
now, I give up to this solution..
I look forward to a few examples ...
but I can not do what I read in the post?
reading file to exceed the limit of variables, which are at most 64k ...
If only you could compress .. my 63k file, zipped becomes 4k ..
But you can read a file from a page rsp, would be better ..
thanks
Fabio
-
Hi Fabio,
Did you put two / characters after http: or only 1 as in your post?
Regards,
Yvonne