Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | Tags | Help
Is it possible to add an Event to a Panel/Div? 
I'm working with a repeat control and I'd like to make each "row" clickable anywhere.  The repeat contains a custom control that isn't a typically view/grid but is repeating "blocks" from left to right.
 
The custom control has a panel so I can apply a style class nicely and force the size of the "block".  Inside the panel I have a table to show fields from a document.

I attached code to the table's "onclick" event to open a related document.  But since the table isn't filliing up the block completely, nothing happens if I click in the lower portion of the block.
 
It doesn't look like there's an "onClick" event for a Panel/Div.  Is there anyway to "add" one?  Or do I need to abandon the panel and try something like nested tables?

Thanks
Domino Development / XPages
Tagged
David Leedy - about 1 year ago |  |  | Viewed 115 times

There are 2 answers

1votes
Marked as correct on7/13/10 10:50 AM
Yes, you can add events to a panel, however there is no support for it through the UI, you have to do it in the source code ... also, if you plan to support a "backwards old fuddy duddy no fun good for nothing pain in the @rse piece of crap" browser (say IE 6), then nevermind.
 
Easiest way to get it done if you aren't comfortable enough coding the event 100% in the src window is to create the event on an object that supports it, then just move the xp:eventHandler block inside the xp:panel


Jeremy Hodge - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes
Jeremy gave the correct answer.  It didn't work at first to me.  It turns out that you must make sure that the panel has an ID.  That's needed for the event to bind to it.
 
Thanks Jeremy!


David Leedy - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community