• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

panelGrid/dataTable problem

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a panelGrid in my jsp, and now I want to be able to bind a tablerow to a javascript via a mouseover event (to change color when mouse hovers).

The html for this is simple: But JSF seems to be at a loss here. For the entire table it's easy cos panelGrid has attribute for all mouseevents, but I can't specify javascript binding at row level.

Any input appreciated.

/seb

[ August 21, 2005: Message edited by: seb petterson ]
[ August 22, 2005: Message edited by: seb petterson ]
 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make each row contain a component which has attached a mouse over event

For example:

 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rick Beaver:
Make each row contain a component which has attached a mouse over event

For example:



The example you provide will not result in what I was asking for. Adding a component to column like you do will (as the name "column" suggests) add a component to a column in the current row, not to the entire row. Hence it will bind a mouseover event to that TD not to the TR.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct - so you do it for every column in the row if you want everything to have a mouseover effect.

You have to do that in plain HTML as well so it is nothing new.

as the name "column" suggests



I object to being patronised when I offer free advice to someone who asks for it so I think I will leave it here. Good luck.
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rick Beaver:
[QB]Correct - so you do it for every column in the row if you want everything to have a mouseover effect.

You have to do that in plain HTML as well so it is nothing new.
[QB]



Actually thats incorrect, in plain html you can define dhtml bindings for onmouseover for an entire row, you do not have to do it for each cell in a row. Furthermore, the effect is completely different in declaring onmouseover events for individual cells since I am not looking for a way to change cell while the other cells on the same row remain unchanged.

(My apologies, I was grumpy this morning, I am thankful for all input.)
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by seb petterson:


Actually thats incorrect, in plain html you can define dhtml bindings for onmouseover for an entire row.



Then I stand corrected - I apologise.

In that case I don't think you can do that with standard JSF.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will this work for you?



Edit: had to put a space in 'onmouseover' call because the BB would not let me post it otherwise.

[ August 23, 2005: Message edited by: Mike Minner ]

Smilies are the spawn of Satan!!! Aaarrggghhhh!!!
[ August 23, 2005: Message edited by: Mike Minner ]
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Minner:
Will this work for you?



Yes sir, most def.

Another question, do you know how to make it work for dataTable (I have a situation where I need to generate a table dynamically where dataTable serves me better).

Thanks!
 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will this work for you?

Javascript:


JSP


Note: I had to put a space in "onmouseover" to be able to post this.
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Minner:
Will this work for you?


Thanks, its close but I dont think it will. I need to have h utputText as components in the table rather than h:inputText, and ouputText doesnt take onmouseover as attribute.

...hmm, actually thats prolly close enough, i should be able to wrap the outputText in a panelGrid or something that takes onmouseover, then combine that with a version of your javascript. right? ...anyway, i need to get off the computer now, i ll try it tomorrow.

Thanks a lot for your help!
[ August 23, 2005: Message edited by: seb petterson ]
 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you are right. Just wrap it in a panelGrid. I wanted to keep the code simple.

You shouldn't have to adjust the javascript, because the <td> will still be the parentNode of the element passes as "this" in the method call.

cheers
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem is just screaming custom component.
 
Mike Minner
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now, don't go setting me on another adventure that I don't have time to go on but probably will any way because I am incapable of letting it go.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic