You need to sign in to do that
Don't have an account?
Aki99
Get the id of a row in a table and passit to next page
Hi all,
I am tring to develop an VF PAge which shows a list of books in pageblocktable.
Each row shows the data for a book record.
I want to get to the next page(the detail page) for the book selected by clicking on the command button in its row.
How to get that id of the selected book among all the idds in the table.
One idea is by using wrapper class but i am a newbie and don't know how to do this using that
Thanks in advance
Try embedding an apex:outputLink component within a apex:column in the pageBlockTable. The value for the outputlink can be setup to the detail page of the custom object using URLFOR function see a snippet below:
This will display a hyperlink for first column as the name of the custom object record and will drill down to the detail page of the object. the outputlink can be changed to a command button as desired.
All Answers
Try embedding an apex:outputLink component within a apex:column in the pageBlockTable. The value for the outputlink can be setup to the detail page of the custom object using URLFOR function see a snippet below:
This will display a hyperlink for first column as the name of the custom object record and will drill down to the detail page of the object. the outputlink can be changed to a command button as desired.
Thankyou for your relpy vbsit helped a lot in solving my problem
Here's what how i've done it
With the output link i added a param for sending the current row id as:
<apex:outputlink value="/apex/Page17"> Custom Link <apex:param name="msg" value="{!nov.id}"/> </apex:outputlink>
Here the value of the param tag is the variable for the standard controller and I've accessed it's id field and passed that id to the next page and recieved ther by using
public string getval = System.currentPageReference().getParameters().get('msg');
And by so each row in my table can be clicked to reach to the next page containing its detail part.