• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using Applet to speed up hiding of elements

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good day!

I have a table inside a table. Each sub-table is inside a <td>.
I have put an ID in each of those <td>'s so that whenever I
want to hide other sub-tables, I'll just access the <td> ID
through javaScript and hide it. It was supposed to be a breeze.
And it did for most cases. But my problem now is that I have a
sub-table which contains thousands of data and it loads so slow.

I have an idea which is to use my applet class code and "declare"
the hiding in there. Can I put code like this in there?

<CODE>
document.getElementById(tdID).style.display = 'none';
</CODE>

here's a snippet of my applet code:

<CODE>
win = JSObject.getWindow(this);
doc = (JSObject)win.getMember("document");

genForm = getParameter("genForm");
form = (JSObject)doc.getMember(genForm);

genField = getParameter("genField");
field = (JSObject)form.getMember(genField);

txtSendMsg.setText((String) field.getMember("value"));
</CODE>

Can I apply similar style to the javaScript code that I mentioned earlier?
can it speed up my hiding?

Thanks.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if you can do that, but it really isn't obvious to me why you think the Javascript would run faster if you called from an applet instead of calling it directly. Or have I misunderstood your idea?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I, too, have no idea if it will be faster, but using the Common DOM API you can manipulate the page's DOM tree directly from within an applet. That should at least be more straightforward than using LiveConnect.
 
Darren Alexandria
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies. Actually, my applet code is composed of
this:



I have tried using javaScript directly and it is really slow when it
comes to large tables. If the applet thing will not work, can you please
give me some advice or suggestions?

Thanks a lot.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

if (keyText == "Enter")


You should never use "==" to compare strings; it tests object equality, not string equality. Use the String.equals method instead.
 
Darren Alexandria
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, thanks for correcting me.
How about some advice on how to speed up the hiding thing?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you've tried the Common DOM approach, and it isn't fast enough either?

There are ways to change the stylesheet directly, so that all elements that are part of a particular class are changed all at once. That would be a question for the HTML/JavaScript forum, though.
[ June 27, 2008: Message edited by: Ulf Dittmer ]
 
Darren Alexandria
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestion.
Ok, I'll post my inquiry in the HTML/JavaScript Forum.

God bless.
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic