You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Geoff Longman <gl...@intelligentworks.com> on 2003/01/26 17:21:35 UTC

2.4 Anonymous Component question

Starting the thinking required to support 2.4 in Spindle.

Perusing the wiki I see that anonymous components are written in the HTML thus:

<span jwcid="@Conditional" condition="[[ someTrigger]]"> ... </span>

So am I correct to assume that the wiki us up to date and this is the *only* way to write these? (i.e. all in the start tag as attributes)

I ask as its simpler to parse the the templates if this is the case.

Also from the wiki, jwcid's are allowed to look like this:
  a.. @Conditional 
  b.. @Body 
  c.. @contrib:Palette 
  d.. foreach:@Foreach 
Whats the deal with the colon in the last example? Is this a typo?

Geoff

Re: 2.4 Anonymous Component question

Posted by Geoff Longman <gl...@intelligentworks.com>.
> HLS: You poor, deluded soul!  I haven't made it easy for you.  Hope you
like
> a challenge!

Unless I've completely off base the hardest part will be the new liberal
allowances for template location. I'm deliberately avoiding this for now ;-)

Assuming the above is resolved, handling the anonymous components will
actually be fun.

I'm figuring out a way where Spindle can represent the anon comps in the
spec editor (denoted by different icons I guess).

That way one will be able to do the following in a mixed spec comp/anon comp
environment:

1. edit the bindings for anon comps in the Spec editor - changes pushed to
the template source
2. Pull an anonymous comp out of the template and insert it in the spec
(naming it if the template component is truly anonymous)
3. Push a spec comp over to the template and make it implict/anonymous

Also, will need to improve the validation/error handling to include
definitions from both sources.

Which brings up another point...

Would it be hard to change the Tapestry parser (or make it easy to extend)
so that the following is possible?

Would be cool if the 'fatal-ness' of a error  was configurable. It would be
useful to Spindle if I could set a switch or something so that a parse would
go to completion unless a true fatal error (like not being well-formed)
occurred. Some mechanism where I can collect the errors and then create
error markers. Thus, in the example of validation, there will be error
markers for all the validation problems and not just the first. Of course if
an error did occur I would ignore the parsers result object.

Also, would be nice to get line/column info for errors generated by tapestry
code. (this one is probably harder).


Last on my list for 2.4 support (the very last) is thinking about adding a
page to the spec editor that contains the template source.
This would be the very hardest thing to accomplish. Much harder than the
template location thing.

Finally,  from the wiki:
http://tapestry.sourceforge.net/wiki/index.php/TapestryLite

"A page template had an addtional directive to indicate the page class to
instantiate"

What's the format of this directive?

Geoff

>
> Perusing the wiki I see that anonymous components are written in the HTML
> thus:
>
> <span jwcid="@Conditional" condition="[[ someTrigger]]"> ... </span>
>
> HLS:  Yes, for implicit components (which may or may not be anonymous),
it's
> all in the HTML template and nothing in the page/component spec.  For
> declared (i.e., traditional) components, you can have some in the spec,
some
> in the HTML (as always, except that you can use the expression syntax in
the
> HTML template now).
>
> So am I correct to assume that the wiki us up to date and this is the
*only*
> way to write these? (i.e. all in the start tag as attributes)
>
> I ask as its simpler to parse the the templates if this is the case.
>
> Also from the wiki, jwcid's are allowed to look like this:
>   a.. @Conditional
>   b.. @Body
>   c.. @contrib:Palette
>   d.. foreach:@Foreach
> Whats the deal with the colon in the last example? Is this a typo?
>
> HLS: Yes, MB convinced me to drop the colon, so that should be
> foreach@Foreach, or palette@contrib:Palette.
>
> Geoff
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


Re: 2.4 Anonymous Component question

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
----- Original Message -----
From: "Geoff Longman" <gl...@intelligentworks.com>
To: "Tapestry development" <ta...@jakarta.apache.org>
Sent: Sunday, January 26, 2003 11:21 AM
Subject: 2.4 Anonymous Component question


Starting the thinking required to support 2.4 in Spindle.

HLS: You poor, deluded soul!  I haven't made it easy for you.  Hope you like
a challenge!

Perusing the wiki I see that anonymous components are written in the HTML
thus:

<span jwcid="@Conditional" condition="[[ someTrigger]]"> ... </span>

HLS:  Yes, for implicit components (which may or may not be anonymous), it's
all in the HTML template and nothing in the page/component spec.  For
declared (i.e., traditional) components, you can have some in the spec, some
in the HTML (as always, except that you can use the expression syntax in the
HTML template now).

So am I correct to assume that the wiki us up to date and this is the *only*
way to write these? (i.e. all in the start tag as attributes)

I ask as its simpler to parse the the templates if this is the case.

Also from the wiki, jwcid's are allowed to look like this:
  a.. @Conditional
  b.. @Body
  c.. @contrib:Palette
  d.. foreach:@Foreach
Whats the deal with the colon in the last example? Is this a typo?

HLS: Yes, MB convinced me to drop the colon, so that should be
foreach@Foreach, or palette@contrib:Palette.

Geoff