HI Robert,

An if/else looks like this:

<t:if test="isMainSection"> <!-- no need for ${} in tapestry components -->
The if stuff
<t:parameter name="else">
the else stuff
</t:parameter>
</t:if>


Josh


On 10/4/07, Robert A. Decker <[EMAIL PROTECTED]> wrote:
>
> I kind of got around this by putting in my Layout.html:
>
> <t:if test="${isMainSection}">
>
> main
>
> </t:if>
>
> And in Layout.java:
>        public boolean getIsMainSection() {
>                return _parent.isMainSection();
>        }
>
>
> It's not ideal - it'd be better to be able to ask the _parent
> directly rather than going through Layout.java, but this works for
> now, until I learn Tapestry well enough to fix it up.
>
> Now I just need to figure out how to do the else...
>
> R
>
>
> On Oct 4, 2007, at 4:00 PM, Robert A. Decker wrote:
>
> > I'm getting an error:
> > "Could not find a coercion from type
> > com.pgp.licenseserver.pages.Main to type
> > com.pgp.licenseserver.pages._PGPLicenseServerPage. Available
> > coercions:..."
> >
> > But my Main.java extends _PGPLicenseServerPage and so there
> > shouldn't be any coercion necessary.
> >
> > And besides, why should it care what the type is? Can't it just
> > send it the message I'm trying to send and not care about the type?
> >
> >
> > I'm trying to add to the layout example component to give menu-item
> > links at the top of the page and if we're in a particular section
> > of the app have that link not be active, but the other links be
> > active. I do this by having the pages that belong in each section
> > implement an interface for that section. For example, my 'Main'
> > page has its own section:
> >
> > public class Main extends _PGPLicenseServerPage implements
> > _MainSection {...}
> >
> > And in my superclass:
> > public class _PGPLicenseServerPage {
> >       public boolean isMainSection() {
> >               return this instanceof _MainSection;
> >       }
> > }
> >
> > And so in my Layout.html I would like to do something like:
> >
> <t:if test="parent.isMainSection">
> >
> main
> >
> </t:if>
> >
> <t:else>
> >
> <a href="#">main</a>
> >
> </t:else>
> > (I don't think this is right - I haven't been able to find an
> > example of an if/else)
> >
> >
> > I've tried messing around with different ways of calling things but
> > I keep getting various exceptions... Any way to get this to work? I
> > do something like this all of the time in WebObjects and it's quite
> > easy.
> >
> > R
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Reply via email to