My question from this morning involved Dojo. Now it does not.
By simply setting the contentType in f:view to text/html, DynaFaces fails to work. Take out the contentType attribute and it works.
I need contentType to be text/html for Dojo to work. Why won't DynaFaces execute correctly with it in?
There must be a way to make this work!
Here's the sample code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:f="
http://java.sun.com/jsf/core"
xmlns:h="
http://java.sun.com/jsf/html"
xmlns:jsfExt="
http://java.sun.com/jsf/extensions/dynafaces">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<title>Group box demo</title>
<jsfExt:scripts/>
<script type="text/javascript">
function updateGroupSelection()
{
var groupListBoxForm = document.forms['groupListBoxForm'];
var groupListBox = groupListBoxForm.elements['groupListBox'];
DynaFaces.fireAjaxTransaction( groupListBox,
{ execute: 'groupListBox', render: 'selectedGroupName', immediate: true } );
return false;
}
</script>
</head>
<body>
<f:view contentType="text/html">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<table border="0">
<h:form id="groupListBoxForm" prependId="false">
<tr>
<!-- Item tree -->
<td valign="top">
<h:selectOneListbox id="groupListBox"
value="#{groupsBean.selectedGroup}"
style="width:275px;height:309px"
valueChangeListener="#{groupsBean.groupSelected}"
onchange="return updateGroupSelection()">
<f:selectItems value="#{groupsBean.groupItems}" />
</h:selectOneListbox>
</td>
</tr>
<tr>
<td>
Selected group name: <h:outputText id="selectedGroupName" value="#{groupsBean.selectedGroupName}"/>
</td>
</tr>
</h:form>
</table>
</td>
</tr>
</table>
</f:view>
</body>
</html>