[JBoss Seam] - 4N queries for dvdstore admin page/mange orders tab
by DavidInTx
I played with the jbpm integration this week, and I must say, it is fantastic. The ease with which I can just @CreateProcess, @BeginTask, and @EndTask is really nice. There is one thing that could perhaps be improved. I noticed that when viewing processes and tasks, a large number of queries seem to be run. As I developed my code after looking at the dvd store example, I went back to that example, and found the same issue there. In particular, in the dvdstore example, I set the process to 2 (approve all orders) and checked out from the store three different times. Then on the admin page, I clicked on the "manage orders" tab, and saw the three orders under "Task Assigment", which is where they should be. 31 queries were required to show this tab. I checked out one more time, and 35 queries were required to show the tab, and after I checked out one more time, 39 queries were needed.
This seems bad. Would it be possible to modify the dvd store example so that it doesn't run require 4N queries?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068421#4068421
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068421
18Â years, 9Â months
[JBoss Seam] - How can I do this?
by rickhoro2
I'm using Seam 1.2.1 with Glassfish v2b41d.
I have a payment information page as part of my shopping cart checkout process. The top of the page allows the user to input credit card info: card type, card number, exp date, security code. The bottom part of the page allows the user to enter the billing address.
I want to position a pair of radio buttons just above the billing address inputs that allows the user to select whether to use the shipping address as the billing address or not.
I have this working with one problem. If I position the address selector radio buttons above the billing address, it is in the same <h:form> as the credit card info and billing address inputs. When I select one of the radio buttons, the form is submitted by a valueChangeListener (via the onchange="submit()", causing validation errors on the form, e.g. the credit card info and billing address input fields).
I tested this by coding another <h:form> below the <h:form> used to submit the actual credit card info and billing address, and it works perfectly, except that the address selector radio buttons are in the wrong place on the page. :(
Is there a way to either disable validation (such as immediate="true") for the entire <h:form> when the user selects one of the address selector radio buttons, or alternatively, to position the radio buttons in the right place on the page (just above the billing address inputs), even though they're in a different <h:form>?
I want the page to look like this:
<Credit card info inputs>
<Address selector radio buttons>
<Billing address inputs>
Thanks very much... the JSF page code is listed below....
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <body>
| <ui:composition>
| <h1>Step 2: Payment Information</h1>
| <h4>Your credit card will not be processed for payment until you review the order details and press Submit in the next page.</h4>
|
| <f:subview rendered="true">
| <h:form>
| <s:validateAll>
| <h2>Card Details</h2>
| <h:panelGrid columns="3" styleClass="dataEntryGrid" columnClasses="dataEntryLabel, dataEntryComp, dataEntryErrorMsg">
|
| <h:outputLabel for="cardType" value="Card Type" />
| <h:selectOneMenu id="cardType" value="#{creditCard.cardType}" required="true" requiredMessage="Card Type is required.">
| <f:selectItem itemLabel="AMEX" itemValue="AMEX"/>
| <f:selectItem itemLabel="MASTER" itemValue="MASTER"/>
| <f:selectItem itemLabel="VISA" itemValue="VISA"/>
| </h:selectOneMenu>
| <h:message for="cardType" styleClass="error" />
|
| <h:outputLabel for="cardNumber" value="Card Number" />
| <h:inputText id="cardNumber" label="Card Number" value="#{creditCard.cardNumber}" maxlength="16" size="30"
| requiredMessage="Card Number is required." />
| <h:message for="cardNumber" styleClass="error" />
|
| <h:outputLabel for="expirationDate" value="Expiration Date (MM/YY)" />
| <h:inputText id="expirationDate" label="Expiration Date (MM/YY)" value="#{creditCard.expirationDate}" maxlength="5" size="5"
| requiredMessage="Expiration Date is required." />
| <h:message for="expirationDate" styleClass="error" />
|
| <h:outputLabel for="securityCode" value="Security Code" />
| <h:inputSecret id="securityCode" label="Security Code" value="#{creditCard.securityCode}" maxlength="4" size="5"
| requiredMessage="Security Code is required." />
| <h:message for="securityCode" styleClass="error" />
|
| </h:panelGrid>
| </s:validateAll>
|
| <h2>Billing Address</h2>
|
| <ui:include src="address.xhtml">
| <ui:param name="address" value="#{creditCard.paymentAddress}"/>
| </ui:include>
|
| <h:commandButton action="customerInfo" value="Back" style="margin:10px"/>
|
| <h:commandButton action="#{shoppingCartBean.processPaymentInformation}"
| value="Continue"
| style="margin:10px"/>
|
| </h:form>
| <h:form>
| <h:selectOneRadio id="addressRadio"
| value="#{shoppingCartBean.addressOption}"
| immediate="true"
| valueChangeListener="#{shoppingCartBean.addressOptionSelected}"
| onchange="submit()">
| <f:selectItem itemValue="sameAsShipAddress" itemLabel="Same as Shipping Address"/>
| <f:selectItem itemValue="differentFromShipAddress" itemLabel="Other"/>
| </h:selectOneRadio>
| </h:form>
| </f:subview>
| </ui:composition>
| </body>
| </html>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068420#4068420
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068420
18Â years, 9Â months