0

VF Page Code:

<apex:form id="myForm" >          
    <fieldset class="slds-form--compound">  
        <div class="form-element__group">
            <div class="intro">
                <span id='mainerrorMessage' style="display:none; color:red; font-weight: bold;"></span>
                <legend class="slds-form-element__label slds-text-title--caps"><b>Filter:</b></legend>  
                <div class="slds-form-element__row slds-large-show"> 
                    <apex:outputpanel id="UpdatePanel" > 
                        <apex:outputPanel id="UpdatePanel1" rendered="{!IF(wrapList.size>0,true,false)}">
                            <div class="intro1">
                                <legend class="slds-form-element__label slds-text-title--caps"><b>Set all engagements on this page to:</b></legend>   
                                <div class="slds-form-element__row slds-large-show">
                                    <label class="slds-form-element__control slds-size--1-of-2" style="width: 49.8%;">
                                        <span class="slds-form-element__helper">SpecialtyTest:</span> 
                                        <apex:actionFunction name="check" action="{!applyGlobalchanges}" reRender="trackAssignOut,spAssignoption" status="statusSaveTrip">
                                            <apex:param name="sampleText" value="" assignTo="{!act}" />
                                        </apex:actionFunction>
                                        <apex:outputPanel >
                                            <div class="requiredInput">
                                                <div class="requiredBlock"></div>
                                                <div class="picklist">
                                                    <apex:inputField value="{!Engagement__c.Track_Assignment__c}" id="check" onchange="Callmefunc('{!$Component.check}');"/>
                                                </div>                                      
                                            </div>
                                        </apex:outputPanel>  
                                        <span id='mainerrorMessage' style="display:none; color:red; font-weight: bold;"></span>
                                    </label>                       
                                </div>  
                            </div><br/>                                 
                        </apex:outputPanel>  
                    </apex:outputPanel>     
                </div> 
            </fieldset> <br/>      
            <apex:outputpanel id="studentTable1">
                <apex:outputPanel id="datePanelContainer1" rendered="{!IF(wrapList.size>0,true,false)}">
                    <div class="slds-card">                
                        <div class="slds-card__header slds-grid">
                            <div class="slds-media slds-media--center slds-has-flexi-truncate">
                                <div class="slds-media__figure slds-icon slds-icon-standard-contact slds-icon--small">
                                    <img src="/resource/LDS/assets/icons/standard/contact_60.png" alt="Placeholder" />
                                </div>
                                <div class="slds-media__body">
                                    <h2 class="slds-text-heading--small slds-truncate">Engagement ({!wrapList.size})  </h2>
                                </div>
                            </div>                        
                        </div>
                        <div class="slds-card__body">
                            <table id="conTable" class="slds-table slds-table--bordered slds-max-medium-table--stacked-horizontal slds-no-row-hover"  cellspacing="0">                         
                                <thead>
                                    <tr class="slds-text-title--caps">                                
                                        <th ><b>Student Engagement</b></th>
                                        <!--<th ><b>Student Full Name</b></th>-->
                                        <th ><b>Learning Community</b></th>                                
                                        <th><b>Specialty Assignment</b></th>
                                        <th><b>Secondary Specialty Assignment</b> </th>
                                        <th><b>Specialty Interest</b></th> 
                                        <th>
                                            <apex:outputPanel id="statusTitleCheck">                                       
                                                <apex:outputPanel rendered="{!statusColCheck}" >
                                                    <b>Status</b>
                                                </apex:outputPanel>
                                            </apex:outputPanel>
                                        </th> 
                                    </tr>
                                </thead>
                                <tbody>
                                    <apex:repeat value="{!wrapList}" var="e">
                                        <tr class="slds-hint-parent">                                      
                                            <td role="gridcell" data-label="Account Name">
                                                <div class="slds-truncate" title="Cloudhub"><apex:outputText value="{!e.eng.name}" /></div>
                                            </td>
                                            <td>
                                                <apex:selectList styleclass="slds-input" value="{!e.selectedLC}" size="1" id="lcoption">
                                                    <apex:selectOptions value="{!e.selectedCLC}"/> 
                                                    <apex:param value="{!e.rowcount}" assignTo="{!count}" name="count"/> 
                                                </apex:selectList>
                                            </td>                 

                                            <td>                                   
                                                <apex:outputPanel id="ref3" style="display:none;visibility:hidden" >
                                                    <apex:inputField value="{!e.eng.Site__c}" id="ParentPicklist"> </apex:inputfield> 
                                                </apex:outputPanel>
                                                <apex:outputPanel id="trackAssignOut" >
                                                    <apex:outputPanel id="trackAssignIn" > 
                                                        <div class="picklist">                                        
                                                            <apex:inputField value="{!e.eng.Track_Assignment__c}" id="spAssignoption"/>
                                                        </div>
                                                    </apex:outputPanel>                                      
                                                </apex:outputPanel>
                                            </td>
                                            <td>
                                                <apex:selectList styleclass="slds-input" value="{!e.secondspecialityAssignmnet}" size="1" id="secondAssignoption">
                                                    <apex:selectOptions value="{!trackOptions}"/> 
                                                    <apex:param value="{!e.rowcount}" assignTo="{!count}" name="count"/>
                                                </apex:selectList>
                                            </td>
                                            <td><apex:outputText value="{!e.eng.Prospect_Track_Interest__c }" /></td>  
                                            <td >
                                                <apex:outputPanel id="statusCheck" rendered="{!errorCheck}">
                                                    <apex:outputPanel id="statusCheckIn" rendered="{!statusColCheck}">                
                                                        <div style="width: 150px; font-weight: bold; white-space: initial; color:{!IF(e.errorMessage =='Success','#07C81A', '#FB0707')}"> 
                                                            <apex:outputtext value="{!e.errorMessage } " />
                                                            <apex:param value="{!e.rowcount}" assignTo="{!count}" name="count"/> 
                                                        </div>
                                                    </apex:outputPanel>                                      
                                                </apex:outputPanel>
                                            </td>                                                     
                                        </tr>  
                                    </apex:repeat>
                                </tbody>                         
                            </table>
                        </div>                      
                    </div>  
                </apex:outputPanel>
            </apex:outputPanel>    
        </apex:form>

