Hi-
I just started working with jsf about a month ago. So far so good except I
ran into a road block about a few days ago. I have been searching on the
mailing list for some answers but I am not having any luck. I believe there
was a few responses in the mailing list regarding this but I cannot figure
out the message. Basically I am generating a form that takes some user
information. Before I submit the form submits, id like to provide a modal
dialog that will prompt for a passphrase before he can submit. I will verify
on the server that the passphrase is correct before and then I will do all
the processing of the other form fields (basically, the verification of the
passphrase and the processing all take place in 1 request). If the
passphrase is incorrect, I have a "FAIL" action that redisplays the modal
dialog. I was having problems with the value binding expression. The value
of the inputtext field in the modal dialog(...
value="#{rsvpController.loginString}" ) as well as the main
form(<h:inputText value="#{rsvpController.numRespondents}"/>) are not being
binded to my backing bean. I looked at the generated html and I noticed the
that dialog is not within the form tags. I am attaching the simplified jsp
page below (along with test backing bean and excerpt from faces config). Am
I missing something simple? Thank you in advance.
I apologize in advance if I put too much code below.
BEGIN JSP>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>
<%@ taglib prefix="tr" uri="http://myfaces.apache.org/trinidad" %>
<%@ taglib prefix="trh" uri="http://myfaces.apache.org/trinidad/html" %>
<%@ taglib prefix="s" uri="http://myfaces.apache.org/sandbox" %>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
</head>
<f:view>
<trh:body styleClass="page-background">
<h:form>
<h:panelGrid columns="1">
<h:inputText value="#{rsvpController.numRespondents}"/>
<h:outputLink value="#"
onclick="dojoDialogOuterform.show();">
<h:outputText value="searchOuterForm"/>
</h:outputLink>
</h:panelGrid>
<s:modalDialog id="loginDialog"
dialogId="loginDialog"
dialogVar="dojoDialogOuterform"
dialogAttr="bgColor='white' bgOpacity='0.5'
toggle='fade' toggleDuration='250'"
styleClass="dojoDialog">
<h:panelGrid columns="1">
<h:outputText value="hello world"/>
<h:panelGrid columns="1">
<t:inputText id="filter1Outerf"
forceId="true"
value="#{rsvpController.loginString}"
size="25"
immediate="true"/>
<h:commandLink id="loginSubmit"
action="#{rsvpController.rsvpSubmit}" immediate="true">
<h:outputFormat value="Submit"/>
</h:commandLink>
</h:panelGrid>
</h:panelGrid>
</s:modalDialog>
</h:form>
</trh:body>
</f:view>
</html>
END JSP>>>>>>>>>>>>>>>>>>>>>
BACKING BEAN >>>>>>>>>>>>>>>
public class testRSVPBean {
private String loginString;
private Integer numRespondents;
////////////////////////
///// Constructors /////
////////////////////////
/**
* Default Constructor
*/
public testRSVPBean() {
}
////////////////////////
//// Action Methods ////
////////////////////////
public String rsvpSubmit() {
System.out.println("Login string is " + loginString);
System.out.println("numrespondents is " + numRespondents);
return "success";
}
////////////////////////
/// Getters/Setters ///
////////////////////////
public String getLoginString() {
return loginString;
}
public void setLoginString(String loginString) {
this.loginString = loginString;
}
public Integer getNumRespondents() {
return numRespondents;
}
public void setNumRespondents(Integer numRespondents) {
this.numRespondents = numRespondents;
}
}
END BACKING BEAN>>>>>>>>>>>>>>>>>>
BEGIN FACES CONFIG >>>>>>>>
<managed-bean>
<description>Rsvp controller</description>
<managed-bean-name>rsvpController</managed-bean-name>
<managed-bean-class>testRSVPBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
END FACES CONFIG >>>>>>>>>
_________________________________________________________________
Puzzles, trivia teasers, word scrambles and more. Play for your chance to
win! http://club.live.com/home.aspx?icid=CLUB_hotmailtextlink