cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angeloimm" <angelo...@libero.it>
Subject Re: Passing some parameters to a Form by using shoForm
Date Thu, 16 Dec 2004 16:04:38 GMT
Hi.. yes i know this way... but what i would like to do is something like this:

flow-script:
function upload() {
    
    var form = new Form("forms/upload_model.xml");
    var k = form.showForm("upload-display-pipeline");

    k.invalidate();

    cocoon.sendPage("upload-success-pipeline.jx",
        {
            uploadContent: handleUpload(form), 
            username: form.lookupWidget("user").getValue(),
            filename: form.lookupWidget("upload").getValue().getHeaders().get("filename")
        }
    );
}

upload-success-pipeline.jx:

<page>
  <title>Sample form result</title>
  <content>
    User '${username}' uploaded file '${filename}' whose content is :
    <br/>
    <pre>
${uploadContent}
    </pre>
  </content>
</page>

As you can see there is no field called uploadContent etc... but by doing:  '${username}'
 i can retrieve it; now this works very well by using cocoon.sendpage.... if i want to use
form.showForm in order to do this thing how can i do?
---------- Initial Header -----------

>From      : gounis@osmosis.gr
To          : "Help Cocoon" users@cocoon.apache.org
Cc          : 
Date      : Thu, 16 Dec 2004 17:50:38 +0200 (EET)
Subject : Re: Passing some parameters to a Form by using shoForm

> On Thu, 16 Dec 2004, angeloimm wrote:
> 
> 
> hi 
> 
> i guess that you want to set a value in a widget before display the form
> you can check this thread
> http://marc.theaimsgroup.com/?t=110320352200003&r=1&w=2
> 
> or set value this weay :
> var form = new form("yourForm.xml");
> form.lookupWidget("widgetNameYouAreLookingFor").value = "value";
> 
> -- stavros
> 
> 
> > Hi all.
> > I want to pass some parameters to a form by using the showForm method.
> > I.E; let's imagine we are in a flow script. Now by using sendPage we can do:
> > 
> > cocoon.sendPage( "MyPage.jx", {"key":value, "key1":value1} )
> > 
> > Now how can i do a similar thing by using showForm? I have tried to do:
> > 
> > var form = new Form("myForm.xml");
> > form.showForm( "myTemplate.jx", {"key":value, "key1":value1} );
> > 
> > but i have an error that says to me that showForm wants a function instead of these
parameters.... so i have tried:
> > 
> > var form = new Form("myForm.xml");
> > form.showForm( "myTemplate.jx", function(){var key = "key"; var value = value; }
);
> > 
> > but how can i recover these parameters in the page?
> > Thanks to all
> 
> 
> 
> ____________________________________________________________
> Regala e regalati Libero ADSL: 3 mesi gratis, navighi veloce e scarichi a 1.2 Mega. 
> Abbonati subito senza costi di attivazione su http://www.libero.it
> 
> 
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 
> 



____________________________________________________________
Regala e regalati Libero ADSL: 3 mesi gratis, navighi veloce e scarichi a 1.2 Mega. 
Abbonati subito senza costi di attivazione su http://www.libero.it




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


Mime
View raw message