简体   繁体   English

控制器中顶点输入文本值null

[英]apex inputText value null in controller

I have an input filed that I am attempting to pass the end user's entered input into the SF controller class. 我有一个输入文件,试图将最终用户输入的输入传递给SF控制器类。

Below is the inputText visualforce code: 以下是inputText visualforce代码:

<div class="ssa-inputs">
  <div class="ssa-input-text">Name: </div>
    <div class="ssa-input">
      <apex:form>
        <apex:inputText value="{!acknowledgeInput}" id="acknowledgeInput"/>
      </apex:form>
    </div>
  </div>
  <div class="ssa-btns">
    <div class="ssa-btn">
      <apex:form>
        <apex:commandButton id="acceptHidden" value="Accept" action="{!updatecontact}"/>
      </apex:form>
      <input type="submit" id="acceptBtn" value="Accept"/>
    </div>
    <div class="ssa-btn">
      <apex:form>
        <apex:commandButton value="Decline" action="{!updatecontact}"/>
      </apex:form>
    </div>
</div>

Below is the SF controller code: 以下是SF控制器代码:

public string acknowledgeInput{get;set;}

public PageReference updatecontact(){
    System.debug(LoggingLevel.DEBUG, acknowledgeInput); 

    // Update contact information
    // Redirect to respected PageReference
}

When I try to print out the value in the logs, I receive null. 当我尝试打印日志中的值时,收到空值。

I feel like this is pretty straight forward and I can't seem to find what I'm missing. 我觉得这很简单,我似乎找不到我所缺少的东西。

Thanks 谢谢

您需要具有相同格式的命令按钮和输入文本字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM