最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Getting DOM element from JavaScript using RichFaces 4 - Stack Overflow

programmeradmin2浏览0评论

I am currently studying a migration to RichFaces 4. From my JS, I have have to get DOM elements using

document.getElementById('myParent:myElement').

From the JBoss migration guide, I understood that "document.getElementById" can no longer be used : .

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

Thanks.

I am currently studying a migration to RichFaces 4. From my JS, I have have to get DOM elements using

document.getElementById('myParent:myElement').

From the JBoss migration guide, I understood that "document.getElementById" can no longer be used : https://munity.jboss/wiki/RichFacesMigrationGuide33x-4xMigration-CommonComponentsChanges.

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

Thanks.

Share Improve this question edited Jun 19, 2012 at 13:52 user1329131 asked Jun 19, 2012 at 13:35 user1329131user1329131 513 bronze badges 1
  • I followed your link now...tbh, all I can think to share about this is...bummer ! – Tom Commented Jun 19, 2012 at 13:57
Add a ment  | 

1 Answer 1

Reset to default 7

I suggest you to read this article: RichFaces built-in client functions

To summarize, there are 4 built in function:

  1. #{rich:clientId('id')}
  2. #{rich:element('id')}
  3. #{rich:ponent('id')}
  4. #{rich:findComponent('id')}

Explanation:

  • The first one permit to convert richfaces id to string.
  • The second one is used to getElementById (HTML Element)
  • The third one is used to getElementById (JavaScript Component)
  • The last to get value without a call to the managedBean
发布评论

评论列表(0)

  1. 暂无评论