Getting a DOM element from JavaScript using RichFaces 4

I am currently studying the transition to RichFaces 4. From my JS, I need to get DOM elements using

document.getElementById('myParent:myElement').

From the JBoss migration guide, I realized that “document.getElementById” can no longer be used: https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-CommonComponentsChanges .

Can someone explain to me why, and how can I (simply) change all my calls to this function - more than a thousand - to something else?

Thank.

+5
source share
1 answer

I suggest you read this article: RichFaces Built-in Functions

To summarize, there are 4 built-in functions:

  • #{rich:clientId('id')}
  • #{rich:element('id')}
  • #{rich:component('id')}
  • #{rich:findComponent('id')}

Explanation:

  • richfaces .
  • getElementById (HTML-)
  • getElementById ( JavaScript)
  • , Bean
+7

All Articles