• 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

h:form and mouseover

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the generated HTML/Javascript output and you´ll know.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I delete the h:form then all works, but I need the form.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no its not a bug, having tried with h:dataTable and h:form.

I am searching..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you insist upon showing JSF tags rather than the generated HTML and JavaScript, I've moved this to the JSF forum.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

.. 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
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, try it again with only the HTML code and a decent Javascript debugger (Firebug anyone?).
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved:

https://coderanch.com/t/430188/HTML-JavaScript/prototype-selector
 
reply
    Bookmark Topic Watch Topic
  • New Topic