Hello there i want to ask about injecting xhtml code dynamically from a bean to xhtml page
this is the code i want to inject
and i put it in a string in the bean like :
private String x="<th> \n <h:outputText value=\"#{msgs.label_insertInSalaryPayroll}\" /> \n </th> \n <td> \n <h:selectOneMenu value=\"#{financialElements.insertInSalaryPayroll}\" styleClass=selectMenu\"> \n <f:selectItem itemValue=\"\" itemLabel=\"#{msgs.label_all}\" /> \n <f:selectItem itemValue=\"true\" itemLabel=\"#{msgs.label_insertInSalaryPayroll}\" /> \n <f:selectItem itemValue=\"false\" itemLabel=\"#{msgs.label_notInsertInSalaryPayroll}\" /> \n </h:selectOneMenu> \n </td> \n <th> \n <h:outputText value=\"#{msgs.label_elementEffect}\" /> \n </th> \n <td> \n <h:selectOneMenu value=\"#{financialElements.elementEffect}\" styleClass=\"selectMenu\"> \n <f:selectItem itemValue=\"-1\" itemLabel=\"#{msgs.label_all}\" /> \n <f:selectItem itemValue=\"#{financialElements.credit}\" itemLabel=\"#{msgs.label_credit}\" /> \n <f:selectItem itemValue=\"#{financialElements.debit}\" itemLabel=\"#{msgs.label_debit}\" /> \n </h:selectOneMenu> \n </td>";
and i get it from the xhtml page like this :
<h:outputText value="#{financialElements.x}" escape="false" />
the result is as below image from the browser inspect view (only "th" and "td" tags are rendered but any h:.. tag is not executed and written in the page as is )
so i want to know is there any way to solve this issue or to inject jsf tags from the bean dynamically to xhtml page .