0

I need a popup window (where I am getting) and we select checkboxes in the popup window. The place I stuck is I need the count of checkboxes from a popup to a parent page. The count is happening but when we click save in popup the whole parent window is getting reload. What I need is, I need to reload only the button I used to display popup onclick. Here I am using AJAX to execute. Please find the code snippets and let me know if u need anything.Thanks!

Here are the code snippets attached

POPUP

<h:form id='popup'>
<h:panelGrid  columns="6"  cellspacing="15">
<h:selectManyCheckbox value = "#{repricing.rowOneSelectedCompetitors}" id="input">
    <f:selectItems value="#{competitor.competitorList}" var="competitor_name"
            itemValue="#{competitor_name}"/>
</h:selectManyCheckbox>
</h:outputLabel> 
</h:panelGrid>
 <h:panelGroup style="display:block; text-align:center">
    <h:commandButton  type="reset" value="Restore to Default"></h:commandButton>
     <h:commandButton value="save" type="submit">
        <f:ajax  execute="input" render="output" ></f:ajax> 
     </h:commandButton> 


  </h:panelGroup>    
  </h:form> 

Parent Page

<div class="col-md-12 padding">
<span>
<input id= "output" type="button" value=" selected Competitors" style="width: auto; float: none; display: inline-block; padding: 0 6px; margin-right: 15px;" class="btn btn-default" data-toggle="modal" data-target="#addModal1"></input>
</span> 
</div>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

0

Render only output text while you click the save button

<f:ajax  event="click" render="output"></f:ajax>
Albin
  • 1,929
  • 2
  • 14
  • 18
0
<f:ajax execute="input" render=":myform:output"/>
  • 3
    Hi srikanth; your code might be correct, but with some context it would make a better answer; for example, you could explain how and why this proposed change would resolve the questioner's problem, perhaps including a link to the relevant documentation. That would make it more useful to them, and also more useful to other site readers who are looking for solutions to similar problems. – Vince Bowdren Nov 30 '16 at 13:49
  • Thanks for the feedback I will make sure next time. @VinceBowdren – Srikanth Pragallapati Dec 01 '16 at 05:07