Announcement Announcement Module
Collapse
No announcement yet.
Custom binding in Spring Webflow 2.3 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom binding in Spring Webflow 2.3

    Hello all.

    I've got a problem with the binding of a property which value is a data model object that is not yet saved to DB and as no identifier set.

    To clarify the situation I'll explain the usecase in detail. I have the following data model (I've left out unnecessary parts):

    Code:
    public class Contract {
    	...
    	List<BudgetAssignment> budgetAssignments;
    	...
    }
    
    public class BudgetAssignment {
    	...
    	Project project;
    	BigDecimal amount;
    	...
    }
    
    public class Project {
    	...
    	Long id;
    	String name;
    	...
    }
    I have a flow that is used for creating and editing Contract entities. The form looks like this: Attachment . When creating or editing contract I can create a project so I can assign him a budget. I use another flow for this and call it as a subflow which returns a Project object. This newly created project is saved in memory in flow scoped command object and will be saved to DB when the contract is saved.

    The problem here is how to bind a project property of the budget assignment row? I cannot use id for option value because it's null. I also cannot use index of the list from which I populate dropdowns because it's in the flow scope and I cannot access that flow context in custom converters (which are deprecated in this version of SWF).

    Any ideas?

    BTW, I'm using plain JSP without JSF, Webflow 2.3 and Spring 3.1.M1.
    Attached Files
Working...
X