You need to sign in to do that
Don't have an account?
Sindhu Ambarkar
wrapper class issue
Hi,
Iam facing issue in wrapper class
Custom object:Doctor__c,Patient__c is having lookup to Doctor__c
Controller
public class doctor
{
public List<Doctor__c> d{get;set;}
public List<Patient__c> l{get;set;}
public set<string> member=new set<string>();
public List<selectwrapper> li{get;set;}
PUBLIC map<string,Doctor__c> dm=new map<string,Doctor__c>();
public map<string,Patient__c> tm=new map<string,Patient__c>();
public doctor()
{
li=new List<selectwrapper>();
d=[select name,Type__c from Doctor__c];
if(d.size()>0)
{
For(Doctor__c Ls:d)
{
member.add(Ls.Name);
dm.put(Ls.Name,ls);
}
}
l=[select Name,DoctorSpec__c from Patient__c where DoctorSpec__c IN:member];
if(l.size()>0)
{
for(Patient__c pl:l)
{
if(!tm.containskey(pl.DoctorSpec__c))
{
tm.put(pl.DoctorSpec__c,pl);
}
}
for(String i:tm.keyset())
{
li.add(new selectwrapper(dm.get(i),tm.get(i)));
}
}
system.debug('list'+li);
}
public class selectwrapper
{
public Doctor__c dt{get;set;}
public Patient__c td{get;set;}
public selectwrapper(Doctor__c dt,Patient__c td)
{
this.dt=dt;
this.td=td;
}
}
}
page
<apex:page controller="doctor">
<apex:form >
<apex:pageblock >
<apex:pageblocktable value="{!li}" var="c">
<apex:column value="{!c.dt.Name}"/>
<apex:column value="{!c.dt.Type__c}"/>
<apex:column>
<apex:pageblocktable value="{!c.td}" var="l">
<apex:column value="{!l.Name}"/>
</apex:Pageblocktable>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
Facing issue in the page
Please help me out
Iam facing issue in wrapper class
Custom object:Doctor__c,Patient__c is having lookup to Doctor__c
Controller
public class doctor
{
public List<Doctor__c> d{get;set;}
public List<Patient__c> l{get;set;}
public set<string> member=new set<string>();
public List<selectwrapper> li{get;set;}
PUBLIC map<string,Doctor__c> dm=new map<string,Doctor__c>();
public map<string,Patient__c> tm=new map<string,Patient__c>();
public doctor()
{
li=new List<selectwrapper>();
d=[select name,Type__c from Doctor__c];
if(d.size()>0)
{
For(Doctor__c Ls:d)
{
member.add(Ls.Name);
dm.put(Ls.Name,ls);
}
}
l=[select Name,DoctorSpec__c from Patient__c where DoctorSpec__c IN:member];
if(l.size()>0)
{
for(Patient__c pl:l)
{
if(!tm.containskey(pl.DoctorSpec__c))
{
tm.put(pl.DoctorSpec__c,pl);
}
}
for(String i:tm.keyset())
{
li.add(new selectwrapper(dm.get(i),tm.get(i)));
}
}
system.debug('list'+li);
}
public class selectwrapper
{
public Doctor__c dt{get;set;}
public Patient__c td{get;set;}
public selectwrapper(Doctor__c dt,Patient__c td)
{
this.dt=dt;
this.td=td;
}
}
}
page
<apex:page controller="doctor">
<apex:form >
<apex:pageblock >
<apex:pageblocktable value="{!li}" var="c">
<apex:column value="{!c.dt.Name}"/>
<apex:column value="{!c.dt.Type__c}"/>
<apex:column>
<apex:pageblocktable value="{!c.td}" var="l">
<apex:column value="{!l.Name}"/>
</apex:Pageblocktable>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
Facing issue in the page
Please help me out
here's your solution
Thanks & Regards,
Sindhu Ambarkar.
Thanks & Regards,
Sindhu Ambarkar.