[JBoss Seam] - Re: Starting arbitrary jPDL pageflows from a
by IGx89
Well, I found out that Seam does allow multiple elements inside a root element, but only if they're in the right order! For instance, this doesn't work:
| <rule if-outcome="FP1">
| <redirect view-id="page1.xhtml" />
| <begin-conversation join="true" pageflow="PF1" />
| </rule>
|
but this does:
| <rule if-outcome="FP1">
| <begin-conversation join="true" pageflow="PF1" />
| <redirect view-id="page1.xhtml" />
| </rule>
|
So, with that discovery, I was able to greatly reduce the configuration needed, to the point that I'm pretty much satisfied now :). Only unfortunate things are that I still need a controller JavaBean to force the navigation rules to be evaluated on page load and that beginning a pageflow doesn't automatically redirect to its start-page.
The solution:
| <page view-id="/controller.xhtml" action="#{controller.getFlow}">
| <param name="flow" value="#{controller.flow}" />
|
| <navigation>
| <rule if-outcome="PF1">
| <begin-conversation join="true" pageflow="PF1" />
| <redirect view-id="page1.xhtml" />
| </rule>
| <rule if-outcome="PF2">
| <begin-conversation join="true" pageflow="PF2" />
| <redirect view-id="page1.xhtml" />
| </rule>
| <rule if-outcome="PF3">
| <begin-conversation join="true" pageflow="PF3" />
| <redirect view-id="page4.xhtml" />
| </rule>
| </navigation>
| </page>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074918#4074918
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074918
18Â years, 11Â months
[JBoss Seam] - Re: DataModal and a4j:support
by mrohad
I've 2 problems
1)when I'm calling selectCustomerFromTable i am always getting the first row
2) when I calling the update method updatecustomer is empty...
any idea?
| @Scope(ScopeType.CONVERSATION)
| @Name("customerList")
| public class CustomerList extends EntityQuery {
|
| private static final String[] RESTRICTIONS = {
| "lower(customer.name) like concat(lower(#{customerList.customer.name}),'%')",
| "lower(customer.shortName) like concat(lower(#{customerList.customer.shortName}),'%')",
| "lower(customer.address) like concat(lower(#{customerList.customer.address}),'%')",
| "lower(customer.address2) like concat(lower(#{customerList.customer.address2}),'%')",
| "lower(customer.phoneNumber) like concat(lower(#{customerList.customer.phoneNumber}),'%')",
| "lower(customer.phoneNumber2) like concat(lower(#{customerList.customer.phoneNumber2}),'%')",
| "lower(customer.fax) like concat(lower(#{customerList.customer.fax}),'%')",};
|
| private Customer customer = new Customer();
| @DataModel
| List<Customer> customers = null;
| public List<Customer> getCustomers(){
| customers = (List<Customer>) getResultList();
| return customers;
| }
|
| private Customer updateCustomer = new Customer();
| @Override
| public String getEjbql() {
| return "select customer from Customer customer";
| }
|
| @Override
| public Integer getMaxResults() {
| return 25;
| }
|
| public Customer getCustomer() {
| return customer;
| }
|
| @Override
| public List<String> getRestrictions() {
| return Arrays.asList(RESTRICTIONS);
| }
| public void selectCustomerFromTable(ActionEvent event){
| int x = 1;
| updateCustomer = (Customer) getDataModelSelection();
| }
|
|
| public Customer getUpdateCustomer() {
| return updateCustomer;
| }
| public void update(ActionEvent event){
| getEntityManager().persist(updateCustomer);
| getEntityManager().flush();
| }
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074915#4074915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074915
18Â years, 11Â months