0

VF Page:

    <apex:form >
<apex:messages styleClass="slds-notify slds-notify--alert slds-theme--error customMessage" />
      <!-- CREATE NEW ACCOUNT FORM 
      <form class="slds-form--stacked"> -->      
       <fieldset class="slds-form--compound">  
       <legend class="slds-form-element__label slds-text-title--caps"><b>Enaggement Details</b></legend>                    
                      <div class="form-element__group">  
                        <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">Cohort:</span>                                                      
                            <apex:selectList styleclass="slds-input" value="{!selectedCohort}" size="1" id="coho">                          
                                 <apex:selectOptions value="{!cohortOptions}"/>
                                 <apex:actionSupport event="onchange" action="{!lcOptionslist}" rerender="lcmain">                                                                                                                                                                                                          
                                 </apex:actionSupport>
                           </apex:selectList>
                          </label>  
                          <label class="slds-form-element__control slds-size--1-of-2" style="width: 49.8%;">
                            <span class="slds-form-element__helper">Site:</span>                                                      
                            <apex:selectList styleclass="slds-input" value="{!selectedSite}" size="1">                          
                                 <apex:selectOptions value="{!siteOptions}"/>
                           </apex:selectList>
                          </label>
                          <label class="slds-form-element__control slds-size--1-of-2" style="width: 49.8%;">
                            <span class="slds-form-element__helper">View:</span>                                                      
                            <apex:selectList styleclass="slds-input" value="{!assignUassign}" size="1">                          
                                 <apex:selectOptions value="{!assignUassignOptions}"/>
                           </apex:selectList>
                          </label>                  
                        </div> 
                        <legend class="slds-form-element__label slds-text-title--caps"><b>Track Details</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">Learning Community:</span>                                                      
                            <apex:selectList id="lcmain" styleclass="slds-input" value="{!globalselectedLC}" size="1">                          
                                 <apex:selectOptions value="{!lcOptions}"/>
                                 <apex:actionSupport event="onchange" action="{!applyGlobalchanges}" rerender="lcoption" >                                                       
                                 </apex:actionSupport>
                           </apex:selectList>
                          </label> 
                          <label class="slds-form-element__control slds-size--1-of-2" style="width: 49.8%;">
                            <span class="slds-form-element__helper">Track:</span>                                                      
                            <apex:selectList id="trackmain" styleclass="slds-input" value="{!globalselectedTrack}" size="1">                          
                                 <apex:selectOptions value="{!trackOptions}"/>
                                 <apex:actionSupport event="onchange" action="{!applyGlobalchanges}" rerender="track,trackv">                                                                                                               
                                 </apex:actionSupport>
                           </apex:selectList>
                          </label>                         
                        </div>                      
                      </div>
                    </fieldset> 

              <div class="slds-modal__footer">
                   <apex:commandButton style="background-image:url({!URLFOR($Resource.SiteSamples,'img/warning.png')});color:#fff;background-color:#0074d9;height:35px;width:100px;border-width:0px;background-repeat:no-repeat;cursor:pointer;" id="filter" styleclass="btn btn-primary" value="Go" reRender="studentTable,studentTable1" action="{!fetchEngagements}"  status="statusSaveTrip"/> &nbsp;
                  <apex:commandButton style="background-image:url({!URLFOR($Resource.SiteSamples,'img/warning.png')});color:#fff;background-color:#0074d9;height:35px;width:150px;border-width:0px;background-repeat:no-repeat;cursor:pointer;" value="Update Records" action="{!updateEngagements}" rerender="myForm,thePanelWrapper" status="statusSaveTrip"  />   
              </div>           
     <!-- </form> -->
      <br/>      
        <apex:outputpanel id="studentTable1">
            <apex:outputPanel id="datePanelContainer1" rendered="{!itFailed}">
        <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 class="slds-table slds-table--bordered slds-max-medium-table--stacked-horizontal slds-no-row-hover">
                          <thead>
                            <tr class="slds-text-title--caps">
                              <th class="slds-cell-shrink" scope="col">
                                <label class="slds-checkbox">
                                  <input type="checkbox" name="options" onchange="selectAllCheckboxes(this,'inputId')" />
                                  <span class="slds-checkbox--faux"></span>
                                  <span class="slds-assistive-text">Select All</span>
                                </label>
                              </th>
                              <th>Student Engagement</th>
                              <th>Learning Community</th>
                              <th>Current Track</th>
                              <th>New Track</th>
                              <th class="slds-cell-shrink" scope="col"></th>
                            </tr>
                          </thead>
                          <tbody>
                            <apex:repeat value="{!wrapList}" var="e">
                                <tr class="slds-hint-parent">
                                  <td role="gridcell" class="slds-cell-shrink" data-label="Select row Engagement">
                                    <label class="slds-checkbox">                          
                                      <apex:inputCheckbox value="{!e.selected}" id="inputId" />          
                                      <span class="slds-checkbox--faux"></span>
                                      <span class="slds-assistive-text">Select row Engagement</span>
                                    </label>
                                  </td>         
                                  <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:outputText value="{!e.selectedNTrack}" id="track" /></td>  
                                  <td> 
                                     <apex:selectList styleclass="slds-input" id="trackv" value="{!e.selectedNTrack}" size="1">                                                                           
                                           <apex:selectOptions value="{!e.selectedTrack}"/>
                                                 <apex:actionSupport event="onchange" action="{!refreshPage}" rerender="track" > 
                                                       <apex:param value="{!e.rowcount}" assignTo="{!count}" name="count"/>
                                           </apex:actionSupport>                                                                            
                                     </apex:selectList>
                                  </td>    
                                </tr>  
                            </apex:repeat>
                          </tbody>
                        </table>
                      </div>                      
                    </div>  
                    </apex:outputPanel>
        </apex:outputPanel>        

</apex:form>

Issue:

<apex:messages styleClass="slds-notify slds-notify--alert slds-theme--error customMessage" /> is not rendering if I use reRender in Command button.

If I remove reRender, then error messages is showing up.

Can any one help me here?

Regards, Ajay

0

you could use apex:outputPanel

<apex:outputPanel id="messagesPanel"> <apex:pageMessages id="errorMessages" styleClass="slds-notify slds-notify--alert slds-theme--error customMessage"/> </apex:outputPanel>

  • This one worked perfectly.:) – Ajay Oct 28 '16 at 13:20
0

In your apexMessage add the id:

<apex:messages id="errorMessage" styleClass="slds-notify slds-notify--alert slds-theme--error customMessage" />

And in your command button add the id into rerendered page:

<apex:commandButton style="background-image:url({!URLFOR($Resource.SiteSamples,'img/warning.png')});color:#fff;background-color:#0074d9;height:35px;width:100px;border-width:0px;background-repeat:no-repeat;cursor:pointer;" id="filter" styleclass="btn btn-primary" value="Go" reRender="studentTable,studentTable1,errorMessage" action="{!fetchEngagements}"  status="statusSaveTrip"/>

Then you should be fine. You just need to rerender the pageMessage part as well.

  • I tried the approach, no luck. it is not working:( – Ajay Oct 28 '16 at 2:04

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.