0

I'm trying to pass the value of an html input tag to an wrapper class into my controller. I'm using input tag because I need the slds style and others validation that I can't with a simple apex:inputField.

If I use the apex:inputHidden with the html input tag, the save method is not being called on my Controller but if I just use the apex:inputField works like a charm.

Did anyone knows if there is an error with the structure?

<apex:pageBlock mode="maindetail">
<apex:form id="theForm">
<apex:actionFunction name="saveinfo" action="{!save}" oncomplete="return false;"/>
        <apex:pageblocktable value="{!wrapperMainPaxList}" var="wrapper" columnsWidth="5%,5%,80%,10%" width="500px" headerclass="headercolor" >
            <apex:column>
                <apex:inputHidden value="{!wrapper.qlis.Date__c}" id="hiddencmp"/>
                <input type="date" id="input-id-01" class="slds-input" aria-describedby="form-error-01" placeholder="Date" onblur="document.getElementById('{!$Component.hiddencmp}').value = this.value;" value=""/>
                <apex:inputField value="{!wrapper.qlis.Date__c}"/>
            </apex:column>
        </apex:pageblocktable>
</apex:form>
</apex:pageBlock>
<button class="slds-button slds-button_brand" onclick="saveInformation();">Submit</button>
9
  • Where you have declared saveInformation() Jun 26, 2018 at 13:22
  • Hello Tushar, I have between script tags function saveInformation(){ saveinfo(); } Jun 26, 2018 at 13:28
  • 1
    Add apex:pagereference tag in your page. You might be getting some exception. Jun 26, 2018 at 13:34
  • I just added and didn't showed anything, on the debug logs, it get generate, but it is a file that does not show anything useful... any other idea about how can I debug that? Jun 26, 2018 at 14:23
  • Is the save method not getting called or the value in inputHidden is not getting passed to controller?Also, it seems the script you have written for onblur is not pointing to the correct element id document.getElementById('{!$Component.hiddencmp}').value = this.value; All the ids in the hierarchy are not given. Try inspecting the hidden element and check its id Jun 26, 2018 at 15:00

0

You must log in to answer this question.

Browse other questions tagged .