facelets

How to include another XHTML in XHTML using JSF 2.0 Facelets?

我是研究僧i 提交于 2019-11-25 21:39:29
问题 What is the most correct way to include another XHTML page in an XHTML page? I have been trying different ways, none of them are working. 回答1: <ui:include> Most basic way is <ui:include>. The included content must be placed inside <ui:composition>. Kickoff example of the master page /page.xhtml : <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <h

Error parsing XHTML: The content of elements must consist of well-formed character data or markup

浪子不回头ぞ 提交于 2019-11-25 19:16:57
As an extension of this question , I'm trying to insert Javascript to a <h:commandButton /> 's onclick property as action is already rendering an ajax table. What I want to do: Get the selected items in a list box and turn them into parameters to be used in a JSF FileServlet . i.e. para2=value1&param=value2&param=value3 Here's what I have: <script type ="text/javascript"> function myScript() { var box = document.getElementbyId('myForm:box'); var length = box.options.length; var paramstring = ""; for (var i = 0; i < length; i++) { if (i != (length - 1) { if (box.options[i].selected) {