473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax inside Ajax :- not refernacing

1 New Member
Hi ,

We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each row. When this button is pressed, we want to update just the single row and keep the rest of the table the same.

Currently the AJAX call looks something like this:

document.getEle mentById("My_Di v").innerHTML=x mlHttp.response Text;

The server page returns the table as HTML dynamically and the returned HTML containing the table is fetched into the DIV.
--------------------------------------------------------

The problem is that the returned HTML Table is not visible in the original page source (as it is returned dynamically at run time). We need to reference a particular row in the returned Table and make another AJAX call inside the original AJAX call that fetches the RowID gets the new values and then updates just the one row.

--------------------------------------------------------

Call flow:

a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV

Required Call Flow:

a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV
d) Each HTML Table Row Has a Button (next) - Row_ID = N
e) On button Press Update Row_N with a new value fetched by different AJAX call.


-----------------------

We tried to implement the button call with the original code. The problem is that we are not able to reference the table because it is dynamically generated. How do you reference that table object to manipulate the rows.

Has anyone excountered this problem?
Apr 8 '08 #1
2 1669
Amzul
130 New Member
just add to the raw (from the server that generate the code) an update button on click will call a function that recive the new value and the element id of that raw
and will update it in the database (assuming u generate the table from a database) and this is tha part i am not sure will work, replace only the raw
innerHTML='<tr id=""> <tr>'
Apr 8 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
We tried to implement the button call with the original code. The problem is that we are not able to reference the table because it is dynamically generated. How do you reference that table object to manipulate the rows.

Has anyone excountered this problem?
Just because you can't see it in the original page source doesn't mean it's not there. Use a tool like Firebug to see the current source. Either change the server-side script to generate the table with buttons or you can use DOM methods such as document.getEle mentById() to access the table to add the buttons.
Apr 9 '08 #3

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

Similar topics

0
1845
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
0
1839
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly developing world of Ajax user interfaces on the browser, IDEAlliance (www.idealliance.org) announced today that its annual XTech Conference will kick off on May 16 with Ajax Developers' Day. XTech 2006 (www.xtech-conference.org), to be held May...
1
1740
by: bcochofel | last post by:
Hi, I'm using Perl CGI and HTML::Template to generate the following XML: ---------------------------------------------------------------------- <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xml" href="RR.xsl"?> <!-- $Id: template.xml,v 1.5 2006/12/11 11:13:30 bcochofel Exp $ --> <RR xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://cochofel.sytes.net ~bcochofel/iweb/files/RR.xsd">
4
1362
by: pbd22 | last post by:
Hi. I have an ajax question. I am wondering if it is possible to get the response from a method within a given page, and that function alone? Traditionally, I have been getting the response from the Page_Load method of the targeted page, but now I want the response from a particular method on the target page: Public Sub SomeCallback(ByVal sender As Object, ByVal e As EventArgs)
2
1182
by: HockeyFan | last post by:
I'm new to AJAX, but wanting to use it in my ASP.Net app. I've done a simple example that I read about that adds 2 numbers and puts up an alert box. Now I want to do something real world and having trouble. I have a form with a bunch of information that the user fills out. I then an putting in a div that I've given an Id to that I need to have AJAX populate from another aspx on the server. I'm using ajax.dll, which allows for...
3
1452
by: nicksname7 | last post by:
Hi, I am a newbie in the AJAX world. first of all, take a look at my script first: assume this script is saved as "myAjax.js" //-----------------inside myAjax.js-------------------- function AJAX() { var isBusy = false; var obj = null; var url = ""; var Method = "";
2
3644
by: nicknack | last post by:
Hello. A little tricky situation: I have a master page. Inside that master page I have A div (With overflow:scroll) that contain an ajax updatePanel. Inside that updatePanel I have a tree. The problem is That if I scroll down the tree and then select a node. The tree jump back to the top. Because I'm inside a masterpage I don't have the "maintainScrollPositionOnPostBack".
22
1692
by: sheldonlg | last post by:
I am looking for a clean solution to a problem that I solved in, what I call, a "dirty" way. Here is what I want to do. I have a dropdown list. Clicking on an item in the dropdown list invokes an AJAX call that gets data which populates the entire lower part of my screen. It does this with an innerHTML for the div tag that holds all of this. This works fine. I also have an "Edit" button that I want to show next to dropdown list,...
3
2424
by: heyi | last post by:
Hi Guys I need some expert advice on Ajax. I have some difficulties updating a <div> tag inside a table with Ajax. My html looks like this: ------------------------
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.