Hi!
@Inject
private ComponentResources resources;
...
// getting the child component instance ids
List<String> embeddedIds =
resources.getComponentModel().getEmbeddedComponentIds();
for (String id : embeddedIds) {
// get the component instance
Component component = resources.getEmbeddedComponent(id);
if (component instanceof Tabs == false) {
throw new TapestryException("Your message here");
}
}
On Tue, 16 Sep 2014 10:45:59 -0300, Sumanth <roasteddra...@gmail.com>
wrote:
Hi all,
I wanted to know how can we make a component restrictive within an
another
component.
As the best example for my situation here would be the jumpstart's tabs
component.
http://jumpstart.doublenegative.com.au/jumpstart7/examples/navigation/tabs
.
We have a
<t:tabgroup>
<t:sourcecodetab
src="/web/src/main/java/jumpstart/web/pages/examples/navigation/Tabs.tml"/>
</t:tabgroup>
and I want to make a restriction saying that a tabgroup should contain
only
<t:tabs>.
for example if I put <t:somethingelse></t:somethingelse> inside the
<t:tabgroup> then i want an exception to be thrown saying
<t:somethingelse> is not an instanceof tab.
how do I make a check from the <t:tabgroup> that it contains instances of
tab only and nothing else as beforeRender of the tabgroup we render the
tabs into tracker and then comeback to tabgroup to render it from tracker
to tml.
I have seen the tapestry stich tabgroup example where we can chech from
the
child component whether it is under <t:tabgroup> component if not throw
exception.
http://tapestry-stitch.uklance.cloudbees.net/tabgroupdemo
How to do it the other way round?
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org