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
lescclarkcpdlescclarkcpd 

param not working on pageblocktable

Hi

 

I know this issue has come up before but I can't seem to  find a fix for it this time.

 

I have a pageblocktable & am trying to set the value item.id into my controller extension.

 

I  cannot get the id value to pass through to courseId in my controller except when I use an inputText command in place of the commandLink, even so it only works on the last item in the list.

 

This is the VF code

 

 

<apex:pageBlockSection title="Courses" columns="1" showHeader="false" >
                                        <apex:pageBlockTable rules="rows" columns="9" value="{!Object}" var="item" id="thePageBlockTable">
                                            <apex:column headerValue="Availability" width="10%" >
                                                   <apex:commandButton value="Go!" action="{!save}"/>
                                                   <apex:param name="courseId" value="{item.id}" assignTo="{!courseId}" />
                                            </apex:column>    
                                        </apex:pageBlockTable>
                                    </apex:pageBlockSection> 

 

<apex:pageBlockSection title="Courses" columns="1" showHeader="false" >                                        <apex:pageBlockTable rules="rows" columns="9" value="{!Object}" var="item" id="thePageBlockTable"> 

       <apex:column headerValue="Availability" width="10%" > 

                <apex:commandButton value="Go!" action="{!save}"/>

                              <apex:param name="courseId" value="{item.id}" assignTo="{!courseId}" /> 

        </apex:column>                                          

 </apex:pageBlockTable>                                  

 </apex:pageBlockSection> 

 

help I'm going crazy

Best Answer chosen by Admin (Salesforce Developers) 
_Prasu__Prasu_

Check out following link, I guess this will help you in resolving issue.

 

http://blog.jeffdouglas.com/2010/03/04/passing-parameters-with-a-commandbutton/

All Answers

_Prasu__Prasu_

<apex:pageBlockSection title="Courses" columns="1" showHeader="false" >                                        <apex:pageBlockTable rules="rows" columns="9" value="{!Object}" var="item" id="thePageBlockTable"> 

       <apex:column headerValue="Availability" width="10%" > 

                <apex:commandButton value="Go!" action="{!save}">

                              <apex:param name="courseId" value="{item.id}" assignTo="{!courseId}" /> 

                </apex:commandButton>

        </apex:column>                                          

 </apex:pageBlockTable>                                  

 </apex:pageBlockSection> 

 

i hope this will solve your problem. 

lescclarkcpdlescclarkcpd

thanks but had already tried that and still doesn't work

_Prasu__Prasu_

Check out following link, I guess this will help you in resolving issue.

 

http://blog.jeffdouglas.com/2010/03/04/passing-parameters-with-a-commandbutton/

This was selected as the best answer
lescclarkcpdlescclarkcpd

brilliant, thanks