Hello,

In a current project being built on top of Ofbiz I have a form for editing
details of a freight transport job. Each job has multiple roles performed
by different parties - Shipper, Consignee, Agent, BILL_TO_PARTY, etc.

The client required that the party contact details for each role be
editable on the same form as the Job to allow operators to more easily
capture job details.

Building the form using the form widget xml was overly verbose and wasn't a
good solution in cases where multiple parties might hold a role - e.g.
there can be multiple billing parties for a job.

I ended up using FTL macros for rendering each of the roles on the form.

I've started looking at how I might move from the FTL macros back to the
Form Widget, but have run into the problem of duplicate form input names
when including a form multiple times on a screen.

To resolve this I tried using the FlexibleStringExpander for a form field's
parameter name.

I've created a branch here:
https://github.com/danwatford/ofbiz-framework/tree/flexible-form-parameter-name


And a demonstration of how it might be used here:
https://github.com/danwatford/ofbiz-framework/tree/flexible-form-parameter-name-demo

To use the demonstration, build the branch and loadAll demo data.
Run ofbiz and visit https://localhost:8443/partymgr
[image: image.png]

The demo displays 5 Persons and 5 PartyGroups in random order, using a
different included form for each type.

Click on Update
[image: image.png]

The next form shows all the fields that were posted.


Any issues that might come up from using FlexibleStringExpander for
parameter names in this way?

Thanks,

Dan.

--

Reply via email to