I have a form with inputs that are rendered dynamically through custom metadata relationship fields that relate to Opportunity Line Item fields. These inputs work and bind properly except for date fields.

When a value is changed we call an apex method to save records through actionSupports. All the values save except for date values.

Visualforce snippet:

    <td colspan="9">
        <apex:repeat value="{!s.inputFields}" var="field">
            <div class="italicizedheader">
                <span style="font-style:normal">
                    <apex:inputField value="{!s.lineItem[field.Destination_Field__r.QualifiedAPIName]}">
                        <apex:actionSupport event="onchange" rerender="lineItemOutputPanel,pageMessageId" action="{!RecalculateNoEffect}">
                            <apex:param value="{!s.lineItem.Id}" assignTo="{!lineid}" name="lineid"/>

Apex Method:

public PageReference RecalculateNoEffect()
    List<OpportunityLineItem> olis = new List<OpportunityLineItem>();
    for (ShoppingCartItem q : shoppingCart) {
        System.debug('Start Date: ' + q.lineItem.Maint_Start_Date__c);

    update olis;

    //Refresh shopping cart
    shoppingCart = RefreshShoppingCart();

    return null;

10:12:05.0 (286799223)|USER_DEBUG|[1713]|DEBUG|Start Date: null

The dynamic displaying isn't a problem because I have hardcoded the api field name to an apex:inputField and it also does not save.

The date picker shows when the input has focus and displays the selected date, but when the actionSupport method is called the value is null.

enter image description here

Why are the date values not binding?

  • The problem was elsewhere in my visualforce. I was dynamically hiding a different input with the same field value with css. Visualforce didn't know how to handle 2 of the same fields with different values Jun 10, 2019 at 20:23


You must log in to answer this question.

Browse other questions tagged .