1

This is my initial (and working) setup for a Select button against an OpportunityLineItem on a custom product selection Visualforce page. Note the OpportunityLineItems are displayed in a table, hence the <apex:column> tag:

            <!-- Notify user search we are adding product-->
            <apex:actionStatus id="addCart" startText="Adding Product..." stopText=" " startStyleClass="statusStyle"/>

                <apex:column >
                    <apex:commandButton value="Select" action="{!addToShoppingCart}" reRender="selected,searchResults,msgs" immediate="true" status="addCart">
                        <apex:param value="{!a.Id}" assignTo="{!toSelect}" name="toSelect"/>
                    </apex:commandButton>
                </apex:column>

Now I would rather the button itself shows the actionstatus, saving the user having to scroll up/down to see it. I have this working in several other places in the page, but this is the only one which also uses apex:param. Using the below the button doesn't even appear:

               <apex:column >
                    <apex:actionStatus id="addCart1">
                        <apex:facet name="stop">
                            <apex:commandButton value="SelectWIP" action="{!addToShoppingCart}" reRender="selected,searchResults,msgs" immediate="true" status="addCart1"/>
                                <apex:param value="{!a.Id}" assignTo="{!toSelect}" name="toSelect"/>
                        </apex:facet>

                        <apex:facet name="start">
                            <apex:outputPanel>
                                <apex:image value="/img/loading32.gif" style="height: 15px"/>
                                <apex:commandButton value="Adding Product..." status="addCart1" disabled="true"/>
                            </apex:outputPanel>
                        </apex:facet>                       
                    </apex:actionStatus>                             
                </apex:column>

However if I comment out the line below, the actionstatus displays but the param does not get sent back to the controller:

<apex:param value="{!a.Id}" assignTo="{!toSelect}" name="toSelect"/>

The first example works so I'm pretty sure there is no issue with the controller and I thought as long as the commandbutton is rerendering something then the param would be sent. Is there an issue with using the combination I am using?

  • Have you tried removing "immediate = true" attribute? – tandonprateek Nov 17 '14 at 16:44
  • Unfortunately the button still doesn't display, unless the apex:param line is commented out. – Girbot Nov 17 '14 at 16:47
1

In your second example, the <apex:param /> is outside of the <apex:commandButton> element, yet on the first example which you provided the param tag is within the command button's markup.

Was this change deliberate? If not, restructuring the button markup to contain the param element may solve your issue.

<apex:commandButton value="SelectWIP" action="{!addToShoppingCart}" reRender="selected,searchResults,msgs" immediate="true" status="addCart1">
    <apex:param value="{!a.Id}" assignTo="{!toSelect}" name="toSelect"/>
</apex:commandButton>
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.