Click to See Complete Forum and Search --> : Applet vs DHTML


srikav98
12-24-2002, 09:14 AM
Hi,

We are developing a web page for financial bond calculations. We have a table in our page with 53 columns. When we enter something in the 2nd column, and tab out of that cell, we need to populate the other cells in that row, this information to populate the other columns should be fetched from the server. Now our main concern is which technology to use: applets or DHTML?

In Applets, I think we can use servlet-applet communication via inputstream and outputstream. I am not exactly sure about this. Is it correct way of doing it?

But with applets, it takes a lot of time to download. We would like to minimize this using DHTML. But in DHTML, how can we populate the other columns depending on the information in the 2nd column? Is there a way to do this? One more question: How can we send a table data to server? In other words, is there a way to send some data to server without using forms?

Can somebody please help me with this question?

Thanks a lot for your reply in advance.

swon
12-24-2002, 09:30 AM
Your last question -- data send w/out using forms.:

It is possible to send some data without using a form.

Every link or button or something else post some data to the server. Just an easy example:

<a href=index.html?site=main>link</a>

the server becomes an variable named 'site', with the value 'main'.

For such applications you want, it's maybe the best if you made an mix between D-HTML and server side languages like PHP or ASP etc.

Vladdy
12-30-2002, 09:58 AM
You can have communication with the server using javascript on the client and any server side scripting language.
When you need to make request to the server dynamically create a script node and send the infomation you need as parameters:
script.src = 'ProcessRequest.asp?Param1=value1&Param2=value2';
The server side script should return the data in a form of javascript array or object. The returned file should also contain a call to the function that will update your HTML page with the new data.

Contact me, if you need assistance in actual coding.

!!! This method will work with DOM compliant browsers (IE5+, Mozilla based) that have javascript enabled. Arguably it would still cover more users than an applet.!!!

Craiga
12-30-2002, 01:49 PM
Exactly.

Just use the DOM to create a new script:

elmScript = document.createElement('script');
elmScript.src="ServerSide.php?param1=value1";
document.getElementsByTagName('body').item(0).appendChild(elmScript);

Then, in the script have it access the columns, you can probably just give the columns id's and do it that way:

<table>
<tr>
<td id="col1_1">Data 1_1</td>
<td id="col1_2">Data 1_2</td>
</tr>
</table>

document.getElementById('col1_1').innerHTML="Text to change to";

Vladdy
12-30-2002, 08:24 PM
Originally posted by Dave Clark
Was this posted as some kind of rebuttal about what I said
Was not really a rebuttal about anything you said.
The thing is that when talking about forms a query strings, most associate it with HTML files that results in the page reloading. Since the original request was about performing communication with the server without reloading the page, I pointed out that this standard interface can be used "behind the scenes" when applied to javascript files.

Peace