You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolas Maisonneuve <n....@hotPop.com> on 2003/10/28 14:42:27 UTC

flowscript access to a widget in a repeater

hy,
my model is :
<wd:field id="index">
    <wd:label>Index :</wd:label>
    <wd:datatype base="string"/>
    <wd:selection-list src="cocoon:/list?list=index" dynamic="true"/>

    <wd:on-value-changed>
        <javascript>
         var value = event.source.value;
         /* var searchwidget= something to access to my searchwidget in the repeater  */
         searchwidget.setSelectionList("cocoon:/list?list=search&amp;index=" + value);
       </javascript>
    </wd:on-value-changed>

 </wd:field>

 <wd:repeater id="transform">

  <wd:field id="search" required="true">
      <wd:label>Search field:</wd:label>
      <wd:datatype base="string"/>
      <wd:selection-list/>
   </wd:field>
 </wd:repeater>

how acess to my searchfield ? 

Re: flowscript access to a widget in a repeater

Posted by Nicolas Maisonneuve <n....@hotpop.com>.
thank you !
----- Original Message ----- 
From: "Olivier Billard" <ob...@rennes.jouve.fr>
To: <us...@cocoon.apache.org>
Sent: Tuesday, October 28, 2003 3:28 PM
Subject: Re: flowscript access to a widget in a repeater


> Hi Nicolas !
>
> The following code should work, to browse your
>
> Repeater transform = (Repeater)form.getWidget().getWidget("transform");
> for (var i=0 ; i<transform.getSize() ; i++) {
>      Field searchField = (Field) transform.getWidget(i, "search");
> ... do something with your widget...
> }
>
> --
> Olivier Billard
>
> On 28/10/2003 14:42, Nicolas Maisonneuve wrote:
>
> > hy,
> > my model is :
> > <wd:field id="index">
> >     <wd:label>Index :</wd:label>
> >     <wd:datatype base="string"/>
> >     <wd:selection-list src="cocoon:/list?list=index" dynamic="true"/>
> >     <wd:on-value-changed>
> >         <javascript>
> >         var value = event.source.value;
> >          /* var searchwidget= something to access to my searchwidget in
> > the repeater  */
> >
> > searchwidget.setSelectionList("cocoon:/list?list=search&amp;index=" +
> > value);
> >        </javascript>
> >     </wd:on-value-changed>
> >
> >  </wd:field>
> >
> >  <wd:repeater id="transform">
> >
> >   <wd:field id="search" required="true">
> >       <wd:label>Search field:</wd:label>
> >       <wd:datatype base="string"/>
> >       <wd:selection-list/>
> >    </wd:field>
> >  </wd:repeater>
> >
> > how acess to my searchfield ?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>



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


Re: flowscript access to a widget in a repeater

Posted by Olivier Billard <ob...@rennes.jouve.fr>.

On 29/10/2003 09:07, Bruno Dumon wrote:

> On Tue, 2003-10-28 at 15:28, Olivier Billard wrote:
> 
>>Hi Nicolas !
>>
>>The following code should work, to browse your
>>
>>Repeater transform = (Repeater)form.getWidget().getWidget("transform");
>>for (var i=0 ; i<transform.getSize() ; i++) {
>>     Field searchField = (Field) transform.getWidget(i, "search");
>>... do something with your widget...
>>}
> 
> 
> the above looks like a mix of Java and Javascript code (var in Java?
> typecasts in Javascript?).

It was for flowscript access. You're right, this code was quickly wrote and needed a 
review, (Field -> var, Repeater -> var), but it was to give an overview on how to do this.
I think Nicolas translated it by himself :).

--
Olivier


