• Abhishek Gupta 360
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
CONTROLLER:
public class actual {
   ID myID {get;set;}
   public List<Account> getAccounts() {    
        List<Account> results = Database.query(
            'SELECT Id, Name,AccountNumber, AnnualRevenue,value__c FROM Account');
        return results;
   }
   public void opp(){
        Id IdOfMember = this.myID;
        System.debug(IdOfMember);
   }
}
VF PAGE:
<apex:page controller="actual" docType="html-5.0" extensions="actual">
    <apex:form >
    <apex:pageBlock >
    <apex:pageBlockTable value="{! accounts }" var="acc" >
        <apex:column >
            <apex:actionSupport action="{!opp}">
                  <apex:param assignTo="{!myID}" value="{!acc.ID}" />
               </apex:actionSupport>
            <apex:commandButton action="{!opp}" reRender="" value="create opp">
            </apex:commandButton>
        </apex:column>
        <apex:column value="{! acc.id }"/>
        <apex:column value="{! acc.AccountNumber }"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

clicking the add opportunity is error. system debugs' null. its sending ID as null from vf page always and not the id i link.
<apex:actionSupport> and <apex:param> are not linking dynamic parameters in table.
HELP!!!