You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by oceatoon <t....@systheo.com> on 2004/08/02 17:21:06 UTC

Flow : Accessing Repeater Rows value in Flow

Hi  

I found a post "POPUALTING SELECTIONLISTS INA REPEATER FROM FLOW " where a
similar question was asked but I can't seem to get Joergs technique(getRow
before getting the value) to function. 

my repeater only contains an upload widget (minimum one so Row(0) allways
exists, with add and delete). Then in my Flow, I need to retreive the value
of the uploaded file from the widget to move it around.

wid = handleForm("masterform", "forms/", document);

//I'd like to retreive the value 
wid.houseuploads.getRow(0).getValue();

 But this doesn't seem to work???? allways returns "null"
Also, do I have run through the whole repeater or is there a size or length
method associated to now how many entries have been submitted?
Thanks for the help.

Tibor 



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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
Joerg Heinicke wrote:

> On 04.08.2004 01:18, oceatoon wrote:
> 
>> I still get a result null
>> form.getWidget().houseuploads.getRow(0).getChild("path").value
>> => returns null ("path" being my upload widget)
>> and the field widget in the same repeater returns its content ???
>> 
>> Another funny reaction is when I add an element to the repeater,all the
>> previously existent rows erase their upload widgets content and have to
>> be newly filled ???
>> 
>> The other problem I have, is the form.getWidget().houseuploads.size just
>> like in the form1 sample doesn't seem to work either ???
> 
> Something must be wrong ;-)
> 
> Can you post your form definition of the repeater and the flow script
> code where you do the tests?
> 
> Joerg
I am terribly sorry for having disturbed you for not much.  I found Stephan
Delort's problem salvation after I send the last post, The problem was I
forgot to put the enctype="multipart-data " .
Great thanks for the help though.

Tibor 


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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
You say right, something must be wrong :)

************************************
Here's My Form definition:
************************************
  <!--***********House uploads**************** -->
        <fd:repeater id="houseuploads" initial-size="1">
            <fd:widgets>

                <fd:output id="idhouseupload">
                    <fd:datatype base="long"/>
                </fd:output>

                <fd:booleanfield id="select">
                    <fd:label>Select</fd:label>
                </fd:booleanfield>

                <fd:upload id="path">
                    <fd:label>
                        <i18n:text key="yourpicture">Your
picture(optional,png, jpg, or gif)</i18n:text>
                    </fd:label>
                    <fd:help>
                        <i18n:text key="yourpicture.help">This picture will
be presented on your house presentation</i18n:text>
                    </fd:help>
                    <fd:hint>
                        <i18n:text key="yourpicture.help"/>
                    </fd:hint>
                </fd:upload>

                <fd:field id="houseuploaddesc">
                    <fd:label>
                        <i18n:text key="desc">Description</i18n:text>
                    </fd:label>
                    <fd:datatype base="string"/>

                </fd:field>
            </fd:widgets>
        </fd:repeater>

        <!-- buttons to add an element in the bed repeater -->
        <fd:repeater-action id="addhouseupload" action-command="add-row"
repeater="houseuploads">
            <fd:label><i18n:text key="addpicture">Add a
Picture</i18n:text></fd:label>
        </fd:repeater-action>

        <fd:repeater-action id="removehouseupload"
action-command="delete-rows"
            repeater="houseuploads" select="select">
            <fd:label><i18n:text key="delpicture">Remove selected
pictures</i18n:text> </fd:label>
        </fd:repeater-action>

*********************************
Here' the Flow:
**********************************
var formDef = "forms/searchform_model.xml";
var form = new Form(formDef);
    
var wid = form.getWidget();
                        