>>
>>On 28/10/2003 14:42, Nicolas Maisonneuve wrote:
>>
>>
>>>hy,
>>>my model is :
>>><wd:field id="index">
>>>    <wd:label>Index :</wd:label>
>>>    <wd:datatype base="string"/>
>>>    <wd:selection-list src="cocoon:/list?list=index" dynamic="true"/>
>>>    <wd:on-value-changed>
>>>        <javascript>
>>>        var value = event.source.value;
>>>         /* var searchwidget= something to access to my searchwidget in 
>>>the repeater  */
>>>         
>>>searchwidget.setSelectionList("cocoon:/list?list=search&amp;index=" + 
>>>value);
>>>       </javascript>
>>>    </wd:on-value-changed>
>>> 
>>> </wd:field>
>>> 
>>> <wd:repeater id="transform">
>>> 
>>>  <wd:field id="search" required="true">
>>>      <wd:label>Search field:</wd:label>
>>>      <wd:datatype base="string"/>
>>>      <wd:selection-list/>
>>>   </wd:field>
>>> </wd:repeater>
>>> 
>>>how acess to my searchfield ?
>>
> 

-- 

-- 
Olivier BILLARD



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


Re: flowscript access to a widget in a repeater

Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-10-28 at 15:28, Olivier Billard wrote:
> Hi Nicolas !
> 
> The following code should work, to browse your
> 
> Repeater transform = (Repeater)form.getWidget().getWidget("transform");
> for (var i=0 ; i<transform.getSize() ; i++) {
>      Field searchField = (Field) transform.getWidget(i, "search");
> ... do something with your widget...
> }

the above looks like a mix of Java and Javascript code (var in Java?
typecasts in Javascript?).

If it's flowscript you're using, have a look at woody_flow_example.js
for a more Javascript-like way of doing it:

var model = form.getModel();
var value = model.transform[0].search;

> 
> --
> Olivier Billard
> 
> On 28/10/2003 14:42, Nicolas Maisonneuve wrote:
> 
> > hy,
> > my model is :
> > <wd:field id="index">
> >     <wd:label>Index :</wd:label>
> >     <wd:datatype base="string"/>
> >     <wd:selection-list src="cocoon:/list?list=index" dynamic="true"/>
> >     <wd:on-value-changed>
> >         <javascript>
> >         var value = event.source.value;
> >          /* var searchwidget= something to access to my searchwidget in 
> > the repeater  */
> >          
> > searchwidget.setSelectionList("cocoon:/list?list=search&amp;index=" + 
> > value);
> >        </javascript>
> >     </wd:on-value-changed>
> >  
> >  </wd:field>
> >  
> >  <wd:repeater id="transform">
> >  
> >   <wd:field id="search" required="true">
> >       <wd:label>Search field:</wd:label>
> >       <wd:datatype base="string"/>
> >       <wd:selection-list/>
> >    </wd:field>
> >  </wd:repeater>
> >  
> > how acess to my searchfield ?
> 

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: flowscript access to a widget in a repeater

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
Hi Nicolas !

The following code should work, to browse your

Repeater transform = (Repeater)form.getWidget().getWidget("transform");
for (var i=0 ; i<transform.getSize() ; i++) {
     Field searchField = (Field) transform.getWidget(i, "search");
... do something with your widget...
}

--
Olivier Billard

On 28/10/2003 14:42, Nicolas Maisonneuve wrote:

> hy,
> my model is :
> <wd:field id="index">
>     <wd:label>Index :</wd:label>
>     <wd:datatype base="string"/>
>     <wd:selection-list src="cocoon:/list?list=index" dynamic="true"/>
>     <wd:on-value-changed>
>         <javascript>
>         var value = event.source.value;
>          /* var searchwidget= something to access to my searchwidget in 
> the repeater  */
>          
> searchwidget.setSelectionList("cocoon:/list?list=search&amp;index=" + 
> value);
>        </javascript>
>     </wd:on-value-changed>
>  
>  </wd:field>
>  
>  <wd:repeater id="transform">
>  
>   <wd:field id="search" required="true">
>       <wd:label>Search field:</wd:label>
>       <wd:datatype base="string"/>
>       <wd:selection-list/>
>    </wd:field>
>  </wd:repeater>
>  
> how acess to my searchfield ?



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