Reply To: Form action problem

Splash Forums PrettyFaces Users Form action problem Reply To: Form action problem

#27183

Ildar
Participant

JSF form

<form id="paymentForm" action="https://demomoney.yandex.ru/eshop.xml">
            <ui:decorate template="#{cc.attrs.decorator}">

                <ui:define name="payment-form">
                    <input name="shopId" value="#{incareerPaymentComponent.shopID}" type="hidden"/>
                    <input name="scid" value="#{incareerPaymentComponent.siteID}" type="hidden"/>
                    <input name="shopSuccessURL" value="#{incareerPaymentComponent.shopSuccessURL}" type="hidden"/>
                    <input name="shopFailURL" value="#{incareerPaymentComponent.shopFailURL}" type="hidden"/>
                    <input name="customerNumber" value="#{cc.attrs.currentUser.uuid}" type="hidden"/>
                    <h:panelGroup id="order_id">
                        <input name="sum" value="#{incareerPaymentComponent.getCostWithDiscount()}" type="hidden"/>
                        <input name="serviceTitle" value="#{incareerPaymentComponent.getServiceTitle()}" type="hidden"/>
                        <input type="hidden" name="orderNumber" value="#{incareerPaymentComponent.getPaymentServiceUUID()}"/>
                    </h:panelGroup>

                    <ui:fragment rendered="#{not empty cc.attrs.currentUser.email}">
                        <input name="cps_email" value="#{cc.attrs.currentUser.email}" type="hidden"/>
                    </ui:fragment>
                    <ui:fragment rendered="#{not empty cc.attrs.currentUser.phone}">
                        <input name="cps_phone" value="#{cc.attrs.currentUser.phone}" type="hidden"/>
                    </ui:fragment>
                </ui:define>

                <ui:define name="payment-type">
                    <ui:repeat value="#{incareerPaymentComponent.getAvailablePaymentType()}"
                               var="paymentType">
                        <label>
                            <input type="radio" name="paymentType" value="#{paymentType.getCode()}"
                                   onclick="this.checked = true;
                                           createOrder();"/>
                            <span class="img-overlay">                             
                                <h:graphicImage
                                    name="#{paymentType.image}"
                                    alt="#{paymentType.getDescription()}"
                                    title="#{paymentType.getDescription()}"/>
                            </span>
                        </label>
                    </ui:repeat>
                </ui:define>

            </ui:decorate>

            <script type="text/javascript">
                function submitForm() {
                    $("#paymentForm").submit();
                }
            </script>

        </form>

        <h:form>
            <p:remoteCommand
                name="createOrder"
                actionListener="#{incareerPaymentComponent.createOrder(cc.attrs.currentUser, null)}"
                update=""
                process="@this"
                oncomplete="submitForm();"/>
        </h:form>