cancel
Showing results for 
Search instead for 
Did you mean: 

Pre fill a web-form in a wizard

venkatvj
Champ in-the-making
Champ in-the-making
Hi,

I have a custom wizard with 3 steps. I ask few questions in the first two steps and in the last step i display a WebForm. Something similar to the create content wizard in alfresco. The difference is that i want to pre-fill the web-form based on the values that i got in the first two steps.

As this WebForm is fully generated by alfresco, i am unsure how to achieve my functionality.

Can someone please provide me the steps to do it, if at all its possible?

Thanks
Venkat
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Venkat:


You can use a dynamic include for this.

In the most extreme case, your XSD may be defined two as a single dynamic include (<xs:include schemaLocation="root_relative_path_in_
sandbox_to_some_JSP: /> that returns a complexType and one single
defined element whose type is the complexType returned by your
include.  About as short an XSD as you can get.

Now, your dynamic include (your JSP, which must be contained within
a sandbox so that the Virtualization Server can generate it) must generate
a valid XMLSchema - an XSD.  If it does not, your Web Form will not
work.

Why use JSP to generate the XSD?  Because this way, you can get
whatever environment or session information you need to auto-populate
and marked as FIXED (read-only) any fields you which.  Basically, your
entire Web Form can be on-the-fly generated.

Test it out and report back.  This is one of many reasons that we enabled
this capability for.


Kevin

venkatvj
Champ in-the-making
Champ in-the-making
Hi Kevin,
Thanks for your reply.
I am stuck at not able to render the webform in my third step.

I have uploaded my template file (xsd) to my sandbox and i am
trying to generate the form using this template.
If I use 'Create Content' action from alfresco wcm app, i am able to create
content so I guess there is no issue with my xsd (note that this does not have the
dynamic include yet)

Also, I have extended CreateWebContentWizard and have defined properties  with setter methods appropriately and my custom wizard
is fired from 'Company Home'->'Create' actions menu.

When trying to override
getForm() method, I receive avmbrowsebean NullPointer exception.

Please let me know what I am missing.

Thanks

kvc
Champ in-the-making
Champ in-the-making
Venkat:


Yes, if you were able to pull up a rendered form, your XSD is fine. 

I imagine that there is something amiss with how you are calling Freemarker in your custom wizard.  I recommend opening a support
case and attaching your customized wizard code.  One of our support
engineers can help diagonose where the problem might lie.


Kevin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.