Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Help me how to making a page load itself into a new popup window ??? (http://www.go4expert.com/forums/help-page-load-popup-window-t16454/)

love4all1080 6Mar2009 10:35

Help me how to making a page load itself into a new popup window ???
 
Hi everyone,

I need your help.

I'm sure this is a very simple problem but I can't figure it out.

Ok, I have a main window where a user fills in a form....


When submitted it goes onto another page and has two options:

"remove"

and

"attach a picture [choice]"

When a user clicks on attach a picture it opens up in a pop up window....

Now what i want it to do is let the user attach a picture and when they click on insert

the page will load in the main window - the window that had the link to the pop-up - if that makes any sense...

I had a little bit of Java to close the window, but I want it to close and open the page in the main window...

If anyone can understand that please help me

shabbir 6Mar2009 11:44

Re: Help me how to making a page load itself into a new popup window ???
 
Check out the Javascript code for the Manage Attachment button code in the New thread / Reply page in this forum

love4all1080 7Mar2009 11:23

Re: Help me how to making a page load itself into a new popup window ???
 
i using JAVA but i want some code javascript help me insert image in main window when open new popup window.you can see link and help me
http://love4all1080.blogspot.com/200...-into-new.html

i can post link here. remove space when you click link

shabbir 7Mar2009 12:11

Re: Help me how to making a page load itself into a new popup window ???
 
You have posted in JavaScript forum and I moved it to the Java forum.

I made the link clickable and you would be able to post links after getting up with your post count.

Now for the solution you have to fire the event which displays the event in the thumbnail with the param as the url to the image

love4all1080 7Mar2009 15:59

Re: Help me how to making a page load itself into a new popup window ???
 
no one helped me do :nonod: I need it in a presentation a few days with programming language Java - Desktop Ajax

shabbir 7Mar2009 16:59

Re: Help me how to making a page load itself into a new popup window ???
 
Quote:

Originally Posted by love4all1080 (Post 44048)
no one helped me do :nonod: I need it in a presentation a few days with programming language Java - Desktop Ajax

You need to do this. Now for the solution you have to fire the event which displays the event in the thumbnail with the param as the url to the image

love4all1080 7Mar2009 22:33

Re: Help me how to making a page load itself into a new popup window ???
 
In main form i fire the even :
Code:

<a href="JavaScript:openWindow('admin_upload.do?dir=products&formTarget=frmAddMobile&elementTarget1=txtImgPre&elementTarget2=imgPre')">
<img alt="Upload" name="imgPre" border="1" src="<%=eProductDetail.getImage1()%>" width="150" style="border: 1px solid #C0C0C0;">
</a>
<input name="txtImgPre" type="hidden" value="<%=eProductDetail.getImage1()%>">

when i click image, new popup window will display and in window popup i request all variables
Code:

<%
    String qStrDir=request.getParameter("dir");
    String formTarget=request.getParameter("formTarget");
    String elementTarget1=request.getParameter("elementTarget1");
    String elementTarget2=request.getParameter("elementTarget2");
%>
<script language="JavaScript">
<!--
function insertPic(strValue){
    window.opener.document.<%=formTarget%>.<%=elementTarget1%>.value=strValue;
    window.opener.document.<%=formTarget%>.<%=elementTarget2%>.src="../images/<%=qStrDir%>/"+strValue;
}
</script>

after finished up load i can get file image name
Code:

<input onclick="javascript:insertPic('<%=fname%>');window.close();" type="button" value="Insert" name="Close1">
when i click insert only the popup window close but not insert image in main window

:disappoin:disappoin:disappoin:disappoin:disappoin

shabbir 7Mar2009 23:00

Re: Help me how to making a page load itself into a new popup window ???
 
You have this

window.opener.document.<%=formTarget%>.<%=elementT arget2%>.src="../images/<%=qStrDir%>/"+strValue;

And check if all the variables are correct.

or else this can be done simply by using plain JavaScript

Name the image with some id and then assign the src of that id to the image value

../images/<%=qStrDir%>/"+strValue


All times are GMT +5.5. The time now is 09:50.