0

I am using bootstrap in my VF page and i want to rerender a field. so i am rerendering the whole row but it is not rerendering propery. Can someone let me know the issue in my below code.

     <apex:outputPanel id="brokername">
          <div class="form-group row">          
             <div class="col-lg-4 col-md-4">         
                 <table width="100%" >
                     <tr width="100%">
                         <td width="100%">
                             <label>How did you hear about us?<span style="color:red;">*</span></label>
                             <apex:selectList id="sourceid" value="{!Source}" size="1" required="true" styleClass="form-control" style="width:100%;">
                                  <apex:selectOptions value="{!Sources}"/>                             
                                  <apex:actionSupport event="onchange" rerender="brokername"/> 
                             </apex:selectList>
                          </td>
                      </tr>
                      <tr width="100%">    
                          <td width="100%">                          
                                 <apex:outputPanel rendered="{!Source != null}">                           
                                     <label>Please provide the name of the Agent: <span style="color:red;">*</span></label>
                                     <apex:inputText label="Broker" value="{!Broker}" style="width:100%;" styleClass="form-control" required="true"/>             
                                 </apex:outputPanel>
                            
                           </td>
                      </tr>       
                 </table>                   
             </div>
</div>
</apex:outputPanel>
2
  • What do you mean it's not rerendering propery? Please edit your question to provide more information, otherwise no one can help you. Include information about what you want it to do, and what it is doing, and any error messages you might be seeing.
    – Nick C
    Sep 1, 2021 at 6:02
  • If my answer solved or guided you to solve your question, please mark as solved. Thanks. Sep 6, 2021 at 15:45

1 Answer 1

0

I think the issue is that you have two inputs as "required" so that when you try to rerender, the page does not goes to the controller as the input below is empty.

You can add <apex:pageMessages /> to the top of the page and you will see the error after changing the option in the selectList.

A solution can be deleting the "required" property in the second input and check the value in the controller, or check validity via Javascript.

1
  • Welcome to Salesforce Stack Exchange (SFSE). Thank you for contributing. We hope that you continue to do so.
    – Moonpie
    Sep 1, 2021 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .