:: Forum >>

Reload data in grid based on which button is clicked

I'm creating a file browser (like windows Explorer, not IE) where i have a treeview. which when a node is clicked it runs a Javascript in the html file. i want it to reload data into the GRID without having to reload the whole page. I have a few restrictions,

can NOT use frames.
data is stored on a server side MS Access database.

if anyone has an example of how this can be done.

AS i was writing this i though of an idea. Please also offer any suggestions on it. I can setup my page to have a 2nd frame (hidden) that when i click a node from the tree, it will load a file in the hidden frame that will call back to its parent (the one with grid in it) and change the data in the list.. any ideas, suggestions, comments.

Thanks everyone.
David Demers
Sunday, April 3, 2005

Couldn't you just create an XMLHTTP object, do a get, and then manually post the results into the table model?

Alternately, you could just change the table's url and requery it which will cause a requery (although beware the IE cache).
pcasey@earthlink.net
Sunday, April 3, 2005
Yes, there is a way... ASP .Net can dynamically fetch server side data without reloading the page. I haven't got a link for you I'm afraid but I think you will be able to find information about it if you search forums about ASP .Net.
//Henke
Henrik Feldt
Monday, April 4, 2005
You don't need to use ASP. You can do it with an XMLHTTP inside of either IE, Mozilla, Firefox, or Safari, talking to any web server (no .net, ASP or mircosoft specific code required).

Right now on my experiment box I have a web page polling data out of a web server and updating itself without a hard load. It's all done with browser side javascript talking to a decidedly non microsoft tomcat web server that is serving data via servlets.
pcasey@earthlink.net
Monday, April 4, 2005
Pcasey

is there anyway you can provide me more details? I'm not that familiar with XML. I'm running windows 2000 with IIS. and example would be great on how this is done.

Thanks,
David D.
Tuesday, April 5, 2005
This two functions might help. I'm going after a dynamic set of data (hence the dynamically generated URL). If you're just refreshing, you can use the same URL each time and save yourself all the newurl string manipulation.
function MollyXmlGet() {
        obj.setStatusProperty("code", "loading");
        obj.refresh();
        IEISBROKEN+=1;
        var newurl = MOLLYROOT + 'servlet/List?XML=true&objectName=' + MOLLYOBJECT +
        '&rowStart=' + MOLLYSTART +
        '&rowEnd='+ MOLLYEND +
        '&sortName=' + MOLLYSORT +
        '&sortDirection=' + MOLLYSORTDIRECTION +
        '&IEISBROKEN=' + IEISBROKEN;
        table.setURL(newurl);
        table.request();
        obj.setStatusProperty("code", "");
        obj.refresh();
         //document.body.style.cursor = 'default';
}
pcasey@earthlink.net
Tuesday, April 5, 2005
Thanks, I copied that code in and assigned the function to a input button.

i removed some code its now as follows; but gets stuck loading data. any ideas why?

function MollyXmlGet() {
obj.setStatusProperty("code", "loading");
obj.refresh();
IEISBROKEN+=1;

// start asyncronous data retrieval
table.request();
obj.setStatusProperty("code", "");
obj.refresh();
}
David D.
Wednesday, April 6, 2005

The ActiveWidget isn't too hot on error messages from what I've seen, so there's not a lot to go on from a debugging standpoint.

Usually that "stuck" means either A) the server failed to give you the data at all or B) the widget committed ritual suicide when the data came back formatted differently than it thought it ought to look.

As for your code snippets, forgive me if this is obvious but, are you sure you're telling the table what to ask for?

The line in my code table.setURL(newurl) tells the widget what data to request from my server. In your code I don't see you setting the URL at all, which may mean the widget hasn't a clue what to go forth and query.

If that isn't it, take a peek at your server logs and make sure the GET request is making it to the server (and that it looks reasonable). A good test is just to copy the URL into a web browser and execute it against your server. Most modern browsers can view xml results just as easily as HTML.

If you get a spiffy xml file back in your browser, you know the GET is working. If not, you know it's something wth your URL or your server side code.

Hope this helps,

--- Pat
pcasey@earthlink.net
Wednesday, April 6, 2005
ok, so when i put that seturl line back in and point it to the same spoint it works great. i thought i tries that yesterday, and didn't work. oh well. Thanks for all your help.

this is by far one of the best controls i have used so far.

David D.
Wednesday, April 6, 2005

This topic is archived.


Back to support forum

Forum search