You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken nashua <nh...@hotmail.com> on 2006/10/18 20:10:25 UTC
CheckBox Implementation ... Tap-4.1.1 help please (thanks)
Guys,
Ok, I am going to try the @Checkbox component.... inside some html
Typical usage follows...
<td>
<span jwcid="@Insert" value="message:label.rememberMe"/>
<input jwcid="rememberMe@Checkbox" value="ognl:rememberMe"/>
</td>
Now I do not want to operate any *.Page files (although an alternative
sample would be nice to refer to)
I want to do everything in JAVA... period
1. Can someone provide an example of how to GET this boolean property into
the JAVA onFormSubmit() method?
Why isn't there just an @Property(id="rememberMe" type="boolean")
annotation
Ideally it wuold be nice if this existed
@Property(id="rememberMe" type="boolean")
public abstract boolean isRememberMe(); // to be used inside
onFormSubmit()
I dillied with @Component but the docs are partial and non-intuitive.
@Component(type = "Checkbox", id = "rememberMe", bindings = {
"value = ognl:rememberMe",
"displayName = message:label.rememberMe" })
public abstract Checkbox getRememberMe();
public abstract boolean isRememberMe();
// so far none of the above works
I am just looking for that boolean in my java ........ thats all.
2. Should I be modeling isRememberMe() or getRememberMe() ?
3. What are the specs on modeling the methods ... are they abstract or not?
Some clarification on this would be terrific.
Thanks in advance.
_________________________________________________________________
All-in-one security and maintenance for your PC. Get a free 90-day trial!
http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: CheckBox Implementation ... Tap-4.1.1 help please (thanks)
Posted by Peter Beshai <pb...@hotmail.com>.
Try this:
in .java file:
// the actual checkbox component
@Component(bindings =
{"value=rememberMe","displayName=message:label.rememberMe"})
public abstract Checkbox getRememberMeCheckbox();
// holds the value of the checkbox
public abstract boolean getRememberMe()
in .html file:
<td>
<span key="label.rememberMe"/><input jwcid="rememberMeCheckbox"/>
</td>
note: you could use
<td>
<span jwcid="@FieldLabel" field="ognl:rememberMeCheckbox" />><input
jwcid="rememberMeCheckbox"/>
</td>
but I have experienced some problems when using checkboxes with field labels
(https://issues.apache.org/jira/browse/TAPESTRY-1096), so you may want to
avoid it.
Hope this helps,
Peter Beshai
>From: "Ken nashua" <nh...@hotmail.com>
>Reply-To: "Tapestry users" <us...@tapestry.apache.org>
>To: users@tapestry.apache.org
>Subject: CheckBox Implementation ... Tap-4.1.1 help please (thanks)
>Date: Wed, 18 Oct 2006 14:10:25 -0400
>
>Guys,
>
>Ok, I am going to try the @Checkbox component.... inside some html
>
>Typical usage follows...
>
><td>
> <span jwcid="@Insert" value="message:label.rememberMe"/>
> <input jwcid="rememberMe@Checkbox" value="ognl:rememberMe"/>
></td>
>
>Now I do not want to operate any *.Page files (although an alternative
>sample would be nice to refer to)
>
>I want to do everything in JAVA... period
>
>1. Can someone provide an example of how to GET this boolean property into
>the JAVA onFormSubmit() method?
>
>Why isn't there just an @Property(id="rememberMe" type="boolean")
>annotation
>
> Ideally it wuold be nice if this existed
>
> @Property(id="rememberMe" type="boolean")
> public abstract boolean isRememberMe(); // to be used inside
>onFormSubmit()
>
>
> I dillied with @Component but the docs are partial and non-intuitive.
>
> @Component(type = "Checkbox", id = "rememberMe", bindings = {
> "value = ognl:rememberMe",
> "displayName = message:label.rememberMe" })
> public abstract Checkbox getRememberMe();
> public abstract boolean isRememberMe();
>
> // so far none of the above works
>
>I am just looking for that boolean in my java ........ thats all.
>
>2. Should I be modeling isRememberMe() or getRememberMe() ?
>
>3. What are the specs on modeling the methods ... are they abstract or not?
>
>Some clarification on this would be terrific.
>
>Thanks in advance.
>
>_________________________________________________________________
>All-in-one security and maintenance for your PC. Get a free 90-day trial!
>http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>For additional commands, e-mail: users-help@tapestry.apache.org
>
_________________________________________________________________
Découvrez Live Search de votre PC ou de votre appareil mobile dès
aujourdhui. http://www.live.com/?mkt=fr-ca
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org