JavaScript:

function Callmefunc(id) {            
    var type = document.getElementById(id).value; 
    check(type);              
}

VF Page Render tag:

<td>
    <apex:outputPanel id="trackAssignOut" >
        <apex:outputPanel id="trackAssignIn" > 
            <div class="picklist">                                        
                <apex:inputField value="{!e.eng.Track_Assignment__c}" id="spAssignoption"/>
            </div>
        </apex:outputPanel>                                      
    </apex:outputPanel>
</td>

Issue:

When I am changing the value of input field onChange event, the Output panel is not rendering, however the input field value is passing to controller properly. Only problem is rendering. Any thing I am missing here?

  • 1
    Please update your question with complete VF page there is no form element the code snap is not coorct – Avijit Chakraborty Jun 13 '17 at 0:52
  • I see you have status= statusSaveTrip. What do you have in <apex:actionStatus> tag as starttext and stop content? Does the content appear? – SfdcBat Jun 13 '17 at 2:12
  • stopText="" has nothing. It works fine for other action methods. – Ajay Jun 13 '17 at 2:14
  • @AvijitChakraborty: Updated the VF page with the form. I could not update entire page as character limitation. – Ajay Jun 13 '17 at 2:31
  • What is the return type of applyGlobalchanges did you tried putting oncomplete on the actionFuction. If the return type is not Pagereference/void try returning Pagereference /void. also put console.log to ensure actionfunction is getting called – Avijit Chakraborty Jun 13 '17 at 2:40
0
<apex:inputField value="{!Engagement__c.Track_Assignment__c}" id="check" onchange="Callmefunc('{!$Component.check}');"/>

Try this VF Page Code:

<apex:inputField value="{!Engagement__c.Track_Assignment__c}" id="check" onchange="Callmefunc();">
    <script>
        var checkId = '{$Component.check}';
    </script>
</apex:inputField>

JavaScript Code:

function Callmefunc() {            
    var type = document.getElementById(checkId).value; 
    // if it is a checkbox use checked 
    //var type = document.getElementById(checkId).checked;
    check(type);              
}
  • I tried with your approach, actionfunction is not firing. With my approach action function is firing and value is passing to controller. – Ajay Jun 13 '17 at 13:37
0

Resolved:

I was not passing the param value to controller field properly. So I did resolve the issue.

Thank you.

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.