any luck with this issue?

After some discussions and experimentation with a colleague of mine, it
appears that there is only one component.  that's the nature of the For
loop.   We did this in the listener on the page:

       Map comps = this.getComponents();
       Set keyMap = comps.keySet();
       for (Iterator iter = keyMap.iterator(); iter.hasNext();) {
           System.out.println( comps.get(iter.next()));

       }

Hence, if a For loop iterates over 'n' elements and writes out a
@Util:TabGroup, there is just one component @Util:TabGroup.

I suppose what it means is that for you to iterate over your list and
control the maximize/minimize stuff, you'll have to have this as an
attribute in the For loop's List, and accordingly use some client side
scripting to handle maximize/minimize.

Unless there is an attribute of the For loop that forces generation of one
@Util:TabGroup for every iteration.  If there is some such parameter, I am
not aware of it ....

Good luck.


On 8/4/06, Reto Hotz <[EMAIL PROTECTED]> wrote:

The TabGroup has a @DirectLink to change the state: minimized/maximized.

Home.html :
<span jwcid="@For" source="ognl:items" value="ognl:item">
  <span jwcid="@Util:TabGroup" title="ognl:item.name"/>
</span>


TabGroup.html:
<span jwcid="@If" condition="ognl:!minimized">
  <a jwcid="@DirectLink" parameters="ognl:minimized"
listener="ognl:listeners.lnkActionToggleGroup ">
    <span jwcid="@Insert" value="ognl:title"/>
  </a>
</span>

TabGroup.jwc:
<component-specification class="TabGroup" allow-body="yes"
allow-informal-parameters="no">
  <parameter name="title" required="yes" cache="false"/>
</component-specification>

TabGroup.java:
public abstract class TabGroup extends BaseComponent implements
PageAttachListener, IFormComponent {

    public abstract String getTitle();

    @Persist("client")
    public abstract boolean getMinimized();

    public void lnkActionToggleGroup(boolean minimized) {
        setMinimized(!minimized);
    }
    ...
}


For example if I create 2 TabGroups *without* the @For loop they are
rendered like this:
$TabGroup
$TabGroup_0

But if I create them *with* the @For loop, I get the component twice:
$TabGroup
$TabGroup

--> both are the same component and thus if I click on the DirectLink
of the first component, the second gets minimized too.

Greetings
Reto

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thanks, Karthik

Reply via email to