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
prady-cmprady-cm 

Setting a selectoption value on pageblockTable rerender

I have an PageBlockTable which has a wrapper class as its value.

 

Every time a command button is clicked to add a product, a new row is added to the wrapper class and the PageblockTable is rerendered to display the new row.

 

All these work but when the rerender happens the selectedValue in the selectList is reset to the first item on the selectList.

How can i have the selectList to maintain state?

 

 <apex:commandButton action="{!addNewProduct}" value="Add New Product" rerender="pbtExistingInstItems,PBCopyProdToInstItems"/>
    <apex:selectList id="slprodname" value="{!itw.installedItem.Product__c}" size="1" rendered="{!itw.isManuallyCreated ==  true}" >
                <apex:selectOptions value="{!prodList}"/>
                <apex:actionSupport event="onchange" action="{!updateDefaultProductValues}"  rerender="colInstallationName">
                </apex:actionSupport>
    </apex:selectList>

 

Rahul SharmaRahul Sharma

prady-cm, I don't think the problem is with use of rerender. Seems issue in your addNewProduct function.