Hi!
I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window will open.My problem is the pop-up window and the parent window has same combobox.if i add data through html form in pop-up window(Ex2.jsp) it enters the combobox...but the data in the combobox of parent window(Ex1.jsp) is entering only when i refresh the parent(Ex1.jsp) page...so how data can be entered in both comboboxes without refreshing???
13 7217
Hi!
I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window will open.My problem is the pop-up window and the parent window has same combobox.if i add data through html form in pop-up window(Ex2.jsp) it enters the combobox...but the data in the combobox of parent window(Ex1.jsp) is entering only when i refresh the parent(Ex1.jsp) page...so how data can be entered in both comboboxes without refreshing???
I don't understand all that you're saying here, but I suspect a Javascript expert may be able to say a few words on the matter, so I'll copy this there as well.
Hi!
I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window will open.My problem is the pop-up window and the parent window has same combobox.if i add data through html form in pop-up window(Ex2.jsp) it enters the combobox...but the data in the combobox of parent window(Ex1.jsp) is entering only when i refresh the parent(Ex1.jsp) page...so how data can be entered in both comboboxes without refreshing???
you can have a reference of the parent window by window.opener() method.
Once you have the parent window reference, you can add options to the select box by simple javascript.
you can have a reference of the parent window by window.opener() method.
Once you have the parent window reference, you can add options to the select box by simple javascript.
Thank u i'll try it with window.opener() ...
Thank u i'll try it with window.opener() ...
will anyone tell me the solution for my problem
will anyone tell me the solution for my problem
have you tried window.opener().
If yes then paste your code here, we will see what's wrong with that.
If no then no-body on any forum on this site like spoon-feeders.
have you tried window.opener().
If yes then paste your code here, we will see what's wrong with that.
If no then no-body on any forum on this site like spoon-feeders.
Thanks for u r reply..
i'm posting me code here...plz go through the code and tell me a solution
Ex1.jsp
<a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width= 700,height=500,scrollbars=yes');return false;">click here</a>
<td class="flabel" width="240" nowrap>
Select.draw(out, mod.getConnectString(),"cmb","Style", "Width:130px", -1, true, " onfocus='javascript :fcolor(this)'; onblur='javascript :bcolor(this)' onchange='javascript :textChange(this);' ",some SQL query;",new String[]{"id"},new String[]{"value"}, model.get() , some SQL query);
Ex2.jsp
<td colspan=3 align='left' nowrap class="formdata">
<select name=chr_txtselect style='width=300px;' onChange="javascript :changecombo(this);">
How can i update both comboboxes without refreshing in both the JSP pages i.e.if i enter data in Ex2.jsp,it should enter in combobox of Ex1.jsp also without refreshing???how can i get this??any solution......................
Thanks for u r reply..
i'm posting me code here...plz go through the code and tell me a solution
Ex1.jsp
<a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width= 700,height=500,scrollbars=yes');return false;">click here</a>
<td class="flabel" width="240" nowrap>
Select.draw(out, mod.getConnectString(),"cmb","Style", "Width:130px", -1, true, " onfocus='javascript:fcolor(this)'; onblur='javascript:bcolor(this)' onchange='javascript:textChange(this);' ",some SQL query;",new String[]{"id"},new String[]{"value"}, model.get() , some SQL query);
Ex2.jsp
<td colspan=3 align='left' nowrap class="formdata">
<select name=chr_txtselect style='width=300px;' onChange="javascript:changecombo(this);">
How can i update both comboboxes without refreshing in both the JSP pages i.e.if i enter data in Ex2.jsp,it should enter in combobox of Ex1.jsp also without refreshing???how can i get this??any solution......................
Hi,
You can do this thing using AJAX.
try to implement this.
Hi!
I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window will open.My problem is the pop-up window and the parent window has same combobox.if i add data through html form in pop-up window(Ex2.jsp) it enters the combobox...but the data in the combobox of parent window(Ex1.jsp) is entering only when i refresh the parent(Ex1.jsp) page...so how data can be entered in both comboboxes without refreshing???
--------------------------------------------------------------------------------
i'm posting me code here...plz go through the code and tell me a solution
Ex1.jsp -
<a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width=700,heigh t=500,scrollbars=yes');return false;">click here</a>
-
-
<td class="flabel" width="240" nowrap>
-
-
Select.draw(out, mod.getConnectString(),"cmb","Style", "Width:130px", -1, true, " onfocus='javascript:fcolor(this)'; onblur='javascript:bcolor(this)' onchange='javascript:textChange(this);' ",some SQL query;",new String[]{"id"},new String[]{"value"}, model.get() , some SQL query);
-
Ex2.jsp -
<td colspan=3 align='left' nowrap class="formdata">
-
<select name=chr_txtselect style='width=300px;' onChange="javascript:changecombo(this);">
-
How can i update both comboboxes without refreshing in both the JSP pages i.e.if i enter data in Ex2.jsp,it should enter in combobox of Ex1.jsp also without refreshing???how can i get this??any solution......................
can anyone tell how to solve this problem through AJAX????????
Heya, honey99.
Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Heya, honey99.
Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
-
Ex1.jsp
-
-
Code: ( html4strict )
-
<a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width=700,heigh t=500,scrollbars=yes');return false;">click here</a>
-
-
<td class="flabel" width="240" nowrap>
-
-
Select.draw(out, mod.getConnectString(),"cmb","Style", "Width:130px", -1, true, " onfocus='javascript:fcolor(this)'; onblur='javascript:bcolor(this)' onchange='javascript:textChange(this);' ",some SQL query;",new String[]{"id"},new String[]{"value"}, model.get() , some SQL query);
-
-
Ex2.jsp
-
-
Code: ( html4strict )
-
<td colspan=3 align='left' nowrap class="formdata">
-
<select name=chr_txtselect style='width=300px;' onChange="javascript:changecombo(this);">
-
how i can update comboboxes in both JSP pages without refreshing
Heya, honey99.
Probably the best way to accomplish this would be to set up an AJAX call to a JSP page that outputs a JSON-encoded object containing the new options for the SELECT element.
From there, your JavaScript could eval() the returned object, then dynamically create OPTION elements on the fly.
Heya, honey99.
Probably the best way to accomplish this would be to set up an AJAX call to a JSP page that outputs a JSON-encoded object containing the new options for the SELECT element.
From there, your JavaScript could eval() the returned object, then dynamically create OPTION elements on the fly.
Thank u i'll try with this...
Good luck with your project! If you run into any trouble, post back, and we'll help you get it sorted out!
Post your reply Sign in to post your reply or Sign up for a free account.
Similar topics
4 posts
views
Thread by mark | r |
last post: by
|
4 posts
views
Thread by Derek |
last post: by
|
9 posts
views
Thread by Jervin Justin |
last post: by
|
reply
views
Thread by lv2compute |
last post: by
|
9 posts
views
Thread by paul |
last post: by
| | |
2 posts
views
Thread by =?Utf-8?B?VmFuZXNzYQ==?= |
last post: by
|
4 posts
views
Thread by Mtek |
last post: by
| | | | | | | | | | |