You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Mark Dimon <ma...@btinternet.com> on 2002/11/12 03:54:22 UTC

[Jelly] bug's in gridBagDemo.jelly

Hi ,

The way combo's are set up in gridBagDemo does not apear  to work , a cut
down example:

<j:jelly xmlns:j="jelly:core" xmlns="jelly:swing">
    <frame title="Combo Test" var="frame" size="400,200">
        <panel>
            <comboBox name="c" var="c">
                ${c.addItem("this is combo 1")}
            </comboBox>
            <comboBox name="c" var="c">
                ${c.addItem("this is combo 2")}
            </comboBox>
        </panel>
    </frame>
    ${frame.show()}
</j:jelly>

The first combo displays "this is combo2" and the second nothing !

However , moving the assigment out of the combo tag works :

<j:jelly xmlns:j="jelly:core" xmlns="jelly:swing">
    <frame title="Combo Test" var="frame" size="400,200">
        <panel>
            <comboBox name="c" var="c">
            </comboBox>
                ${c.addItem("this is combo 1")}
            <comboBox name="c" var="c">
            </comboBox>
                ${c.addItem("this is combo 2")}
        </panel>
    </frame>
    ${frame.show()}
</j:jelly>

Is this a bug , or error in gridBagDemo.jelly and should we be setting vars
from within the same tag that defines it ?

Regards mark.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Jelly] bug's in gridBagDemo.jelly

Posted by James Strachan <ja...@yahoo.co.uk>.
Hi Mark

From: "Mark Dimon" <ma...@btinternet.com>
> Hi ,
>
> The way combo's are set up in gridBagDemo does not apear  to work , a cut
> down example:
>
> <j:jelly xmlns:j="jelly:core" xmlns="jelly:swing">
>     <frame title="Combo Test" var="frame" size="400,200">
>         <panel>
>             <comboBox name="c" var="c">
>                 ${c.addItem("this is combo 1")}
>             </comboBox>
>             <comboBox name="c" var="c">
>                 ${c.addItem("this is combo 2")}
>             </comboBox>
>         </panel>
>     </frame>
>     ${frame.show()}
> </j:jelly>
>
> The first combo displays "this is combo2" and the second nothing !
>
> However , moving the assigment out of the combo tag works :
>
> <j:jelly xmlns:j="jelly:core" xmlns="jelly:swing">
>     <frame title="Combo Test" var="frame" size="400,200">
>         <panel>
>             <comboBox name="c" var="c">
>             </comboBox>
>                 ${c.addItem("this is combo 1")}
>             <comboBox name="c" var="c">
>             </comboBox>
>                 ${c.addItem("this is combo 2")}
>         </panel>
>     </frame>
>     ${frame.show()}
> </j:jelly>
>
> Is this a bug , or error in gridBagDemo.jelly and should we be setting
vars
> from within the same tag that defines it ?

You're correct. Its a bug. The 'c' variable does not exist until after the
entire <comboBox> tag has executed.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>