[
http://issues.apache.org/jira/browse/OFBIZ-364?page=comments#action_12443779 ]
Jacopo Cappellato commented on OFBIZ-364:
-----------------------------------------
David,
I'd like to correct the patch I've committed following your suggestions.
If we add a new attribute called "override-list-size" to the form definition,
we could have something like this:
<form name="ExampleForm" type="list" list-name="records"
override-list-size="100">
In this way we will have a constant value set (not very useful, but maybe it
could under some circumstances).
But if I need to pass a parametrized value, how should I do this? Maybe in this
way:
<form name="ExampleForm" type="list" list-name="records"
override-list-size="${manualListSize}">
and then put in the context something like this:
context.put("manualListSize", new Integer(iterator.currentIndex()));
?
Is this that you mean? If so, I'll try to implement it (I think it is just a
matter of adding the new attribute to the xsd definition and using a
flexibleString to store the value).
Just one doubt about this approach: if I'm not wrong the form definition is
cached into memory the first time the form is loaded from the xml file... could
this make difficult to make the override-list-size a dinamic value ? (maybe not
now that I think a bit more about this)
Thanks
> Let form widget treat input list as a subset of a larger list
> -------------------------------------------------------------
>
> Key: OFBIZ-364
> URL: http://issues.apache.org/jira/browse/OFBIZ-364
> Project: OFBiz (The Open for Business Project)
> Issue Type: Improvement
> Components: framework
> Reporter: Leon Torres
> Assigned To: Jacopo Cappellato
> Priority: Minor
> Attachments: subset-form-list.patch
>
>
> Allow a programmer to specify a parameter "overrideFormListSize=1000" to make
> the FormWidget think the list size is 1000.
> Then, when a list of size 20 is passed in, the FormWidget treats it as a
> subset of the size 1000 list with its position given by viewIndex as usual.
> As an example, suppose a complex product report requires the user to process
> each product by hand. There are 1000 products and the viewSize is 20. The
> user gets the viewIndex of 10 from the context, so he should be processing
> the range (200, 219). He builds a new list containing the processed data,
> which is size 20. Since this list is only 20 items, the form widget thinks
> the entire report is 20 lines. There won't be pagination over the 1000
> products. So the user specifies "overrideFormListSize=1000" and now the
> FormWidget understands that this input list of 20 items are the items (200,
> 219) of a size 1000 list.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira