2

I am trying to pass the productid when i change product in my VF page using actionsupport. The action function does get called but the changed id is not passed but the one is passed.

Here is the VF page code

<apex:column headerValue="Product Name" id="qlipbt_colProduct" rendered="{!s.quotelineitemRec.id == null}" >
                        <apex:actionRegion>
                        <apex:inputField value="{!s.quotelineitemRec.Product2Id}" style="width:270px"  id="qlipbt_colProductinput" >
                            <apex:actionSupport event="onchange" rerender="rates,msgs,qlipbt_colProduct" action="{!productChange}" oncomplete="myInit();">
                                <apex:param value="{!s.quotelineitemRec.Product2Id}" assignTo="{!toupdateProduct}" name="toupdateProduct"/>
                                <apex:param value="{!s.randomId}" assignTo="{!toupdateProductRandomId}" name="toupdateProductRandomId"/>
                            </apex:actionSupport> 
                        </apex:inputField>
                       </apex:actionRegion>
                    </apex:column>

Any thoughts what is happening here

1 Answer 1

1

The expression {!s.quotelineitemRec.Product2Id} is evaluated when the HTML page is initially generated on the server; if you use your browser's "View Source" you will see that the value is therefore fixed.

As you are re-rendering, the controller field s.quotelineitemRec.Product2Id will be updated automatically so you can just access that value in the server-side logic i.e. the apex:param is not needed.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .