+ Start a Discussion
mgodseymgodsey 

Issue with immediate="true" in command button

I have a custom command button in a visualforce page that when clicked performs an action. For this action, I refresh a page block that has fields that are required. However, I do not want them to be required at this point, so I use immediate="true", which is partially working. The action isn't actually being prevented, but the field required message is still displayed (screenshot attached). Can anyone explain why this might be happening? Thank you!!

<apex:column headerValue="Add Test">
                    <apex:actionStatus id="addStatus" >
                        <apex:facet name="stop" >
                            <apex:commandButton value="Select" action="{!addToQuoteLineItemWrappers}" reRender="selected,errors" immediate="true" image="{!$Resource.GreenPlus}" status="addStatus">
                                <apex:param value="{!product.Id}" assignTo="{!toSelectId}" name="toSelectId"/>
                            </apex:commandButton>
                        </apex:facet>
                        <apex:facet name="start">
                            <apex:commandButton value="Adding - See Below" disabled="true" status="addStatus" />
                        </apex:facet>
                    </apex:actionStatus>
 </apex:column>
User-added image

manhnt.bkitmanhnt.bkit
Hi mgodsey,
Try to enclose sections inside <apex:actionRegion> this will allow you submit the corresponding section to the server, without effect to another.
Here is an example for you :
 http://salesforce.stackexchange.com/questions/8574/problem-in-commandbutton-with-immediate-true