aspose file tools*
The moose likes JSF and the fly likes h:form and mouseover Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "h:form and mouseover" Watch "h:form and mouseover" New topic
Author

h:form and mouseover

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I want to alternate rows by onmouseover-handler and have this solution which really works fine :



But now, I have to wrap my dataTable with a h:form-Tag . When doing this, the alternating does not work anymore :



Does anyone know, why?

Thanks in advance


Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Look at the generated HTML/Javascript output and you´ll know.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
hey bauke, how are you? nice to see you again:-)

This:



generates this code:


But cannot find the solution to my problem. Do you know?
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
When I delete the h:form then all works, but I need the form.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
With looking to the code I actually meant looking to the code from developer´s perspective. Spot the fault in the code and trackback it to the JSF component. If it is a bug in your code, fix it. If it is a bug in RichFaces code, report it to the RichFaces boys over there at jboss.org.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
no its not a bug, having tried with h:dataTable and h:form.

I am searching..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Since you insist upon showing JSF tags rather than the generated HTML and JavaScript, I've moved this to the JSF forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I guess, it s not a JSF-Issue. Who have said, that a JSF-Developer has not care about Java-Script:-?

This JSF:






However, this is the generated HTML - the alternating does not work, only because of the form-tag:



LOOK DOWN:
table id="myForm:myDataTable" class="dataTableSection" onmouseover="$$('#myForm:myDataTable tbody tr:nth-child(odd)').invoke('addClassName', 'odd')"

If you delete the form-tag, and change the reference in Prototype to:
onmouseover="$$('#myDataTable tbody tr:nth-child(odd)').invoke('addClassName', 'odd')" - then zebra rows works - but I NEED THE FORM TAG!

Is that precisly enough?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
As said, the cause of the problem might be in the Javascript code generated by RichFaces.

If you don't understand Javascript as language at all then it stops here. We (at least I) are not going to do the debugging work for you. Report this issue as-is to the boys of RichFaces over there at JBoss.org and see if you get support.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
As said, the cause of the problem might be in the Javascript code generated by RichFaces.


This is not a RF-Problem!

Have I any richfaces-component there? No!

We (at least I) are not going to do the debugging work for you.


I only want to ask why the prototype script I added does not work within a common form-tag. Has that anything to do with richfaces, or even with JSF. No!

Besides, you do not have to help me. And second, you do not have helped me at all !
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Prototype? You're talking about the Javascript library Prototype?

Oh, now I see it. You didn't mention about it at all. You seemed to insist that it is part of RichFaces/JSF, you didn't mention that you're mixing RichFaces with Prototype. That was just your fault. It may also be my fault that I assumed it as part of RichFaces, sorry about that then. But with your last attitude where in you insist that I was not helpful, I am indeed not motivated anymore to help you.

For future problems with Javascript libraries, concentrate you on the client side code (HTML), not on the server side code, because that is the only one what Javascript can see and interact with. You should know that better.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
.. concentrate you on the client side code (HTML)


yes, you are right, that s the reason why I have added this topic to XHTML-JavaScript-Section.
But now, it s here.

I know, I had not explained my problem clearly.

Sorry.

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Well, try it again with only the HTML code and a decent Javascript debugger (Firebug anyone?).
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
solved:

http://www.coderanch.com/t/430188/HTML-JavaScript/prototype-selector
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:form and mouseover
 
Similar Threads
How to get row index in a dynamic table?
Clearing h:inputText value
Prototype tableID in function
rich:dataTable and rich:listshuttle rerendering issue
Simple expandable table with RichFaces