Problem when opening popup window in ajax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhappy
    New Member
    • Jul 2007
    • 139

    #16
    Hi,
    Thanks,
    I did what You told yestraday.I put my code in seperate function.Now The popup window is opening.But now i am getting other problem that i want to close that child window, for that iam using " Child.window.cl ose()" method. but it is not closing.And I didn't get the details in dropdown list of my parent window.Why?



    Thanks,
    Aswath.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #17
      Originally posted by bhappy
      I did what You told yestraday.I put my code in seperate function.Now The popup window is opening.But now i am getting other problem that i want to close that child window, for that iam using " Child.window.cl ose()" method. but it is not closing.And I didn't get the details in dropdown list of my parent window.Why?
      Show your updated code.

      You need to keep a reference to the opened window by, e.g.[CODE=javascript]var child = window.open(... );[/CODE]

      Comment

      • bhappy
        New Member
        • Jul 2007
        • 139

        #18
        Hi,
        Thanks a lot, Now window is closing by creating reference.But i can't get the data of child window into my parent window.My parent window dropdownlist becomes empty.Any ideas....?

        Thanks,
        Aswath.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #19
          Show the code which populates the list.

          Comment

          • bhappy
            New Member
            • Jul 2007
            • 139

            #20
            Hi,

            Code:.net
            After Addibg One country im populating state details .
            [CODE=asp] Dim sql1 As String = "select name as cstate,sid as id from master_state where cid = '" & cid & "' order by name for xml auto"
            com = New SqlCommand(sql1 , con)
            dr = com.ExecuteRead er()
            If dr.HasRows Then
            If dr.Read Then
            s.Append(dr.Get String(0).Trim( ))
            End If
            Response.Conten tType = "Text/xml"

            Response.Write( "<States>" + s.ToString())
            [/CODE]
            In This time no states in newly added country so it display empty in state dropdown list, but in country dropdown list also it showing empty.Why?

            Thanks,
            Aswath.
            Last edited by acoder; Sep 11 '07, 02:21 PM. Reason: Added code tags

            Comment

            • bhappy
              New Member
              • Jul 2007
              • 139

              #21
              Hi All,

              Any Answer to my problem?

              thanks,
              Aswath.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #22
                Originally posted by bhappy
                In This time no states in newly added country so it display empty in state dropdown list, but in country dropdown list also it showing empty.Why?
                Show the Javascript code that updates the state dropdown list.

                Also remember to use code tags when posting code.

                Comment

                • bhappy
                  New Member
                  • Jul 2007
                  • 139

                  #23
                  Dear Acoder,

                  I againg coming with new query, first of all thanks a lot u helped me more.All of my previous problems are rectified.After selecting "Add New" in dropdown list
                  The popup window is opening, But The problem is after the popup window is closing(automet ically) the parent window is reloading to get the newly added details(country ).But what my client needed is that the newly added value shuld be disply in that dropdownlist(co untry)

                  so plz help me.

                  Comment

                  • bhappy
                    New Member
                    • Jul 2007
                    • 139

                    #24
                    Hi All,

                    Any Answer to my query....?



                    Thanks,
                    Aswath.

                    Comment

                    • bhappy
                      New Member
                      • Jul 2007
                      • 139

                      #25
                      Hi,

                      Once the popup window is closed the parent window is reloading autometically in ajax why..?

                      Thanks,

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #26
                        Again, you'll have to show the code. Post your Javascript code (not .NET code). If there's a lot of code and it's possible, post a link to a test page instead.

                        Comment

                        • bhappy
                          New Member
                          • Jul 2007
                          • 139

                          #27
                          Hi,
                          Iam Sorry,Still im not upload my project.and the AJAX code contains more than 600 lines,for all ie., creating popup window's for new country, new state, and new city.as well as binding state & city details after country dpd list has changed. So The problem is Once i create new country or state or city the parent window is reloaded and i lost the details on my parent window ie.,(company name, address etc...all textboxes).I need to enter the details once again in textboxes.


                          Thanks,
                          Aswath.

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #28
                            Locate the code which creates the country, state and city dropdown lists and just post that here.

                            Comment

                            • bhappy
                              New Member
                              • Jul 2007
                              • 139

                              #29
                              Hi Acoder,

                              Here is code to create new country.
                              Code:(AJAX) ---- For New Country ------

                              [CODE=javascript]if(cid=="Add New")
                              {
                              if (obj!=null )
                              {
                              obj.onreadystat echange = n;
                              var url="Country.as px";
                              var W=window.open(u rl,'Country','w idth=400,height =200,toolbar=no ,menubar=no, resizable=yes,s crollbars=yes status=yes');
                              W.focus();
                              }
                              }
                              function n()
                              {
                              var c_id=document.g etelementbyid(" id");
                              if (obj!=null )
                              {
                              obj.onreadystat echange = contry;
                              obj.open("GET", "../getcontact.aspx ?id="+c_id+"&st atus=4",true);

                              obj.send(null);
                              }
                              }

                              function contry()
                              {
                              if(obj.readySta te == 4)
                              {
                              if (obj.status == 200)
                              {
                              retval = ""
                              var retval = obj.responseTex t;
                              retval += "</countries>"
                              clearSelect(doc ument.getElemen tById("dpdcontr y"));
                              populatecntry(r etval)
                              }
                              else
                              {
                              alert('error');
                              }
                              }
                              } [/CODE]



                              And remaning code is comman that is getting 'httprequestobj ect' .

                              Thanks,
                              Aswath.
                              Last edited by acoder; Sep 12 '07, 02:00 PM. Reason: Added code tags

                              Comment

                              • bhappy
                                New Member
                                • Jul 2007
                                • 139

                                #30
                                Hai,

                                What's Happened....... ?Can u understand my code.I thin no. Ok tell me how to store the page contents tempororly? I made all my controls to "EnableViewStat e=True" Then also i m not able to persist the details.


                                Thanks,
                                Aswath.

                                Comment

                                Working...