Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
SpringXT AJAX Form Navigation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringXT AJAX Form Navigation

    I have a multipage form with tabs for each page. After the user has completed the first page the second tab will be enabled, and so on. The idea was by adding tabs if the user chose to navigate back to a previous page they can click on the tab instead of clicking the 'Previous' button several times.

    I was thinking about putting the form div under the tabs div and using AJAX to update the form div when a tab is clicked. Will Spring XT allow me to do this? If so, I could use some pointers on how to set it up. Thanks!


    Here is my servlet.xml file:
    Code:
    <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    	<property name="viewClass"><value>org.springframework.web.servlet.view.tiles2.TilesView</value></property>
    </bean>
    
    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    		<property name="definitions">
    			<list>
    				<value>/WEB-INF/defs/index.xml</value>
    			</list>
    		</property>
    	</bean>
    	
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<props>
    				<prop key="index.do">testFormController</prop>
    			</props>
    		</property>
    	</bean>
    	
    	<bean id="testFormController" class="com.oboa.controller.TestFormController">
    	  <property name="commandName"><value>applicant</value></property>
      	<property name="commandClass"><value>com.oboa.domain.Applicant</value></property>
    >
    	</bean>

    The form declared in my JSP:
    Code:
    <form:form commandName="applicant" method="POST" id="applicantForm">

    The AbstractWizardFormController class:
    Code:
    public class TestFormController extends AbstractWizardFormController {
    
        public TestFormController() {
       	setPages(new String[] { "general", "preferences", "education", "employment" }); 
    }
    
        protected Object formBackingObject(HttpServletRequest request) {
            Applicant applicant = new Applicant();
            return applicant;
        }
    }
Working...
X