You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Liljenberg <pl...@gmail.com> on 2012/11/26 00:20:53 UTC

Getting the target Page of a Link from a Mixin

Hi, 

>From within a Mixin applied to a PageLink (or any other xxLink component), is it possible to get the target Page in some way?
The only way I've found so far is:

@InjectContainer 
private AbstractLink pageLink;
@Inject
private ComponentSource componentSource;


void afterRender(MarkupWriter writer) {
String pageName = pageLink.getLink().getBasePath().substring(1); 
Component page = componentSource.getPage(pageName);
}


And that feels just plain bad is no many ways :)

/Peter


Re: kaptcha

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 26.11.2012 15:03, John wrote:

> please share opinions on the best Tapestry Kaptcha solution please,
> i.e. easiest to integrate and simple to use - I believe there is more
> than 1 choice

Hi John,

please do not start a new thread by replying to an existing message and
changing the subject. Instead, please write a new e-mail. Thanks.

About your question: We use the kaptcha component integrated in
Tapestry:

http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/kaptcha/components/package-summary.html

Example code:

<t:kaptchaimage t:id="captchaImage"/>
<br/>
<t:kaptchafield label="Security Check" t:id="captchaField"
image="captchaImage" t:visible="true"/>

HTH
 Stephan


kaptcha

Posted by John <jo...@quivinco.com>.
please share opinions on the best Tapestry Kaptcha solution please, i.e. easiest to integrate and simple to use - I believe there is more than 1 choice

TIA

Re: Getting the target Page of a Link from a Mixin

Posted by pliljenberg <pl...@gmail.com>.
Thanks.

Worked like a charm!

Regards,
Peter



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718283.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Getting the target Page of a Link from a Mixin

Posted by Peter Liljenberg <pl...@gmail.com>.
True - maybe I'll do that instead, just subclassing PageLink and adding my custom behaviour.

/Peter


On Tuesday, November 27, 2012 at 06:55 , Howard Lewis Ship wrote:

> Instead of a mixin on PageLink, I would just write a custom component. What
> PageLink does is quite straightforward.
> 
> On Monday, November 26, 2012, Lance Java wrote:
> 
> > Use declare a field in your mixin with the @BindParameter annotation and
> > tapestry will mirror the parameter from the component to your mixin. Any
> > updates you make to the field will update the underlying field.
> > 
> > Note that updates to @BindParameter fields will only work for "prop:"
> > bindings. Parameters that are bound to "literal:" or "message:" etc are
> > read-only.
> > 
> > 
> > http://tapestry.apache.org/component-mixins.html#ComponentMixins-Bindingtheparameterofthecorecomponent
> > 
> > 
> > 
> > --
> > View this message in context:
> > http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718276.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com (http://Nabble.com).
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org (mailto:users-unsubscribe@tapestry.apache.org)<javascript:;>
> > For additional commands, e-mail: users-help@tapestry.apache.org (mailto:users-help@tapestry.apache.org)<javascript:;>
> > 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> 



Re: Getting the target Page of a Link from a Mixin

Posted by Howard Lewis Ship <hl...@gmail.com>.
Instead of a mixin on PageLink, I would just write a custom component. What
PageLink does is quite straightforward.

On Monday, November 26, 2012, Lance Java wrote:

> Use declare a field in your mixin with the @BindParameter annotation and
> tapestry will mirror the parameter from the component to your mixin. Any
> updates you make to the field will update the underlying field.
>
> Note that updates to @BindParameter fields will only work for "prop:"
> bindings. Parameters that are bound to "literal:" or "message:" etc are
> read-only.
>
>
> http://tapestry.apache.org/component-mixins.html#ComponentMixins-Bindingtheparameterofthecorecomponent
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718276.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org<javascript:;>
> For additional commands, e-mail: users-help@tapestry.apache.org<javascript:;>
>
>

-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Re: Getting the target Page of a Link from a Mixin

Posted by Lance Java <la...@googlemail.com>.
Use declare a field in your mixin with the @BindParameter annotation and
tapestry will mirror the parameter from the component to your mixin. Any
updates you make to the field will update the underlying field.

Note that updates to @BindParameter fields will only work for "prop:"
bindings. Parameters that are bound to "literal:" or "message:" etc are
read-only.

http://tapestry.apache.org/component-mixins.html#ComponentMixins-Bindingtheparameterofthecorecomponent



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718276.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org