0

I have an <apex:dataTable value="{!dtos}" var="dto">. There I have

<apex:column>
  <apex:facet name="header">rrr</apex:facet>
  <apex:outputPanel id="rrr">
    <apex:selectList id="rrrr" value="{!dto.rrr}" multiselect="false" size="1">
      <apex:selectOptions id="rrrrr" value="{!rrrrr}"/>
      <apex:actionSupport id="rrrrrr" event="onchange"  immediate="false"
                          reRender="ddd, ccc"
                          status="actionStatus"/>
    </apex:selectList>
  </apex:outputPanel>
</apex:column>

and two more guys

<apex:column>
  <apex:facet name="header">Description</apex:facet>
  <apex:outputPanel id="ddd">
    <apex:input value="{!dto.ddd}" type="text"
                id="dddd"/>
  </apex:outputPanel>
</apex:column>

<apex:column>
  <apex:facet name="header">Cost Rate</apex:facet>
  <apex:outputPanel id="ccc">
    <apex:outputText value="{0, number, currency}">
      <apex:param value="{!dto.cccc}"/>
    </apex:outputText>
  </apex:outputPanel>
</apex:column>

So. Description is not updated on picklist change and Cost Rate is.

In controller I have

class DTOClass {
  public String rrr {
    get;
    set {
      if (rrr != value) {
        rrr = value;
        ddd = 'asdf';
        ccc = 13;
      }
    }
  }
}
  • What is inside of aBunchOfIdsHere? – kurunve Aug 18 '17 at 15:52
2

You need to create an apex method in controller. On change of picklist try like below-

<apex:actionSupport event="onchange" action="{!apexMethodName}" rerender="ddd,ccc"/>

and set the value of Description and Cost Rate in controller method.

  • I must say it was not obvious for me that a method should be created in order to get input fields updated... – Andrii Muzychuk Aug 19 '17 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.