Peter,
Checkboxes are like any other field.

HTML:
<html>
<head>
    <title>
        Allowable SAML Bindings
    </title>
        <link rel="stylesheet" type="text/css" media="screen" 
href="../../images/style.css" />
</head>
<body>
    <span jwcid="$content$">
                <table class="interior">
                        <tr>
                    <td>
                    <span jwcid="[EMAIL PROTECTED]:AnySubmit"><input 
jwcid="artifactCheckbox" type="checkbox"/></span>Artifact
               </td>
            </tr>
                        <span jwcid="showPost">
                    <tr>
                                <td>
                                        <input jwcid="postCheckbox" 
type="checkbox"/>POST
                                </td>
                            </tr>
            </span>
                        <span jwcid="showRedirect">
                <tr>
                                <td>
                                        <input jwcid="redirectCheckbox" 
type="checkbox"/>Redirect
                                </td>
                </tr>
            </span>
                        <span jwcid="showSoap">
                <tr>
                                <td>
                            <span jwcid="[EMAIL PROTECTED]:AnySubmit"><input 
jwcid="soapCheckbox" type="checkbox"/></span>SOAP
                                </td>
                </tr>
            </span>
                 </table>
   </span>
</body>
</html>

JWC:
    <component id="artifactCheckbox" type="Checkbox">
        <binding name="selected" 
expression="page.visit.currentState.artifactBinding"/>
    </component>

    <component id="postCheckbox" type="Checkbox">
        <binding name="selected" 
expression="page.visit.currentState.postBinding"/>
    </component>
    
    <component id="showPost" type="Conditional">
        <binding name="condition" 
expression="page.visit.currentState.showPostChoice()"/>
    </component>

     <component id="showRedirect" type="Conditional">
        <binding name="condition" 
expression="page.visit.currentState.showRedirectChoice()"/>
    </component>
     
    <component id="redirectCheckbox" type="Checkbox">
        <binding name="selected" 
expression="page.visit.currentState.redirectBinding"/>
    </component>
    
    <component id="showSoap" type="Conditional">
        <binding name="condition" 
expression="page.visit.currentState.showSoapChoice()"/>
    </component>
     
    <component id="soapCheckbox" type="Checkbox">
        <binding name="selected" 
expression="page.visit.currentState.soapBinding"/>
    </component>

JAVA:
    private boolean artifactBinding = true;
    private boolean postBinding = true;
    private boolean redirectBinding = true;
    private boolean soapBinding = true;

    public boolean isArtifactBinding()
    {
        return artifactBinding;
    }

    public void setArtifactBinding(boolean artifactBinding)
    {
        this.artifactBinding = artifactBinding;
    }

    public boolean isPostBinding()
    {
        return postBinding;
    }

    public void setPostBinding(boolean postBinding)
    {
        this.postBinding = postBinding;
    }

    public boolean isRedirectBinding()
    {
        return redirectBinding;
    }

    public void setRedirectBinding(boolean redirectBinding)
    {
        this.redirectBinding = redirectBinding;
    }

    public boolean isSoapBinding()
    {
        return soapBinding;
    }

    public void setSoapBinding(boolean soapBinding)
    {
        this.soapBinding = soapBinding;
    }

All you have to do is put 1-n in an HTML template.  I have mine declared in the 
.jwc, but you could just put it in the HTML.  Then link them to some method in 
a java class somewhere. I have mine updating a visit object value 
"currentState".  "Current State" is the users "current state".  Pick a java 
object somewhere.

The values of the boolean values will be displayed as checked or unchecked just 
as the data is in the java object.  If the user checks or unchecks a checkbox 
and submits it then the java method is called.  The end result is that the java 
boolean values are displayed and modifiable by your users.  When submitted they 
automatically populate your java values.  No different than a Text Input Field.

hth,

Mark

Name: Mark J. Stang
Title: Senior Engineer/Architect
office: +1 303.468.2900
mobile: +1 303.507.2833
Ping Identity



-----Original Message-----
From: Peter Dawn [mailto:[EMAIL PROTECTED]
Sent: Wed 9/6/2006 11:56 PM
To: Tapestry users
Subject: Re: Obtaining check box data from a form
 
ok. the only other way for me to obtain a users selection would a
radio button. might try that.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to