Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 52

Thread: Read ascii file

  1. #41
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    thanks to your example Yvonne, we're almost there ...

    Now, when I enter a value in the textbox of my iframe, the "parent" function is launched, it performs all he has to do ..
    but when I try to update the iframe .... lianja crash ..

    Code:
    function readText(execute)
    {
    	
    	window.alert("ReadText ");
    	window.alert(execute);
    	
    	if (execute == "X")
    	{	
    		var fileframe = executeQueryAndCreateFile("X");
    		document.getElementById("DivTabella").innerHTML ='<iframe id = "myframe" src="http:/localhost:8002/' + fileframe + '" width="100%" height="500" scrolling="yes" frameborder="0"></iframe>';	
    	}
    	else
    	{
    		var fileframe = executeQueryAndCreateFile(execute);
    		document.getElementById("DivTabella").innerHTML ='<iframe id = "myframe" src="http:/localhost:8002/' + fileframe + '" width="100%" height="500" scrolling="yes" frameborder="0"></iframe>';			
    	}
    
    };

    executeQueryAndCreateFile() function, combine the textbox and start a server procedure (lianja.evaluate()) to perform the query and prepare the new file.html.

    the second file is right, but Lianja crash..

  2. #42
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,879
    Hi Fabio,

    Can you reproduce that by modifying my sample?

    Regards,

    Yvonne

  3. #43
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    just overwrite the function:

    Code:
    	function filterComments(m_empty)
    	{
    		window.alert("in parent filterComments");
    		
    		readText();
    	
    	};
    then, click on the "Test" Button
    the file is right loaded

    type some char in the textbox under "Codice articolo", then press tab.
    the function filterComments is called and Lianja crash

  4. #44
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,879
    Overwrite with what?

  5. #45
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    With my code, I've added a row:

    readText();

  6. #46
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,879
    Hi Fabio,

    Does it happen if you press the Enter/Return key instead of Tab? That's working OK for me, but not sure why.

    Regards,

    Yvonne

  7. #47
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    If you press 2 or 3 times the "button", work fine..

    but if you type some char in the textbox and press tab, Lianja crash...

    Name:  2016-03-23 18_34_46-Search & Find.png
Views: 150
Size:  29.3 KB

  8. #48
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    I think the problem lies in the fact that, from inside iframe, I try to change iframe ..
    thus destroying the point at which the code is started ..
    a bit like cutting the branch on which you sit ..

    But do the thing with an external button is inelegant (and we Italians, at least in this, we are good :-) ) and I do not think even ..

    So, it would be possible to cast a function asynchronously? fire and forget ..


    thanks
    Fabio

  9. #49
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,342
    Blog Entries
    22
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #50
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    thanks Bary, but it does not seem to work as hoped ..

    in my inframe I've this line of HTML:
    <input width="100%" type="text" value="" id="catmercgam" onchange="window.parent.testClick()" >

    this is my RSP code:
    Code:
    	function readText()
    	{
    		window.alert("ReadText");
    		document.getElementById("DivTabella").innerHTML ='<iframe id = "myframe" src="http:/localhost:8002/_000000c40014.html?firstname=Yvonne&lastname=Milne" width="100%" height="100%" scrolling="yes" frameborder="0"></iframe>';
    	};
    	
    	function filterComments(m_empty)
    	{
    		window.alert("in parent filterComments");
    		
    		readText();
    	
    	};
    		
    	function testClick()
    	{
    		var myVar;
    		myVar = setTimeout(filterComments(), 10000);
    		
    		window.alert("Passo otre");
    	};
    but as soon as I change "cameragam", I see the message:
    window.alert ("in the parent filterComments");
    window.alert ("ReadText");
    window.alert ("Passo otre");
    then Lianja crash.
    without the 10 seconds pause.


    Instead I expected:
    window.alert ("Passo otre");
    pause 10 seconds
    window.alert ("in the parent filterComments");
    window.alert ("ReadText");

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us