我需要一個彈出窗口(我正在獲取),我們在彈出窗口中選中複選框。我堅持的地方是我需要從彈出窗口到父頁面的複選框的數量。計數正在發生,但當我們點擊彈出窗口中的保存時,整個父窗口正在重新加載。我需要的是,我只需要重新加載我用來顯示彈出的onclick按鈕。這裏我使用AJAX來執行。請找到代碼片段,讓我知道你是否需要任何東西。謝謝!如何從彈出/子窗口渲染父/主窗口的標籤保存操作
這裏是連接
彈出窗口中的代碼片段
<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>
父頁
<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>
嗨srikanth;你的代碼可能是正確的,但是在某些情況下,它會作出更好的回答;例如,您可以解釋如何以及爲什麼這個提議的變更可以解決提問者的問題,或許還包括指向相關文檔的鏈接。這將使它對他們更有用,而且對尋求類似問題解決方案的其他網站讀者也更有用。 –
感謝您的反饋,我會確保下次。 @VinceBowdren –