cocoon.log.error("houseuploads widget
definition :"+wid.houseuploads.getRow(0).getChild("houseuploaddesc").value); 
//returns its content 

cocoon.log.error("houseuploads widget definition :
"+wid.houseuploads.getRow(0).getChild("path").value); //this returns null

   cocoon.log.error("houseuploads Size : "+wid.houseuploads.size);//returns
undefined

Thanks loads !!
Tibor





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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by Joerg Heinicke <jo...@gmx.de>.
On 04.08.2004 01:18, oceatoon wrote:

> I still get a result null 
> form.getWidget().houseuploads.getRow(0).getChild("path").value 
> => returns null ("path" being my upload widget)
> and the field widget in the same repeater returns its content ???
> 
> Another funny reaction is when I add an element to the repeater,all the
> previously existent rows erase their upload widgets content and have to be
> newly filled ???
> 
> The other problem I have, is the form.getWidget().houseuploads.size just
> like in the form1 sample doesn't seem to work either ???

Something must be wrong ;-)

Can you post your form definition of the repeater and the flow script 
code where you do the tests?

Joerg

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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
Hi Joerg 

I still get a result null 
form.getWidget().houseuploads.getRow(0).getChild("path").value 
=> returns null ("path" being my upload widget)
and the field widget in the same repeater returns its content ???

Another funny reaction is when I add an element to the repeater,all the
previously existent rows erase their upload widgets content and have to be
newly filled ???

The other problem I have, is the form.getWidget().houseuploads.size just
like in the form1 sample doesn't seem to work either ???

hope this sheds some light 
thanks for the help.
Tibor


Joerg Heinicke wrote:

> On 03.08.2004 21:41, oceatoon wrote:
> 
>> form.getWidget().repeaterName.getRow(0).widgetName.value (for row 0)
> 
> Can you try
> form.getWidget().repeaterName.getRow(0).getChild("widgetName").value
> instead? The upload widget itself should not behave different than a
> field widget, but maybe the JS wrapper is broken for it.
> 
> Joerg



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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by Joerg Heinicke <jo...@gmx.de>.
On 03.08.2004 21:41, oceatoon wrote:

> form.getWidget().repeaterName.getRow(0).widgetName.value (for row 0)

Can you try 
form.getWidget().repeaterName.getRow(0).getChild("widgetName").value 
instead? The upload widget itself should not behave different than a 
field widget, but maybe the JS wrapper is broken for it.

Joerg

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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
This is a Bug !!
The problem comes from the fact that the widget in my repeater is an upload
widget cause I tried adding a field widget and it works fine. otherwise the
way to access these fields are 
form.getWidget().repeaterName.getRow(0).widgetName.value (for row 0)

Doesn't change my needs, if anybody knows how I can extract this file name
from my repeater , I'd be more than gratefull...

Thanks 
Tibor

<posté comme article et comme courrier>

oceatoon wrote:

> Hi Bruno
> 
> I'm using V2 Form.js on Cocoon 2.2.0
> Thanks fo ryour help
> Tibor
> 
> Bruno Dumon wrote:
> 
>> Hi oceatoon,
>> 
>> On Tue, 2004-08-03 at 12:56, oceatoon wrote:
>>> Hi Bruno
>>> 
>>> Sorry for not being to clear,
>>> Yes, I'm in the Flow
>>> wid = form.getWidget();
>>> //"houseuploads" is my repeater
>>> //"path" would be the upload widget I want to retreive the content off
>>> wid.houseuploads.getRow(0).getValue();  (return = null)
>>> wid.houseuploads.getRow(0).path.getValue();  (also return = null)
>>> wid.houseuploads.getSize();  (return = null)
>>> 
>>> ???
>>> It's probably in the way I manipulate the repeater ???
>> 
>> I don't have enough information to give an exact answer. If you could
>> tell what Form.js you import and what Cocoon version you're using I
>> might be able to help.
>> 
>>> would you do this in the Java??
>> 
>> nope, with "Java API" I mean the native API of the widgets, which is
>> transparently available in javascript.
>>



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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
Hi Bruno

I'm using V2 Form.js on Cocoon 2.2.0 
Thanks fo ryour help
Tibor

Bruno Dumon wrote:

> Hi oceatoon,
> 
> On Tue, 2004-08-03 at 12:56, oceatoon wrote:
>> Hi Bruno
>> 
>> Sorry for not being to clear,
>> Yes, I'm in the Flow
>> wid = form.getWidget();
>> //"houseuploads" is my repeater
>> //"path" would be the upload widget I want to retreive the content off
>> wid.houseuploads.getRow(0).getValue();  (return = null)
>> wid.houseuploads.getRow(0).path.getValue();  (also return = null)
>> wid.houseuploads.getSize();  (return = null)
>> 
>> ???
>> It's probably in the way I manipulate the repeater ???
> 
> I don't have enough information to give an exact answer. If you could
> tell what Form.js you import and what Cocoon version you're using I
> might be able to help.
> 
>> would you do this in the Java??
> 
> nope, with "Java API" I mean the native API of the widgets, which is
> transparently available in javascript.
> 



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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by Bruno Dumon <br...@outerthought.org>.
Hi oceatoon,

On Tue, 2004-08-03 at 12:56, oceatoon wrote:
> Hi Bruno 
> 
> Sorry for not being to clear, 
> Yes, I'm in the Flow 
> wid = form.getWidget();
> //"houseuploads" is my repeater
> //"path" would be the upload widget I want to retreive the content off
> wid.houseuploads.getRow(0).getValue();  (return = null)
> wid.houseuploads.getRow(0).path.getValue();  (also return = null)
> wid.houseuploads.getSize();  (return = null)
> 
> ???
> It's probably in the way I manipulate the repeater ???

I don't have enough information to give an exact answer. If you could
tell what Form.js you import and what Cocoon version you're using I
might be able to help.

> would you do this in the Java??

nope, with "Java API" I mean the native API of the widgets, which is
transparently available in javascript.

-- 
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: Flow : Accessing Repeater Rows value in Flow

Posted by oceatoon <t....@systheo.com>.
Hi Bruno 

Sorry for not being to clear, 
Yes, I'm in the Flow 
wid = form.getWidget();
//"houseuploads" is my repeater
//"path" would be the upload widget I want to retreive the content off
wid.houseuploads.getRow(0).getValue();  (return = null)
wid.houseuploads.getRow(0).path.getValue();  (also return = null)
wid.houseuploads.getSize();  (return = null)

???
It's probably in the way I manipulate the repeater ???
would you do this in the Java??
Thanks 

Bruno Dumon wrote:

> On Mon, 2004-08-02 at 17:21, oceatoon wrote:
>> Hi
>> 
>> I found a post "POPUALTING SELECTIONLISTS INA REPEATER FROM FLOW " where
>> a similar question was asked but I can't seem to get Joergs
>> technique(getRow before getting the value) to function.
>> 
>> my repeater only contains an upload widget (minimum one so Row(0) allways
>> exists, with add and delete). Then in my Flow, I need to retreive the
>> value of the uploaded file from the widget to move it around.
>> 
>> wid = handleForm("masterform", "forms/", document);
>> 
>> //I'd like to retreive the value
>> wid.houseuploads.getRow(0).getValue();
>> 
>>  But this doesn't seem to work???? allways returns "null"
> 
>>>From the wid.houseuploads notation I'd assume you're using the
> javascript-wrapped variant of the widget tree, which has a different
> API.
> 
>> Also, do I have run through the whole repeater or is there a size or
>> length method associated to now how many entries have been submitted?
> 
> For the java API, this can be retrieved with the method getSize() of the
> repeater.
> 
> I think you can find the javascript-equivalents of these in the samples.
> 



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


Re: Flow : Accessing Repeater Rows value in Flow

Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2004-08-02 at 17:21, oceatoon wrote:
> Hi  
> 
> I found a post "POPUALTING SELECTIONLISTS INA REPEATER FROM FLOW " where a
> similar question was asked but I can't seem to get Joergs technique(getRow
> before getting the value) to function. 
> 
> my repeater only contains an upload widget (minimum one so Row(0) allways
> exists, with add and delete). Then in my Flow, I need to retreive the value
> of the uploaded file from the widget to move it around.
> 
> wid = handleForm("masterform", "forms/", document);
> 
> //I'd like to retreive the value 
> wid.houseuploads.getRow(0).getValue();
> 
>  But this doesn't seem to work???? allways returns "null"

>>From the wid.houseuploads notation I'd assume you're using the
javascript-wrapped variant of the widget tree, which has a different
API.

> Also, do I have run through the whole repeater or is there a size or length
> method associated to now how many entries have been submitted?

For the java API, this can be retrieved with the method getSize() of the
repeater.

I think you can find the javascript-equivalents of these in the samples.

-- 
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