• jack__c
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

 

I need a little help getting this to work.  I thought there were only two pieces of code to add (one to visual force page and one to the controller for the visual force page) to accept user input through a visual force page. 

 

 

 

I can initialize approvalComment in the visual force page's controller and I can enter text in the approvalComment field on the visual force page, but I only get my initialized value back...  NOT what the user types in the inputTextarea. 

 

 

 

I am trying to understand what I am missing and why. 

 

 

 

visualforce page code: 

 

<apex:form id="mainForm">  

 

.... 

 

<apex:actionRegion >  

 

 <apex:pageBlock id="approvalCommentBlock" title="Approval Comments" rendered="{!(currentApprovalStateName == 'Required')}" > 

 

      <table width="600"> 

 

         <tr>  

 

            <td width="40%"><apex:outputLabel value="Enter Approval Comments." for="approvalComment" /></td>  

 

            <td width="60%"><apex:inputTextarea cols="50" id="approvalComment" value="{!approvalComment}"/></td>  

 

         </tr>  

 

      </table> 

 

   </apex:pageBlock>   

 

</apex:actionRegion> 

 

....  

 

</apex:form> 

 

 

 

 

 

 

 

visual force page's controller code: 

 

private String approvalComment;  

 

public String getApprovalComment() {   

 

     return approvalComment;  

 

}  

 

public void setApprovalComment(String s) { 

 

     approvalComment = s;  

 

} 

 

 

 

private void initializeState() { 

 

    approvalComment = 'Approval Comments go here.'; 

 

 

 

 

 

 

 

System Log: 

 

14:36:32.924|USER_DEBUG|[300]|DEBUG|approvalComment: Approval Comments go here. 

 

 

I need a little help getting this to work.  I thought there were only two pieces of code to add (one to visual force page and one to the controller for the visual force page) to accept user input through a visual force page. 

 

 

 

I can initialize approvalComment in the visual force page's controller and I can enter text in the approvalComment field on the visual force page, but I only get my initialized value back...  NOT what the user types in the inputTextarea. 

 

 

 

I am trying to understand what I am missing and why. 

 

 

 

visualforce page code: 

 

<apex:form id="mainForm">  

 

.... 

 

<apex:actionRegion >  

 

 <apex:pageBlock id="approvalCommentBlock" title="Approval Comments" rendered="{!(currentApprovalStateName == 'Required')}" > 

 

      <table width="600"> 

 

         <tr>  

 

            <td width="40%"><apex:outputLabel value="Enter Approval Comments." for="approvalComment" /></td>  

 

            <td width="60%"><apex:inputTextarea cols="50" id="approvalComment" value="{!approvalComment}"/></td>  

 

         </tr>  

 

      </table> 

 

   </apex:pageBlock>   

 

</apex:actionRegion> 

 

....  

 

</apex:form> 

 

 

 

 

 

 

 

visual force page's controller code: 

 

private String approvalComment;  

 

public String getApprovalComment() {   

 

     return approvalComment;  

 

}  

 

public void setApprovalComment(String s) { 

 

     approvalComment = s;  

 

} 

 

 

 

private void initializeState() { 

 

    approvalComment = 'Approval Comments go here.'; 

 

 

 

 

 

 

 

System Log: 

 

14:36:32.924|USER_DEBUG|[300]|DEBUG|approvalComment: Approval Comments go here.