You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Wojtek Ciesielski <cc...@interia.pl> on 2007/05/05 11:43:20 UTC

[T4.1] FOR-based components rendered nested WITHIN themselves

Hi all,

I have a following problem with rendering components in T4.1...

On a page I have following code:

<div jwcid="typesIterator" class="ognl:multiTyped?'typeDiv':''">
    <div jwcid="@If" condition="ognl:multiTyped" renderTag="literal:false">  
      <div jwcid="@SummaryBar"
        allCount="literal:5"
        newCount="literal:0"
        linkCssClass=""
        label="ognl:currentItemType"
        linkId="ognl:id">Here comes bar with type and idicators </div>    
    </div>
  
    <div jwcid="itemList">
      <div jwcid="expandableItem">
        Item
      </div>
    </div> 

</div>


iterators are defined in a .jwc file like this:

<!-- data input. Parent component should provide array of ItemType objects here -->
	<parameter name="typesList" required="yes" />

	<!-- Main iterator over types -->
	<component id="typesIterator" type="For">		
		<binding name="source" value="ognl:typesList" />
		<binding name="value" value="ognl:currentItemType" />
	</component>
	
	<!-- iterator over items (summaries) for a given type -->
	<component id="itemList" type="For">		
		<binding name="source" value="ognl:summariesForType" />
		<binding name="value" value="ognl:currentSummary" />
		<binding name="renderTag" value="literal:false" />
	</component>
	
	<!-- used by iterator over summaries within particular type -->
	<property name="currentSummary" />
	
	<!-- Component providing filtering widgets (list-boxes) -->	
	<component id="approvedViewFilter" type="ViewFilteringPanel" />


	
	
	
	<component id="expandableItem" type="ExpandableItem">
	... my component specs ...
 </component>

The problem is, that tags rendered by top-level typesIterator @For-based 
components are NESTED within each other! I am getting HTML code like 
this (when there are three types to iterate on):

<div class="typeDiv" id="typesIterator">
  <div class="typeDiv" id="typesIterator_0">
    <div class="typeDiv" id="typesIterator_1">
    </div>
  </div>
</div>

instead of expected:

<div class="typeDiv" id="typesIterator">
</div>
<div class="typeDiv" id="typesIterator_0">
</div>
<div class="typeDiv" id="typesIterator_1">
</div>

It is workin as expected only when no components at all are inserted 
into iterator:

<div jwcid="typesIterator" class="ognl:multiTyped?'typeDiv':''">
    Plain text works fine
</div>

but if I put any of components inside like this:

<div jwcid="typesIterator" class="ognl:multiTyped?'typeDiv':''">
    <div jwcid="@If" condition="ognl:multiTyped" renderTag="literal:false">  
      <div jwcid="@SummaryBar"
        allCount="literal:5"
        newCount="literal:0"
        linkCssClass=""
        label="ognl:currentItemType"
        linkId="ognl:id">Here comes bar with type and idicators </div>    
    </div>
  
    item list removed

</div>

or like this:

<div jwcid="typesIterator" class="ognl:multiTyped?'typeDiv':''">

    summary title bar removed/replaced with plain text/html
  
    <div jwcid="itemList">
      <div jwcid="expandableItem">
        Item
      </div>
    </div> 

</div>

it's being rendered nested. What am I doing wrong??

With regards,
Wojtek
 

 



Re: [T4.1] FOR-based components rendered nested WITHIN themselves

Posted by Wojtek Ciesielski <cc...@interia.pl>.
I've solved it...

The problem was, that within my @SummaryBar component there was a DIV 
like this:

<div jwcid="@Any" class="ognl:getClass"></div>


And @Any component attached to the DIV tag with empty contents was 
breaking enclosing @For iterators...


> Hi all,
> 
> I have a following problem with rendering components in T4.1...
> 
> On a page I have following code:
> 
> <div jwcid="typesIterator" class="ognl:multiTyped?'typeDiv':''">
>    <div jwcid="@If" condition="ognl:multiTyped" 
> renderTag="literal:false">       <div jwcid="@SummaryBar"
>        allCount="literal:5"
>        newCount="literal:0"
>        linkCssClass=""
>        label="ognl:currentItemType"
>        linkId="ognl:id">Here comes bar with type and idicators </div>    
>    </div>
>  
>    <div jwcid="itemList">
>      <div jwcid="expandableItem">
>        Item
>      </div>
>    </div>
> </div>
> 


----------------------------------------------------------------------
Kasia Cichopek eksponuje biust  
>>> http://link.interia.pl/f1a6f


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org