function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sanjaypatidarsanjaypatidar 

Checkbox Value displayed wrong in Wizard

Hi,


I have created a Opportunity Wizard (5 Steps / Pages), on one page I have a product selection page which allows users to select multiple products using pagination (Offset Used).

 

My Issue is that when the user navigates from previous page to Product Selection page and selects products and moves to the Page2 of the PAGINATION the checkboxes of the previous selection is shown as checked, where as I debugged the table and it shows value as false.

 

Stangely - If i load the pagination page alone, this does not happen. I am not sure if its cache or something else.. I used cache="false" as well but still same issue.

 

My VF Page Code  - 

      		<apex:pageBlockButtons >
				<apex:commandButton action="{!step3}" value="Previous"/>
	          	<apex:commandButton action="{!step5}" value="Next"/>
				<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>
			</apex:pageBlockButtons>


				<apex:outputPanel id="MainPanel">
					<apex:outputPanel id="ProductSelectionPanel" rendered="{!!processSelectedPriceBookEnteries && pricebookSelected}">
						<div class="header">Select Products</div>
						<apex:actionStatus id="stat">
			            	<apex:facet name="start"> 
			                    <apex:outputPanel layout="block" styleClass="message infoM4">
			                        <apex:panelGrid columns="2" styleClass="messageTable" columnClasses="messageCell" style="padding:0px;margin:0px;">
			                            <apex:panelGroup >
			                                <img class="loadingIcon" src="/s.gif"/>
										</apex:panelGroup>
										<apex:panelGroup >
			                                <div class="messageText">Please wait...</div>
										</apex:panelGroup>
									</apex:panelGrid>
								</apex:outputPanel>
							</apex:facet>
			                    
							<apex:facet name="stop">
                        		<apex:pageblockTable value="{!OpportunityProducts}" var="pbe" id="pbTable" rendered="{!!processSelectedPriceBookEnteries}">
									<apex:column >
			                            <apex:facet name="header">
				                            <script>
				                                //Not sure why adding this resolves the issue of the header checkbox always checked.. Something Strange !!
											</script>
											<apex:inputcheckbox selected="{!selectall}">
												<apex:actionSupport event="onchange" action="{!toggleSelection}" reRender="MainPanel"/>
			                                </apex:inputcheckbox>
										</apex:facet>
										<apex:inputCheckbox value="{!pbe.checked}">
			                            	<apex:actionSupport event="onchange"  reRender="MainPanel"/>
										</apex:inputCheckbox>
									</apex:column> 

									<apex:column >
										<apex:facet name="header">Product Name</apex:facet>
						                <apex:outputField value="{!pbe.PBookEntry.Product2Id}"/>
									</apex:column>
						                
						           <apex:column >
						                <apex:facet name="header">Product Code</apex:facet>
										<apex:outputField value="{!pbe.PBookEntry.ProductCode}"/>
									</apex:column>
						                
									<apex:column >
						            	<apex:facet name="header">Is Active</apex:facet>
						                <apex:outputField value="{!pbe.PBookEntry.IsActive}"/>
									</apex:column>
						                
						            <apex:column >
						            	<apex:facet name="header">Unit Price</apex:facet>
						                <apex:outputField value="{!pbe.PBookEntry.UnitPrice}"/>
									</apex:column>
								</apex:pageblockTable>
							</apex:facet>
						</apex:actionStatus>
							
						<br/>
			            	
			            <div align="center">
							<ul class="menu">
								<li class="rollover" id="first"><apex:commandLink rendered="{!NOT(pageNumber == 0)}" reRender="MainPanel" action="{!firstPage}" immediate="true" title="First Page" status="stat"/></li>
								<li class="rollover" id="previous"><apex:commandLink rendered="{!NOT(pageNumber == 0)}" reRender="MainPanel" action="{!previous}" immediate="true" title="Previuos" status="stat"/></li>
								<li style=" margin-right: 10px;"> <apex:outputText >Page {!pageNumber+1} of {!noOfPages}</apex:outputText></li>
								<li class="rollover" id="next"><apex:commandLink rendered="{!NOT(pageNumber == noOfPages -1)}" reRender="MainPanel" action="{!next}" immediate="true" title="Next" status="stat"/></li>
								<li class="rollover" id="last"><apex:commandLink rendered="{!NOT(pageNumber == noOfPages -1)}" reRender="MainPanel" action="{!lastPage}" immediate="true" title="Last" status="stat"/></li>
							</ul>
							<span>
								<apex:commandLink value="Process Selected" rendered="{!productsSelected}" rerender="MainPanel" action="{!QueryOpportunityLineItem}" immediate="true" styleClass="AddrowButton" title="Process Selected" style="color: white; float: right;">
							    	<apex:param name="processSelected" value="true" assignTo="{!processSelectedPriceBookEnteries}" />
								</apex:commandLink>
							</span> 
						</div>
					</apex:outputPanel>

kindly let me know if anyone has seen similar behaviour with wizard and pagination together ?

 

Thanks in Advance,

Sanjay