0

xhtml code : -

When I click on button it called the dialog and inside the dialog box there is pick list, but I am getting pick list as Empty just because Action tag is not working and it's not calling loadtype methods.

    <p:commandButton id="showWoOnHold"
         value="showWoOnHold"
         icon="img-magnifier-16x16"
         action="#{workOrderTypeCrud.loadType}"
         onsuccess="showWoOnHoldDialog();">
        <p:ajax update=":woOnHoldForm" />
    </p:commandButton>


 <ui:define name="dialogs">
    <p:dialog widgetVar="woOnHold" modal="true"
              closable="false" minHeight="100"
              header="#{crud['work.order.type.on.hold.types']}">
        <h:form id="woOnHoldForm" prependId="false">
            <h:panelGrid>
                <h:panelGrid cellpadding="0" cellspacing="0">
                    <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                        <h:outputLabel value="#{crud['work.order.type.description']}"
                                       for="typeDescription" />
                    </h:panelGrid>
                    <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                        <p:inputText id="typeDescription"
                                     value="#{workOrderTypeCrud.instance.description}"
                                     label="#{crud['work.order.type.description']}"
                                     maxlength="60"
                                     disabled="true"/>
                    </h:panelGrid>
                </h:panelGrid>
            </h:panelGrid>

            <h:panelGroup id="pickListWo">
                <div id="pickList">                    
                    <p:pickList converter="PrimeFacesPickListConverter" 
                                id="fieldPickListWo" 
                                value="#{workOrderTypeCrud.fieldsWoOnHold}"
                                itemLabel="#{field.code}"  
                                itemValue="#{field}" 
                                var="field"  
                                showTargetControls="true"
                                addLabel="#{crud['profile.add']}"
                                addAllLabel="#{crud['profile.add.all']}"
                                removeLabel="#{crud['profile.remove']}"
                                removeAllLabel="#{crud['profile.remove.all']}"
                                moveUpLabel="#{crud['profile.move.up']}"
                                moveDownLabel="#{crud['profile.move.down']}"
                                moveTopLabel="#{crud['profile.move.top']}"
                                moveBottomLabel="#{crud['profile.move.bottom']}"/>
                </div>
            </h:panelGroup>

            <h:panelGroup>
                <div style="float: right; padding-top:10px">
                    <p:commandButton id="woSaveTypes"
                                     action="#{workOrderTypeCrud.saveWoOnHold}"
                                     value="#{actions['save']}"
                                     icon="img-green-check-16x16">
                        <p:ajax update=":messages" />
                    </p:commandButton>

                    <p:commandButton
                        action="#{workOrderTypeCrud.cancel}"
                        value="#{actions['cancel']}"
                        label="#{actions['cancel']}"
                        icon="img-delete-16x16" 
                        onclick="hideWoOnHoldDialog()"/>

                    <p:commandButton

                        value="#{actions['close']}"
                        label="#{actions['close']}"
                        icon="img-close-window-16x16" 
                        onclick="hideWoOnHoldDialog()"/>
                </div>
            </h:panelGroup>

        </h:form>
    </p:dialog>

Bean :-

  public void loadType() {        
    loadFields();
      // rest of code to get the list of value for loadtype.       
    }

Action Tag is not working. Even I am not able to update "woOnHoldForm" using update. I am posting half code (you can understand the process) because it's big size code.

kamal
  • 73
  • 8
  • 1
    So it works in PrimeFaces 5.3? (Since you stated 6.0 explicitly in your title). And please create a [mcve]! See also http://stackoverflow.com/questions/2118656/commandlink-commandbutton-ajax-backing-bean-action-listener-method-not-invoked. And you can put the update attribute directly on the commandButton. No need for an ajax tag inside a commandButton – Kukeltje Aug 03 '16 at 13:08
  • Thank u @kukeltje, I remove external Ajax and added update directly in conmondButton. Now it's worked. – kamal Aug 04 '16 at 02:31

0 Answers0