Thanks Ryan. I tried using more correct html but I still got the same parsing
error:
Closing tag /li on line 28 is improperly nested with tag span on line 27.
So I don't know of a way to put the closing tags in an If component.
And if I try to put the tags in the bindings, I get a different parse error:
component id=insertUlTag type=Insertbinding name=value
value='ul'/binding name=raw value=true/
/component
Unable to read context:/WEB-INF/MyDiscussion.page: The value of attribute
value associated with an element type binding must not contain the ''
character.
So, I guess using a custom library of open and close tags may just be the best
way to go.
Date: Sun, 11 Jun 2006 11:55:45 -0700 From: [EMAIL PROTECTED] To:
users@tapestry.apache.org Subject: Re: conditional and nested ul and li
tags First, you can't nest UL tags outside of LI tags. I'm sure most
browsers will render it correctly, but a more strict parser (like the
Tapestry page parser) will choke on it. Your HTML structure needs to be:
ul liPost 1/li liPost 2ul liPost 2,
Reply A/li liPost 2, Reply B ul
liPost 2, Reply B, Reply i/li liPost 2,
Reply B, Reply ii/li /ul /li
liPost 2, Reply C/li/ul /liliPost 3/li /ul
Second, in page and component specifications, binding values are assumed
to be OGNL calls unless you specify a prefix (unlike templates, where
values are assumed to be literal strings unless there is a prefix). So
there are two ways to fix your Insert component: component
id=insertUlTag type=Insert binding name=value value='ul'/
binding name=raw value=true/ /component -- or -- component
id=insertUlTag type=Insert binding name=value
value=literal:ul/ binding name=raw value=true/ /component
Note that the raw parameter is required to prevent Tapestry from escaping
the HTML. Last, you're probably looking for a recursive DisplayReplies
component to walk the tree of replies and created nested UL's and LI's as
needed. That's a little difficult to do in Tapestry because you can't
create simple recursive components. In other words, you can't easily render
(conditionally or otherwise) a component inside of itself without a
getting a stack overflow exception. You have to use a trick involving Block
and RenderBlock to get recursive behavior. If you're interested, I can post
a tiny Tapestry app that demonstrates how to do this. It uses articles
and comments rather than posts and replies, but it is a stripped down
demo with one page and one component demonstrating what I think you are
trying to do and nothing more (and it uses UL and LI tags). -Ryan
[EMAIL PROTECTED] wrote: I am trying to set up a page that has comments
listed in a big list surrounded by ul tags. Under certains conditions, I want
to nest more ul tags. Like this:ullithis is post 1/lilithis
is post 2/liullithis is reply to post 2/li
lithis is another reply to post 2/lilithis it yet an additional
reply/liulliAnd this is a reply to the one
above/li/ulliThe last reply to post 2/li/ul
lithis is post 3/li/ulHowever, I run into problem in Tapestry when I
try to do something like this:span jwcid=ifSomething
/ul/spanTapestry complains that I am improperly nesting a /ul tag
inside a span. One way I thought of getting arround this was to use an Insert
so that the html would be:span jwcid=ifSomethingspan
jwcid=insertUlTag//spanWhich sort of worked until I go to the page
descriptor and I couldn't figure out how to put ul in the
binding:component id=insertUlTag type=Insertbinding
name=value value=ul/ /componentThe parser complained and
using CDATA didn't help. So I ended up making a getUlOpenTag method on the
java file for the page which return ul so then I had this:component
id=insertUlOpenTag type=Insertbinding name=value
value=ulOpenTag/ binding name=raw value=true/
/componentand that worked.But is there not an easier way? I actually ended
up creating a new library that just had open and close HTML tags just for
instances like this.Thanks
_ Express
yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
- To
unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
[EMAIL PROTECTED]
_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/