You need to sign in to do that
Don't have an account?

In orderProduct.Quantity field is not getting updated in collection but when i added <apex:actionsupport> then its working.
In orderProduct.Quantity field is not getting updated in collection but when i added <apex:actionsupport> then its working. I am not sure is it a limitation. Can any one let me know how it is processed in the background and any other approach.
Below is the code.
<apex:pageBlockSection title="Order Details" columns="1">
<apex:outputPanel id="ProductPanel">
<apex:variable value="{!0}" var="num"/>
<apex:dataTable value="{!orderProducts}" var="orderProduct" id="orderProductsId">
<apex:column>
<apex:facet name="header">Account Name</apex:facet>
<apex:actionRegion >
<apex:selectList value="{!orderProduct.Product2Id}" size="1" >
<apex:actionSupport event="onchange" action="{!productsChange}" reRender="ProductPanel" >
<apex:param name="testParam" value="{!num}" assignTo="{!index}" />
</apex:actionSupport>
<apex:selectOptions value="{!productOptions}" />
</apex:selectList>
</apex:actionRegion>
</apex:column>
<apex:column >
<apex:facet name="header">Product Name</apex:facet>
<apex:outputText value="{!orderProduct.Product2.Name}" />
</apex:column>
<apex:column >
<apex:facet name="header">Unit Price</apex:facet>
<apex:outputField value="{!orderProduct.UnitPrice}" />
<apex:variable var="num" value="{!num + 1}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Quantity</apex:facet>
<apex:actionRegion>
<apex:inputField value="{!orderProduct.Quantity}">
<apex:actionSupport event="onchange" reRender="ProductPanel1122">
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:column>
</apex:dataTable>
</apex:outputPanel>
</apex:pageBlockSection>
Below is the code.
<apex:pageBlockSection title="Order Details" columns="1">
<apex:outputPanel id="ProductPanel">
<apex:variable value="{!0}" var="num"/>
<apex:dataTable value="{!orderProducts}" var="orderProduct" id="orderProductsId">
<apex:column>
<apex:facet name="header">Account Name</apex:facet>
<apex:actionRegion >
<apex:selectList value="{!orderProduct.Product2Id}" size="1" >
<apex:actionSupport event="onchange" action="{!productsChange}" reRender="ProductPanel" >
<apex:param name="testParam" value="{!num}" assignTo="{!index}" />
</apex:actionSupport>
<apex:selectOptions value="{!productOptions}" />
</apex:selectList>
</apex:actionRegion>
</apex:column>
<apex:column >
<apex:facet name="header">Product Name</apex:facet>
<apex:outputText value="{!orderProduct.Product2.Name}" />
</apex:column>
<apex:column >
<apex:facet name="header">Unit Price</apex:facet>
<apex:outputField value="{!orderProduct.UnitPrice}" />
<apex:variable var="num" value="{!num + 1}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Quantity</apex:facet>
<apex:actionRegion>
<apex:inputField value="{!orderProduct.Quantity}">
<apex:actionSupport event="onchange" reRender="ProductPanel1122">
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:column>
</apex:dataTable>
</apex:outputPanel>
</apex:pageBlockSection>