Hi everyone,
I am trying to produce the following HTML, where the path to the image for
both the onMouseOver event and the <img> tag needs to be dynamically
generated. The image may be different everytime.
<a href="javascript:;"
onMouseOver="MM_swapImage('enlargeview','','assets/images/lightview1.jpg',1)
" onMouseOut="MM_swapImgRestore()">
<img src="assets/images/lightview1.jpg" width="136" border="0">
</a>
So, I tried to use the @Any tags in both the <a> and <img> tags as follows:
<a jwcid="lightView1" href="javascript:;"
onMouseOver="MM_swapImage('enlargeview','','assets/images/lightview1.jpg',1)
" onMouseOut="MM_swapImgRestore()">
<img jwcid="lightView1Image" src="assets/images/lightview1.jpg"
width="136" border="0">
</a>
where the component definitions are:
<component id="lightView1" type="Any">
<binding name="onMouseOver"
expression="'MM_swapImage(\'enlargeview\',\'\',\'' + scanId + '_01.jpg' +
'\',1)'"/>
<binding name="onMouseOut" expression="'MM_swapImgRestore()'"/>
</component>
<component id="lightView1Image" type="Any">
<binding name="src" expression="'/unreviewed/' + scanId + '_01.jpg'"/>
</component>
But Tapestry complains that "Closing tag </a> on line 157 is improperly
nested with tag <img> on line 156.
So, my question is, can the @Any component be nested? It also look likes
any other Tapestry component cannot be nested inside the @Any component. Am
I correct? I look everywhere for documentation on this (e.g. searching the
mailing list, Google, TIA book, etc) but no luck. This is what frustrates
me with Tapestry and why I think a lot of newbie complain about the learning
curve. This example HTML snippet should be simple to create, but it is
taking me hours now to figure out how to do this with Tapestry.
Thanks in advance for any help,
Ben Wong