File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes dynamic DIV tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "dynamic DIV tag" Watch "dynamic DIV tag" New topic
Author

dynamic DIV tag

Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
hi
the requirement is ...open a popup window from a parent window and select the details in the child window and submit. the selected details should be shown in the parent window. how to display the child window details in the parent window dynamically.
I thought of using DIV tag. but how refresh the div in the parent window when i submit the details in the child window.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
How do you fill in the information in the parent page?
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
parent page will have some static field area apart from that one dynamic area where the data from the popup window will be pasted into it.The dyanmic area is full of text and some check boxes.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can access the parent div from the child window with

window.opener.document.getElementById("theDivId").innerHTML

you can change what ever you want in that div.

Not sure what you are trying to do exactly.

Eric
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
suppose initially one row is displayed in the parent window. Then i open the child window and do the operation. Now i need the old row plus the new updated row in the parent DIV. IS this possible?
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
if i use window.opener.document.getElementById("DivExample").innerHTML=
then i need to construct the whole html div code and assign with this right? is this right way or any other way to do this.

because the DIv tag part contains kind of contact details ( for eg: client address, phone etc in address format)
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
hi,
i am creating DIv tag in the parent window. Then open a child window (popup) and do the submit operation in it. update the parent DIV tag using opener and the parent window also update propely. now i could't access those div tag elements from the parent window. how do i access those attribute.

becos once the data come from child window to parent then i am submitting the parent window. here servlet could't get the div attribute values.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I am not sure how your servlet is getting the div information since I am assuminbg you are doing a postwhichonly takes information in a form. Once you submit the parent or the child window they loose conection with each other. They no longer can communicate eith each other.

I would personally say do not rely on JavaScript to build the information. If you are usig Servlets rely on that. JavaScript can be disabled, server side can not.

Eric
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
i have generated the HTML code in the child window. the Html code contains check boxes and hyperlink. Once i submit the child window the HTML code is pasted in the parent window (DIV tag). but how can acces those checkboxes values and hyper link method.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
document.formname.elementname

or

document.getElementByID('name');

or

window.opener.docu....

Is that what you are asking, how to access it with JavaScript?
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
once innerhtml is constructed in the child window then it will be displayed in the parent window.
then if you try to acces the div tag elements for eg.one hyperlink is displaying the div tag area (parent window) but when i click that it is not calling the method what i defined while constructing the innerHtml code.

also i right click the parent window and open view souce but i could't see any details of the DIV tag.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
When you vew the source you are not goint to see it since it is in the browser's memeroy and not in the file. When you view the source you just see the file that was downloaded from the server.
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
Eric ....Thank you so much for your kind information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic DIV tag