472,373 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

updating combobox without refreshing in JSP page

46
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???
Jul 26 '07 #1
13 7321
r035198x
13,262 8TB
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.
Jul 26 '07 #2
sumittyagi
202 Expert 100+
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.
Jul 26 '07 #3
honey99
46
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() ...
Jul 26 '07 #4
honey99
46
Thank u i'll try it with window.opener() ...
will anyone tell me the solution for my problem
Jul 26 '07 #5
sumittyagi
202 Expert 100+
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.
Jul 26 '07 #6
honey99
46
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......................
Jul 27 '07 #7
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.
Jul 27 '07 #8
honey99
46
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
Expand|Select|Wrap|Line Numbers
  1. <a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width=700,heigh t=500,scrollbars=yes');return false;">click here</a>
  2.  
  3. <td class="flabel" width="240" nowrap>
  4.  
  5. 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);
  6.  
Ex2.jsp
Expand|Select|Wrap|Line Numbers
  1. <td colspan=3 align='left' nowrap class="formdata">
  2. <select name=chr_txtselect style='width=300px;' onChange="javascript:changecombo(this);">
  3.  
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????????
Jul 27 '07 #9
pbmods
5,821 Expert 4TB
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.
Jul 27 '07 #10
honey99
46
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.
Expand|Select|Wrap|Line Numbers
  1. Ex1.jsp
  2.  
  3. Code: ( html4strict )
  4. <a href="Ex.Action" target="_blank" onclick="window.open(this.href,'newwindow','width=700,heigh   t=500,scrollbars=yes');return false;">click here</a>
  5.  
  6. <td class="flabel" width="240" nowrap>
  7.  
  8. 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);
  9.  
  10. Ex2.jsp
  11.  
  12. Code: ( html4strict )
  13. <td colspan=3 align='left' nowrap class="formdata">
  14. <select name=chr_txtselect style='width=300px;' onChange="javascript:changecombo(this);">
  15.  
how i can update comboboxes in both JSP pages without refreshing
Jul 28 '07 #11
pbmods
5,821 Expert 4TB
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.
Jul 28 '07 #12
honey99
46
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...
Jul 28 '07 #13
pbmods
5,821 Expert 4TB
Good luck with your project! If you run into any trouble, post back, and we'll help you get it sorted out!
Jul 28 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: mark | r | last post by:
anyone know how to update the inforation in a select box without refreshing the page or using massive javascript arrays using regular asp (not .net)? thanks mark
4
by: Derek | last post by:
I am trying to refresh one datagrid after updating another datagrid. I can not call BindData for one under the other bind sub because it creates an endless loops on page load. Is there way to...
9
by: Jervin Justin | last post by:
Hi, I've been having this problem for some time with Web Forms: I have a web app that sends data to a service when the user presses a button. Based on the data, the server will send several...
0
by: lv2compute | last post by:
I am having a problem with my datagridview. I have a small table that has two columns. The first column is bound to my dataset. The second column is a combobox. I add items to the combobox based on...
9
by: paul | last post by:
Hi All, We have a small dilemma. We have the following page: http://giggsey.com/m00Cow.php (don't ask about the content) that we want to turn into an interactive application for some new intake...
4
by: honey99 | last post by:
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...
1
by: honey99 | last post by:
Hi! i have a same combobox in parent window and child window.If i enter a value in combobox in child window it should automaticall update in parent window without refreshing the parent window page.I...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.