File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Prototype tableID in function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Prototype tableID in function" Watch "Prototype tableID in function" New topic
Author

Prototype tableID in function

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I know, it s not really a Java-Issue..

I use Prototype in my JSP-Site.

To have a zebra-style in my table, when the onmouseover Event (=onmouseoveL=onmouseover) occurs.
This Code works:



However, the code above styles ALL tr-Elements of my Site.
I want to style only the tr-elements of myDataTable.

So I tried this, but it does not work:
(mySite:myDataTable is the client-ID of my DataTable).



I tried this also, but it does not work:




What am I doing wrong?
[ November 23, 2008: Message edited by: nimo frey ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to foolow the same ideas that CSS does when you want to speficy things in your stylesheet rules.

So we need to follow the pattern:


Eric
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
hey eric,

thanks that works. But now, I have a strange behaviour:

When I do this, all works fine (only my datatable is styled):


But I need a form around my dataTable:


But when I wrap a form around my datatable and the mouseover-Event occurs,
then instead of my dataTable the form is styled! very strange.

When I delete my form-tags, then zebra-style for my dataTable works. But I need the form around my datatable.

Any suggestions?

[ November 23, 2008: Message edited by: nimo frey ]
[ November 23, 2008: Message edited by: Eric Pascarello ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Have you looked at the generated html page and see what is different between the 2 pages?

Eric
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
When I wrap my dataTable with a div instead with a form, then the generated
html looks like:

This works, as I have a wrapper div:



This works not, as I have a wrapper form:


You see, when mouseover occurs, then the class myStyle is adapted in the form-tag instead of the tr-tags..strange.

Why is that so?
[ November 23, 2008: Message edited by: nimo frey ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prototype tableID in function