Results 1 to 2 of 2

Thread: doesn't bind on the 1st event trigered, binds on the 2nd time when partial rendering

  1. #1
    Join Date
    Oct 2008
    Posts
    286

    Default doesn't bind on the 1st event trigered, binds on the 2nd time when partial rendering

    please guide me on how to use partial rendering properly..

    overview:
    initial display, [All Area] radiobutton is selected, table is invisible.
    upon [Route Data] radiobutton clicked, table will become loaded by Route Data.
    upon [Residential Data] radiobutton clicked, table will become loaded by Residential Data.

    upon loading of data, partial rendering is executed..

    when I check the checkbox to do multi select.. then click the [Execute] button it will not bind to selectedRxxxxItemIdList on the first time..

    but..

    it will bind on the second time you click the [Execute] button...

    here's the main jsp: view-main.jsp
    Code:
    <form:form modelAttribute="modelView">
        <table>
            <tr>
    			<td>
    				<form:radiobutton id="allArea" path="allArea" value="All Area"
    					onclick="Spring.remoting.submitForm(taishoZukeiObj.id, document.forms[0].id, { _eventId:taishoZukeiObj.id});"/>All Area
    			</td>
    			<td>
    				<form:checkbox id="routeMode" path="routeMode"/>Route Mode
    			</td>
    			<td colspan="2">
    				<form:checkbox id="residentialMode" path="residentialMode"/>Residential Mode
    			</td>
    		</tr>
    		
    		<tr>
    			<td style="vertical-align: top;">
    				<br/>
    				<form:radiobutton id="loadRouteData" path="targetMode" value="ROUTE" 
    					onclick="Spring.remoting.submitForm(this.id, document.forms[0].id, { _eventId:this.id, fragments: 'view-dataTable' });"/>Route Data
    				<br/>
    				<form:radiobutton id="loadResidentialData" path="targetMode" value="RESIDENTIAL"
    					onclick="Spring.remoting.submitForm(this.id, document.forms[0].id, { _eventId:this.id, fragments: 'view-dataTable' });"/>Residential Data
    				<br/>
    			</td>
    
    			<td colspan="3">
    				<tiles:insertAttribute name="view-dataTable" />
    			</td>
    		</tr>
        </table>
        
    	<!-- buttons -->
    	<table >
    	<tr>
    		<td></td>
    		<td><input type="submit" id="_eventId_execute" name="_eventId_execute" value="Execute" /></td>
    		<td><input type="button" id="back" name="back" onclick="location.href='${flowExecutionUrl}&_eventId=back'" value="Back" /></td>
    	</tr>
    	</table>
    </form:form>
    partial jsp: view-dataTable.jsp
    Code:
    <div id="view-dataTable">
    <form:form modelAttribute="modelView">
    	
    	<table <c:if test = "${ ! (modelView.targetMode == 'ROUTE') }">style="display: none;"</c:if>>
    	    <c:forEach var = "route" items = "${modelView.routeList}" varStatus="status" >
    		<tr id = 'ROUTE${modelView.SLinkId}'>
                <td>
                    <form:checkbox path="selectedRouteItemIdList" value="${route.SLinkId}" />
                </td>
                <td>    
                    ${route.SLinkId}
                </td>
    		</tr>
    		
    		</c:forEach>
    	</table>
    
    	<table <c:if test = "${ ! (modelView.targetMode == 'RESIDENTIAL') }">style="display: none;"</c:if>>
    	    <c:forEach var = "residential" items = "${modelView.residentialList}" varStatus="status" >
    		<tr id = 'RESIDENTIAL${modelView.SLinkId}'>
                <td>
                    <form:checkbox path="selectedResidentialItemIdList" value="${residential.SLinkId}" />
                </td>
                <td>    
                    ${residential.SLinkId}
                </td>
    		</tr>
    		
    		</c:forEach>
    	</table>
    	
    </form:form>
    </div>
    Last edited by eros; Apr 29th, 2010 at 12:02 AM.
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

  2. #2
    Join Date
    Oct 2008
    Posts
    286

    Default

    i forgot the flow def:
    Code:
    	<view-state id="enterModelView" view="view-main" model="modelView" >
    		<on-entry>
    			<evaluate expression="new xyz.domain.ModelView()"
    				result="viewScope.modelView"></evaluate>
    		</on-entry>
    		
    		<transition on="loadRouteData">
    			<evaluate expression="service.loadRouteData(viewScope.modelView)">
    			</evaluate>
    			<render fragments="view-dataTable" />
    		</transition>
    
    		<transition on="loadResidentialData">
    			<evaluate expression="service.loadResidentialData(viewScope.modelView)">
    			</evaluate>
    			<render fragments="view-dataTable" />
    		</transition>
    
    		<transition on="execute" >
    			<evaluate expression="service.execute(viewScope.modelView)">
    			</evaluate>
    		</transition>
    
    		<transition on="back" to="enterMenu" bind="false"/>
    
    	</view-state>
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •