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
mobile vistexmobile vistex 

visualforce page

hi i created a page which looks like following
User-added image
when i click on that links i should show another table and get the data from second object. here is my page code what can i do to acheive that.
<apex:page controller="header" showHeader="false">

<style>
table {
    border-collapse: collapse;
}

table, td, th {
    border: 1px solid black;
    width:20%;
}
</style>
<apex:pageBlock >
<apex:form >
<table onload="makecasesclickable()">
<tr>
<apex:repeat value="{!agrmnts}" var="c">
<td>
<apex:outputText value="{!c}"></apex:outputText>
</td>
</apex:repeat>

</tr>

<apex:repeat value="{!body}" var="bd">
<apex:variable value="{!0}" var="index"/>
<tr>
<apex:repeat value="{!bd}" var="cd">
  
<td>
<apex:outputText value="{!cd}" rendered="{!IF(index < 2,'true','false')}"></apex:outputText> 
<apex:commandLink value="{!cd}" rendered="{!IF(index >= 2,'true','false')}"/>
</td>
<apex:variable var="index" value="{!index+1}"/>
</apex:repeat>
</tr>
</apex:repeat>

</table>
</apex:form>

</apex:pageBlock>


</apex:page>

in command link tag how can i redirect to class where i can get data.
Mudasir WaniMudasir Wani
Hello,
You can do that by passing the parameter and fetching the data in controller and showing it on to the user.
Here is nice blog to achieve that.
http://blog.jeffdouglas.com/2010/03/03/passing-parameters-with-a-commandlink/

After you fetch the you can display it on same page using render reRender function 

Here is an post on that 
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BHAMIA4

Code for that is as follows

Page
<apex:page>

<apex:form id = "formid">

<apex:outputPanel  id="firstPanel">
       <apex:pageBlock >
        <apex:pageblockTable value="{!TasksRecordList}" var="wrapRec" rendered="{!showTasks}">
       <apex:column value="{!wrapRec.accName}" />
       <apex:column value="{!wrapRec.oppName}"/>
       </apex:pageblockTable>
    </apex:pageBlock>
</apex:outputPanel>
         
<apex:outputPanel  id="secondPanel">
       <apex:pageBlock >
        <apex:pageblockTable value="{!EmailRecList}" var="wrapRec" rendered="{!showEmail}">
       <apex:column value="{!wrapRec.accName}" />
       <apex:column value="{!wrapRec.oppName}"/>
       </apex:pageblockTable>
    </apex:pageBlock>
</apex:outputPanel>



<apex:commandButton value="Show"  reRender="firstPanel,secondPanel"/>
</apex:form>
</apex:page>
Controller
 
public class className{
	//constructor
	public className(){
		showTasks = false;
		showEmail = false;
	}
	public boolean showTasks{get;set;}
	public boolean showEmail{get;set;}
	//Say you have Task object 
	public list<Task> TasksRecordList{get;set;}
	//If you have email object 
	public list<Email> EmailRecList{get;set;}
	public void show(){
		//based on what radio was selected you can do the things
		//If show radio was selected from your page and clicked show
		if(showEmailCheckbox == true){
			showEmail = true;
			//fetch Email list 
			EmailRecList = [Select id,name from Email];
		}
		else if(showTaskCheckBox == true){
			showTasks = true;
			//fetch Task list 
			TasksRecordList = [Select id,name from Task];
		}
	}
}



Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
 
mobile vistexmobile vistex
hi thanks for your reply , but how would i know i clicked on particular value.say . if i click on 10 under jan . i want to fetch only the records of that particular row. if i pass parameters like Agreement name and driver how can it know i clicked on only jan sales.
RatanRatan
Check it out with the link below. Maybe it will help you.

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BCIZIA4
 
Mudasir WaniMudasir Wani
Hello,

Every record you display as link will have a unique id pass that and fetch the result as per that Id.
Hope this makes sense.