cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Rech" <philipp.r...@gmx.de>
Subject Re: cforms + flow contination problem
Date Thu, 07 Oct 2004 07:22:35 GMT
Hello Peter,

i looked into your stuff and work with it a little. In my opinion the
onClick="history.go(-1)" is a good idea and works fine. As a link and as a
button. Both are resiplaying the data just fine. Also i've done it on a 2nd
CForms page and NOT on the JX Template!!! The more 'Cocoonish' and therefore
better '${cocoon.continuation.parent.id}.continue' method never worked for
me. If anyone knows how to implement back funktion via
'${cocoon.continuation.parent.id}' in CForms or JXT please post, i think its
a common problem....Here is my code hope that helps somewhat. I will try
something for JXTemplates too.
Ciao,
philipp


<html xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
  xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
  <head>
    <title>Registration form</title>
  </head>
  <body>
    <h1>Registration Step 2/2</h1>
    <ft:form-template action="#{$continuation/id}.continue" method="POST">  
 

  <ft:widget-label id="password"/>
      <ft:widget id="password">
        <fi:styling type="password"/>
      </ft:widget>

     <!-- .... more widhets here -->

<input type="submit" value="Submit" />
<input type="button" value="Back via JS" onClick="history.go(-1)" />
<a href="javascript: history.go(-1)">Back via JS Link</a>

    </ft:form-template>


-------------------------------------------------------
-------------------------------------------------------




> Hi,
> 
> I am trying to do the following:
> 
> After filling out a form and submitting it i want to show all the data
> submitted.
> If the user decides everything is correct he can klick OK and his data
> will be
> saved.
> So far, so good.
> However, if the data is not correct (e.g. misspelled word, etc) there
> should be
> a back button/link.
> 
> This back button/link is the Problem:
> 
> If I do a:
> <form action="${cocoon.continuation.parent.id}.continue" method="POST">
> to go back it goes back to the previous form, but all the field widgets
> are
> empty and a validation error for each field is shown.
> 
> If I go back using the browser back button, everything is nice: all fields
> (except password fields) show the previously entered data.
> 
> I even tried:
> <input type="submit" value="Zurück" onClick="history.go(-1)" />
> to imitate the behaviour of the browser back button, but with no luck.
> Same
> empty fields and validation errors as with cocoon.continuation.parent.id.
> 
> Is this normal behaviour?
> If yes is there a way to fill those cocoon forms with data?
> 
> 
> I am using CForms for the forms.
> JX Templates to show the data for a second check
> and Flow to handle the stuff in between.
> 
> 
> 
> 
> here is my flow file:
> --------------------
> 
> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
> 
> function registration() {
> 	
> 	var form = new Form("forms/registration.xml");
> 	form.showForm("registration-display-pipeline");
> 
> 	var model = form.getModel();
> 	
> 	var helper = new Helper();
> 	var timestamp = helper.timestamp();
>      
>    var person = new Person(model.username, model.password, model.email,
> model.firstname, model.sirname, model.address, model.zip, model.country,
> model.birthday, model.phone, timestamp);
>     
> 			
> 	var bizData = person.Object2bizData();
> 
> // show data again and ask if everything is OK, if not go back
> 	
> 	var form_confirm = new Form("forms/registration_confirm.xml");
> 	form_confirm.showForm("registration-confirm-pipeline", bizData);
> 	
> // save data to db
> 	person.create();
> 
> 	cocoon.sendPage("registration-success-pipeline", person);
> }
> 
> 
> 
> //---------- the form that redisplays the data and provides the go back
> button:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <page>
>   <!-- This is a test page only implementing the "Go Back and Edit" button
> -->
>    <title>Registration-Confirm</title>
> 
>  	<form action="${cocoon.continuation.parent.id}.continue" method="POST"> 
>  	<!-- <form> -->
>  	<table>
>     <tr>
>     	<td>
>     	
>     	<textbold>Confirm:</textbold>
>     	<text>
>     	Is this data correct?
>     	</text>
>     	
>     	Username: ${username};
>     	<br/>
>     	Password: ${password};
>     	<br/><br/>
>     	
> 	</td>
> 	</tr>
> 	
> 	<tr>
> 	<td align="center">
> 		<!-- <input type="submit" value="Go Back" onClick="history.go(-1)" />
> -->
> 		<input type="submit" value="Go Back" />
>    </td>
>     </tr>
>     </table>
>     </form>
> 
> </page>
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message