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
TechnossusTechnossus 

Need Help ! Not getting ID in text box

Can any one please point out what I am doing wrong , I need the id of Case_Accession__c  on click of edit in data table in text box but not getting

 

public class Worklist
{
   

    public List<Case_Accession__c> objWorklist {get;set;}
     public String var {get;set;}


    public Worklist()
    {
        objWorkList = new List<Case_Accession__c>();
        objWorkList = [Select ID,PatientName__c,PhysicianName__c  from Case_Accession__c limit 1];
    }

 

}
 }

 

 

VF Page::

 

<apex:page controller="Worklist">
     <apex:Form >
     <apex:pageBlock >
             <apex:pageblockSection >
                 <apex:dataTable id="dtWorklist" value="{!objWorklist }" var="wrklst"  cellspacing="16%">
                  <apex:column headerValue="Patient Name" >
                   <apex:outputField value="{!wrklst.PatientName__c}" />
                   </apex:column>
                   <apex:column headerValue="Physician Name" >
                   <apex:outputField value="{!wrklst.PhysicianName__c}" />
                   </apex:column>
                
                   <apex:column headerValue="Edit Case">
                   
                   <apex:commandLink value="Edit" /> 
                   <apex:param name="var" assignTo="{!var}" value="{!wrklst.id}" />  
                    </apex:column>
                  
                 </apex:dataTable>
                 <apex:inputText value="{!var}"/>
                </apex:pageblockSection>
     </apex:pageBlock>
     </apex:Form>
</apex:page>
   

Best Answer chosen by Admin (Salesforce Developers) 
nickwick76nickwick76

Hi, 

What do you what to accomplish when clicking on Edit?

I am surprised this compiles since you have closed the commandLink tag and the param-tag hangs loose.

See more about the param-tag -> http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref.htm

 

But if it was inside, what is your intention?

 

// Niklas

All Answers

nickwick76nickwick76

Hi, 

What do you what to accomplish when clicking on Edit?

I am surprised this compiles since you have closed the commandLink tag and the param-tag hangs loose.

See more about the param-tag -> http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref.htm

 

But if it was inside, what is your intention?

 

// Niklas

This was selected as the best answer
TechnossusTechnossus

Thank you very much, I got to knoe what I was doing wrong .. Closing the commandlink before the param

 

Thanks a loot

 

Cheers

Raman

souvik9086souvik9086

Create a commandlink method action and use the var variable inside that method.

 

Thanks