0

I can access jsf tags in the jsf context, but is there a way to also access regular html tags in the jsf context?

In detail, I have the following on a web page

<h:form >
<b>id:</b><b id='idDisplay'>somevalue</b><br/>

I would like to access the value of idDisplay in my backing bean.

1 Answer 1

1

Not directly, you'd need to convert them to fullworthy JSF components so that you can grab them by their client ID by UIComponent#findComponent(), or to look for a solution in the right direction.

As an indirect solution, you could get them as children of a known parent JSF component. In case of Facelets, it'll be an instance of UIInstructions. But whatever you plan to do with this, this is a nasty approach as it's pure plain text and you'd need to parse the HTML yourself.

In your future questions, I recommend to just elaborate the functional requirement in detail instead of asking how to achieve a solution of which you thought that it is the right solution, but after all isn't.

Sign up to request clarification or add additional context in comments.

4 Comments

thanks for your comments! I edited my original post providing more details. If I convert them to JSF components, can the values of these JSF components be altered with the use of Javascript?
Yes, JSF ultimately just produces HTML/CSS/JS.
I still don't see how I can return the html tags in the jsf context. I don't see how I get an instance of UIInstructions
As answered, get a known parent JSF component and then go through its children.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.