cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Horner <jhor...@arinbe.com>
Subject Re: form submit target
Date Wed, 21 Jan 2004 01:47:17 GMT


> So the flow should be something like:
> Step 1: Begin edit (continuation gets generated)
> Step 2: Submit to _new target ( new window is opened with results of submit
> ) Step 3: Submit to back to parent..
>
> the form looks something like:
>
> <wt:form-template action="mypage-#{$continuation/id}.continue"
> method="POST" target="_new"> ...
> </wt:form>

Would it be possible to provide a little more detail on how you got this 
working? I am having a bit of time doing something similar. I have a form 
which has 3 submit buttons; 1-submit, 2-cancel and 3-createContact. I want 
the createContact to jump to a different/child woody form and when complete 
come back to the parent form. I can get the child to come back to the (POINT 
A) but then "form" has the submitId from the child and the function breakouts 
of the while loop. I think my brain is fried. Jim

<wt:form-template action="parentpage-#{$continuation/id}.continue" 
method="post">
	
	... other widgets ...
	<wt:widget id="createContact" />
	... other widgets ...
	<wt:widget id="submit" />
</wt:form-template>

then the flowscript

function parentForm(form) {
    // parse the document to a DOM-tree
    var document = loadDocument(documentURI);

    // bind the document data to the form
    form.load(document);

    var breakout = false;
     while (breakout == false) {
    	// shows the form to the user until is validated successfully
    	form.showForm(displayURI);

	 // (POINT A) 
    	if (form.submitId == "cancel" || form.submitId == "submit") {
    		breakout = true;
    	}
    	else if (form.submitId == "createContact") {
    		
		// this calls the sitemap to execute childPage below ...
		cocoon.sendPageAndWait(createContactURI);		
		// (POINT B)
    	}
    }
   ....
}
     
function childPage(form) {
    // parse the document to a DOM-tree
    var document = loadDocument(documentURI);

    // bind the document data to the form
    form.load(document);
  
    // shows the form to the user until is validated successfully
    form.showForm(displayURI);

    foo.saveNewContact();

    // what now????
    cocoon.sendPage(???);
}

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


Mime
View raw message