I'm encountering a problem whereby i have fields in a form that has variable naming in the name attributes that need to pass into a service, but can't do so because i can't define it in the services.xml
The scenario is that, i have a major form, and there's this sub section of fields that are added to it through ajax. These fields represent one set of data and they are not compulsory, meaning some of the fields may be empty. Example, in the added fields, i have a field of ID, amount and cheque no. The user can choose to fill in ID and amount but not the cheque no. There can be multiple rows of IDs, amounts and cheque nos added to the major form.
At first i name all these fields using the same name, and i pass them to the service as a List. It works great until i found that if i don't fill in the cheque no, the cheque no list will actually be null and not a List with an empty string. This is causing me issue to map them correctly in the service.
Then i tried to use the old school method, namely having a counter in a hidden field and have them named with a suffix that representing the counter. And then i found that i can't dynamically define the attributes in the services.xml
Does anyone encounter such issue before? Any advise or help?
The workaround that i used to solve this is by adding a Event Class to filter the request before calling the service to do the actual processing. This way I can get the parameters in raw form and doesn't rely on Ofbiz service definition to get the values for me.