473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HTTPRequest problems updating 'hidden' objects?

I am finding some unusual behavior with techniques I am using to
show/hide/update data without having to refresh the page. I'm quite
sure it's developer ignorance on my part and would be grateful for any
suggestions.

My page has 10 tables with their visibility controlled by the user
making a menu selection. For example, selecting menu_1 calls a
function which displays table_1 by setting table_1's style display:
block and hides tables 2-10 by setting their respective styles to
display: none. Everything in this simple navigational approach works
as expected.

I am also using the HTTPRequest object to update relevant objects on
the page based on user input. The problem I am seeing is when the
HTTPRequest object is used to update DOM objects contained within the
"invisible" tables -- or more accurately within those tables having
their style display:none. I have tried using both the HTTPRequest
object's synchronous and asynchronous approach and am seeing the same
results.

I've tested when all of the tables are "visible" by setting their style
settings to display:block and HTTPRequest calls work as expected.

The other twist in my example is that these HTTPRequest calls are each
making a SQL query and updating a chart object within the table, which
may take about 500ms each to return. My initial impression is that it
looks as if the page is being rendered too fast because any more than
three charts on a page is when the charts start getting misplaced on
the page. Again, everything works fine when all tables are visible.

Is this a known problem with HTTPRequest, or do I need to migrate my
coding techniques to the 21th century?

Nov 23 '05 #1
1 1986
Gunnar wrote:
I am finding some unusual behavior with techniques I am using to
show/hide/update data without having to refresh the page. I'm quite
sure it's developer ignorance on my part and would be grateful for any
suggestions.

My page has 10 tables with their visibility controlled by the user
making a menu selection. For example, selecting menu_1 calls a
function which displays table_1 by setting table_1's style display:
block and hides tables 2-10 by setting their respective styles to
display: none.
You will do better to toggle between '' and 'none'. In CSS 2, the
default value for the display property of a table is 'table'. Some
browsers do not implement CSS 2, others do. Setting display to ''
allows it to return to the default or whatever it has been set to by
some style rule.

<URL:http://www.w3.org/TR/CSS21/visuren.html#propdef-display>

IE will be happy with - display: block - for a table, but some other
browsers will not.
Everything in this simple navigational approach works as expected.

I am also using the HTTPRequest object to update relevant objects on
the page based on user input. The problem I am seeing is when the
HTTPRequest object is used to update DOM objects contained within the
"invisible" tables -- or more accurately within those tables having
their style display:none. I have tried using both the HTTPRequest
object's synchronous and asynchronous approach and am seeing the same
results.


Do you have a small test case? Do you get the same behaviour if you
modify the tables using, say, an onclick event rather than HTTPRequest?
How are you modifying the tables (hopefully not using innerHTML)?

The following works for me in IE and Firefox whether the table is
visible or not when modified:
<input type="button" value="hide/show table" onclick="
var t = document.getElementById('tableX');
t.style.display = ('none' == t.style.display)? '' : 'none';
">
<input type="button" value="Add a row" onclick="
var oRow = document.getElementById('tableX').rows[1];
var nRow = oRow.cloneNode(true);
oRow.parentNode.insertBefore(nRow, oRow.nextSibling);
">

<table id="tableX">
<tr><td>cell0</td><td>cell</td><td>cell</td></tr>
<tr><td>cell1</td><td>cell</td><td>cell</td></tr>
<tr><td>cell2</td><td>cell</td><td>cell</td></tr>
</table>

[...]

--
Rob
Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
Hello, Sorry to ask what is probably a simple answer, but I am having problems updating a table/database from a PHP/ PHTML file. I can Read From the Table, I can Insert into Table/Database, But...
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
4
by: Anthony Boudouvas | last post by:
Hi to all, i have a form with 2 System.Windows.Forms.Timer objects. One fire every 5 seconds and the other every 10 seconds, the both take actions in two hashtables declared in same form. ...
4
by: Andy Fish | last post by:
Hi, I have a web app that I want to make calls back into itself (preserving the session cookies etc). I am using a System.Net.HttpWebRequest object to make the request, but I am having...
3
by: KNN | last post by:
Hi I have some tables with hidden attribute set to 1. In the query desgn view , I do not see these tables as expected. But, If I choose the query wizard to create a new query, then i do see...
5
by: Jonathan Boivin | last post by:
Hi, I've got some problems with loading bills using a bill usercontrol I built. If I load all current bills in my test environment (156) everything is fine once, but repeating the operation...
5
stepterr
by: stepterr | last post by:
I have a form that is built based on a query. Everything is working except when I submit the form the radio buttons are only updating the first row in my database. dcategory and dthumbnail are two...
1
by: Michaelp | last post by:
Hello! I am studying the way PHP allows programmers to manipulate Http communication, and have looked at the HttpRequest and HttpResponse classes. All functions I find in the documentation...
1
by: cerilocke | last post by:
I have a repeater in which I have a hidden field (input type = hidden), a textbox (asp:TextBox), a checkbox (input type = checkbox) and a label (asp:Label). I have bound all four items to the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.