Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 14th, 2002, 10:23 AM
ganpeace ganpeace is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 4 ganpeace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question inner HTML Question

I read the "Building a WYSIWYG" article and thought it was COOL...

I need to cutomize the Editor to cater to our needs.
My Mission is to create an unique id, write the content in a flat file, and save it on the server. I am able to get everything done but I am having some problems in the content of the iframe.

When I create a form action tag to shoot to a eg. editor.jsp, I am able to retrieve the contents of the iframe from the editor.jsp. However, when I press the back button, the iframe's content is empty again. How do I get my previous iFrame content back?


Any help is appreciated!

Chris

Reply With Quote
  #2  
Old November 14th, 2002, 06:37 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
basically you should use the same method that you use to get the data from the iframe.


iframeid.document.all.innerHTML = "value here"

something like that, im just remembering this off the top of my head.

Reply With Quote
  #3  
Old November 15th, 2002, 07:15 AM
baddogg99 baddogg99 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: GA, USA
Posts: 19 baddogg99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I had the same problem

I had the same problem a few days ago.

Here is the link to the answer...

http://www.devarticles.com//forum/s...=&threadid=1447

It works!


Reply With Quote
  #4  
Old November 15th, 2002, 09:14 AM
ganpeace ganpeace is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 4 ganpeace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Still have problems...

<Script>
var iViewContentLoaded = false;

function addContent() {

if(!iViewContentLoaded) {

if(iView.document.body)
{
//How do you fill this "#attributes.content#"
var contents = "#attributes.content#";
iView.document.body.innerHTML = contents;
iViewContentLoaded = true;

} else {

setTimeout("addContent()", 2000);
}
}
}
</script>

<html>
<body onload=addContent()>
blah blah blah

<table>
<tr>
<td>
<input type="hidden" value="" name="htmlText">
</td>

<td>

<iframe id="iView" style="width: 415px; height:415px"scrolling="on" frameborder="1" src="editor.jsp"></iframe>

</td>

<td align="middle">

<input type="submit" name=submit value=submit onClick="processFormHtml()">

</td>
</tr>
</table>
</body>
</html>

How do u populate "#attributes.content#" for this example?
If I press the back button, the iframe content will have "#attributes.content#" .

Reply With Quote
  #5  
Old November 15th, 2002, 09:29 AM
baddogg99 baddogg99 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: GA, USA
Posts: 19 baddogg99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hope this helps

The example I gave for you was for Cold Fusion. It appears you want to use JSP.

Change #attributes.content# to the variable name that contains your pre-existing content. You will probably need to run a query to do this, or you can hard code it I guess.

In my instance, I didnt specify a source on my iframe. It appears you have. If you are doing the same thing I did, you don't need it.

Reply With Quote
  #6  
Old November 15th, 2002, 12:27 PM
ganpeace ganpeace is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 4 ganpeace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink THanks guys

I solved the problem..here is the code for jsp for reference
1st page is editor1.jsp and 2nd page is editor2.jsp

1st page
<%String OUT=(String)session.getAttribute("html_out");%>

<html>
<head>
<title> Browser Based HTML Editor </title>


<script language="JavaScript">

var viewMode = 1; // WYSIWYG
var iViewContentLoaded = false;
var counter=0;

function addContent()
{
alert(iViewContentLoaded);
// Check to see if content has been loaded
if(!iViewContentLoaded)
{
// Check to see if there is an iView.document.body object
if(iView.document.body)
{

var contents = "<%=OUT %>";

// The object exists so populate it
if(contents=="null")
{

contents="";
iView.document.body.innerHTML = contents;
iViewContentLoaded = true;

}
else
{
iView.document.body.innerHTML = contents;
iViewContentLoaded = true;
}



} else
{
// The object doesn't exist yet, so we'll try again in 2 seconds
counter++;
setTimeout("addContent()", 2000);
}
}
}
</script>
</head>
<body>
blah blah blah
<iframe id="iView" style="width: 415px; height:415px" scrolling="on" frameborder="1" src="editor.jsp"></iframe>

</body>

2nd Page
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.io.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.w3c.dom.Document" %>

<%
String bankID= request.getParameter("bankID");
String html_out = request.getParameter("htmlText");


session.setAttribute("bankID",bankID);
session.setAttribute("html_out",html_out);

String ID1=(String)session.getAttribute("bankID");
String OUT=(String)session.getAttribute("html_out");

%>

<html>
<head>
<title> Browser Based HTML Editor Confirmaton</title>
<script language="JavaScript">

</script>
</head>
<body>


<br>
Bank ID: <%=ID1 %>
<br>
<%=OUT %>


<form name="form2" action="editor3.jsp" method="post">
<br>
<input type="submit" name=Accept value=Accept>
</form>
<form name="form3" action="editor1.jsp" method="post">
<input type="submit" name=Cancel value=Cancel>
</form>
</body>
</html>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > inner HTML Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT