shale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Spencer <pau...@apache.org>
Subject [dialog] How to use a common view with different dialog managed beans?
Date Fri, 25 Aug 2006 21:21:25 GMT
An advantage with the current dialog.data bean is that it allows a the 
use of a common view when the underlying data objects are different. How 
would this be done with dialog managed beans?


As an example the AbstractPayment class has a CreditCard and a Check 
implementation.  Both the "Pay By Check" and "Pay by CreditCard" share a 
common view that collects the billing address information. In the 
current implementation, that view uses #{dialog.data.billingZipCode} to 
pass the billing zip code regardless of the actual class.  With dialog 
managed beans their will be a check and creditCard bean so how would the 
billing zip code be referenced in the common view?  So unless their is a 
way to alias the beans in the dialog configuration, the billing address 
view can not be shared.

Dialog configuration show the common view getBillingAddress.

<dialog name="Pay By CreditCard" start="getBillingAddress">
    <view name="getBillingAddress" viewId="/getBillingAddress.jsp">
      <transition outcome="next" target="getCreditCardNumber"/>
    </view>
    <view name="getCreditCardNumber viewId="/getCreditCardNumber.jsp">
      <transition outcome="next" target="processPayment"/>
    </view>
    <action name="processPayment" method="#{creditCard.processPayment}">
      <transition outcome="success" target="paymentAccepted"/>
      <transition outcome="rejected" target="paymentRejected"/>
    </action>
    <end name="paymentAccepted" view="/paymentAccepted.jsp"/>
    <end name="paymentRejected" view="/paymentRejected.jsp"/>
</dialog>
<dialog name="Pay By Check" start="getBillingAddress">
    <view name="getBillingAddress" viewId="/getBillingAddress.jsp">
      <transition outcome="next" target="getAccountNumber"/>
    </view>
    <view name="getAccountNumber viewId="/getCheckingAccountNumber.jsp">
      <transition outcome="next" target="processPayment"/>
    </view>
    <action name="processPayment" method="#{check.processPayment}">
      <transition outcome="success" target="paymentAccepted"/>
      <transition outcome="rejected" target="paymentRejected"/>
    </action>
    <end name="paymentAccepted" view="/paymentAccepted.jsp"/>
    <end name="paymentRejected" view="/paymentRejected.jsp"/>
</dialog>


Paul Spencer

Mime
View raw message