Is there a way to make the following code work, apart from placing the "#out" component inside the h:form element?

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>Welcome</title>
</h:head>
 
<h:body>
 
	<h:form id="form1">
	
		<p><h:outputText id="out" value="#{user.greeting}" /></p>
 
		<h:inputText value="#{user.name}" id="user-name" />
		<p><h:inputSecret value="#{user.password}" id="password" /></p>
		<p>
		<h:commandButton value="Login" id="login-button">
			<f:ajax execute="user-name password" render="out" />
		</h:commandButton>
		</p>
	</h:form>
</h:body>
 
</html>


At the moment the following exception is thrown by JSF when rendering the page:

<f:ajax> contains an unknown id 'out' - cannot locate it in the context of the component login-button

Reply via email to