Hello,

  I have a problem in which I have a pageflow with a form bean that has several properties, one of which is an array: String[].  In a form on my JSP I use databinding to allow the user to edit every property EXCEPT that array property.  It is edited on a separate form.  I tried to use hidden inputs to databind to the String[] property so it won’t be null in the form bean passed to the edit action in my pageflow:

 

        <netui-data:repeater dataSource="actionForm.persistedEventTypes">

            <netui-data:repeaterItem>

                <netui:hidden dataSource="container.item" />

            </netui-data:repeaterItem>

        </netui-data:repeater>

 

It looks good in the generated HTML source:

        <input type="hidden" name="serviceAdminBehaviorTrackingDetailsPortlet{actionForm.persistedEventTypes[0]}" value="AddToCartEvent">

        <input type="hidden" name="serviceAdminBehaviorTrackingDetailsPortlet{actionForm.persistedEventTypes[1]}" value="BuyEvent">

        …

        …

        …

        <input type="hidden" name="serviceAdminBehaviorTrackingDetailsPortlet{actionForm.persistedEventTypes[15]}" value="UserRegistrationEvent">

           

              

 

During databinding, I get an ArrayIndexOutOfBoundsException because it thinks the array is empty.  I tried a few experiments:  I changed the String[] to a List<String> in my get/set methods in my bean and see basically the same problem:

 

     [exec] [ERROR] ProcessPopulate - NetUI Warning: Unable to update _expression_

 "{actionForm.persistedEventTypes[15]}".  The typical cause is that the object represented by the _expression_ is not available or is the wrong type for updating.

  Cause: org.apache.beehive.netui.script.ExpressionUpdateException: Exception when attempting to update the _expression_ "{actionForm.persistedEventTypes[15]}" with available binding contexts [actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException: An error occurred setting a value at index "15" because the list is of size 0.  Be sure to allocate enough items in the List to accomodate any updates which may occur against the list.

 

For now, I am going to work around it by not using databinding for this property.  Am I doing something wrong, or is this a bug?

 

Thanks.

 

 


 

Ture Hoefner
WebLogic Portal Engineering 

BEA Systems, Inc.
4001 Discovery Drive

Suite 340
Boulder, CO  80303
www.bea.com

 

 

Reply via email to