0
votes

Action listener that calls function vcardController.renderModify doesn't fire (in the function renderModify I set the variable renderHiddenEdit to true) and the panel in editCardForm doesn't render. Somebody can help me?

<h:form id="editCardForm">
                <p:panel id="editCard"  style="">
                    <p:panel rendered="#{vcardController.renderHiddenEdit}" >
                        <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                        <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                        <h:graphicImage alt="" style="width: 3em;" class="imagesearch" url="#{resource['img:user.svg']}"/>
                    </p:panel>
                </p:panel>
            </h:form>

            <h:form id="viewCardForm">
                <p:panel id="viewCard" style="">
                    <p:panel rendered="#{vcardController.renderHidden}" >
                        <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                        <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                        <p:commandButton
                            id="testmodifica"
                            class="mod nocorner modifycard"
                            value="modify"
                            update=":editCardForm"
                            actionListener="#{vcardController.renderModify}" />
                    </p:panel>
                </p:panel>
            </h:form> 

            <h:form id="formReqEdit" class="formReqEdit" style="display: none;">
                <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                <p:commandButton
                    id="requestForm"
                    style="display: none;"
                    update=":viewCardForm"
                    oncomplete="contactsDOMAction.showCard(xhr, status, args)"
                    actionListener="#{vcardController.activateModifyCard}" />   
            </h:form> 
1
How you fire the button action??? Display:none?? Can put more information?? - Rafa Hernández
@RafaHernández from javascript code I select requestForm and fire click event to fire button action $("#requestForm").click() - LukeT
Sorry, I make a mistake writing the post. I correct it now. - LukeT

1 Answers

1
votes
  1. If you want render "editCardForm" you must put "editCardForm" in update parameter in command button
  2. Good practice is add "process". Then you are sure what data from components will be send to bean, in your case process="@this" if you want only call action listener.

  3. Rafa Hernández says right, how you want press button if it has display:none?