Results 1 to 5 of 5

Thread: spring-webflow-2.0.xsd schema changes for binder

  1. #1
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default spring-webflow-2.0.xsd schema changes for binder

    Hi,

    Let say I have 10 variable and 2 are required field. When I use the binder I have to explicitly bind all 10 variable. Instead can we have bindAll=true attribute in binder. By default it may false. This will avoid to manual binding!

    Something like this,
    <binder bindAll="true">
    <binding property="variable1" required="true"/>
    <binding property="variable2" required="true"/>
    </binder>

    This should be bind all form fields instead only two. Any thoughts!!

    Thanks.

  2. #2
    Join Date
    Apr 2010
    Location
    Kharkov, Ukraine
    Posts
    52

    Default

    Could you specify more precisely what your question is. If you want to bind 8 variables and let 2 unbind then I think you don’t have many choices: just bind 8 of them with binder tag like this:
    Code:
    <binder>
        <binding property="prop1" required="true"/>
        <binding property="prop2" required="false"/>
        ...
        <binding property="prop8"/>
    </binder>
    Regards,
    Denis

  3. #3
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default

    Well, I am lazy and I want the binder should take care to bind all the variable (which is mapped in jsp) without explicitly binding.

    If you want to add/delete more attributes, you have to do in model object and jsp and no need to touch flow xml. Is it make sense!

  4. #4
    Join Date
    Apr 2010
    Location
    Kharkov, Ukraine
    Posts
    52

    Default

    If you want to bind all model's variables, what prevents you from specifying your model in 'model' attribute like this
    Code:
    <var name="myModel" class="your.model.ClassName"/>
    ...
    <view-state id="myView" model="myModel">
    ...
    </view-state>
    It will bind all properties of 'myModel' into your view.
    Regards,
    Denis

  5. #5
    Join Date
    May 2009
    Posts
    5

    Default

    I think the point is that it is far easier to specify a small number of fields to bind than to specify a small number of fields to not bind.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •