Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

primefaces update panel from p:autoComplete

I have the p;autocomplete tag as below which populates list of contacts

<h:form id="relationshipsForm">
//code
    <p:autoComplete id="contactAutoComplete"
                                rendered="#{relationshipController.relationshipsName=='Contact'}"
                                value="#{relationshipController.contactKeyWord}"
                                completeMethod="#{contactRelationshipController.completeContacts}"
                                var="contact" itemLabel="#{contact.fullName}"
                                itemValue="#{contact}" converter="#{contactConverter}"
                                forceSelection="true" size="35" scrollHeight="200"
                                panelStyle="width:10px;">
                                <p:ajax event="itemSelect" update="relationshipsForm,graphViewPanel" />
                            </p:autoComplete> 

On selecting the contact it should ajaxically update the below tab view

<p:outputPanel id="graphViewPanel">
                <h:inputHidden id="orgViewUnMappedJSonDataList"
                    value="${relationshipController.getOrgViewUnMappedJSonData()}" />
                <h:inputHidden id="orgViewMappedJSonDataList"
                    value="${relationshipController.getOrgViewMappedJSonData()}" />

    <p:tabView scrollable="true" id="tabView" dynamic="true" cache="true">
                    <p:tab id="orgViewTab" title="Org View">
                        <h:outputScript library="js" name="go.js" />
                        <h:outputScript library="js" name="gojs_org_view.js" />
                        <h:outputStylesheet library="css" name="gojs_org_view.css" />
                    </p:tab>
                </p:tabView>
    </p:outputPanel>
</h:form>
like image 879
RanPaul Avatar asked Oct 16 '25 13:10

RanPaul


1 Answers

You use <p:outputPanel id="graphView"> alter for <div id="graphView">.

In fact, <p:outputPanel render in clientside a div tag.

like image 184
Rong Nguyen Avatar answered Oct 18 '25 04:10

Rong Nguyen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!