Hello everyone,

I have a database driven form definition which I render by calling
dynamicFormDefinition.do pipeline (flow script + jx).

This works:
function dynamicSurveyTest() { 
        var dd = cocoon.request.getParameter( "id" );
        var surveyDef = getObject( SurveyDefinition , "id", "error retreving
data", "/" );
        
        var form = new Form( "cocoon:/dynamicFormDefinition.do?id=" + dd );
        var model = form.getModel();
        form.createBinding(  "cocoon:/dynamicFormBinding.do?id=" + dd );
        form.load( survey );
        form.showForm( "dynamicForm", { surveyDefinition: surveyDef } );

        form.save( survey );
}

I want to use this form as a "detail" part in master-detail relationship.
So I introduced a "master" form. Clicking a repeater action gets me to a
specific "detail" form.

This does not work (although is exactly the same in the functionality
mentioned above):
function dynamicSurvey() { 
        var dd = cocoon.request.getParameter( "id" );
        
        // master form definition
        var form = new Form( "forms/subSurvey-def.xml" );
        form.createBinding( "forms/subSurvey-bind.xml" );
        form.load( fromSomeWhere );
        
        // show master form
        while( true ) {
                form.showForm( "form/subSurvey", { } ); 
                if ( form.submitId == "edit-group" ) {
                        // !!!! THIS LINE THROWS OutOfMemoryException
                        var formSubSurvey = new Form(
"cocoon:/dynamicFormDefinition.do?id=" + dd );
                        formSubSurvey.createBinding(
"cocoon:/dynamicFormBinding.do?id=" + dd );
                        
                        doSomeStuff();
                }
        }
}

if I any static definition like
var formSubSurvey = new Form( "pseudoDynamicPreviouslyFetched.xml" );
everything is ok and the form gets loaded. 

Maciej Jagielski

Reply via email to