Is there any chance to get the html content (mime) from a rich text component without any datasource. I would like to grab the content from the field like this.getComponent("FieldName").value
but this dosen't work.
thanks.
Is there any chance to get the html content (mime) from a rich text component without any datasource. I would like to grab the content from the field like this.getComponent("FieldName").value
but this dosen't work.
thanks.
You can bind the control to a scoped variable; for example, #{viewScope.comments}. You can then retrieve the submitted value from the scope instead of from the component itself; for example, viewScope.get("comments").
Alternatively, you can set a dataContext variable to a JS expression, e.g. <dataContext var="richText" value="#{javascript:return {value:""};}" />. Then you can bind the control to #{richText.value} and retrieve it via the same expression.
And, of course, you could define a managed bean and bind the control to one of its properties. This option provides the most flexibility, but isn't quite as simple as the other two options above.