The app I had attached in the preceding email works, but it broke the workflow. I can't get the added inputs values in form.vars, so I take them from request.vars or somewhere else don't remember...
There is also an other problem with this hack... It not uses de validators for all the inputs... So as long as there is one filled input the form submit and the other added inputs will let pass empty value or if you prefer NULL will be inserted.
But at least you will be able to add all the field you want no matter how many field the subform contain... Remove the added field you no more want if you add to much inputs.
Submit and the data will be all linked or related to the id of the record of the "master" table or the base table form.
The jQuery script has to be edited by hand for each subform (or subtable you use). If you modify your subtable (add a field) you will have to go change the jQuery script... I just tried to make a proof of concept and see what were the limits... So nothing fancy with the code. There is also a couple of jQuery lines that were not working properly in this version I think.
Ha yeah there is an other issue on read or update... There is no way to make it works with crud.read or crud.update (I did not try anything about that when I realize I broked the workflow).
Also, there is no way to make SQLFORM.factory works on update or read (edit your linked data)... At least there is no easy already available way. You have to crud.update on subtable and master table independantly to make any change after the first seizure.
I did not have time last week to continue to work on that.
I identified differents alternatives that I did not explored in details yet :
1) There is a "lib" in django for doing exactly that. I don't know django, but the basic (tutorial 1, 2, 3, 4).
2) There is also Pyjamas that could be use into web2py... It seems to me the most cumbersome alternative, since I have to learn many differents things.
3) WTForms... I also have to learn a lot to figure out if it could work with web2py or if it has to be stand alone. If it needs work separately I actualy think to explore if a loosely coupled framework could be more reliable for my needs (Flask, WTForms, WSGI, jinja...)
That where I am...
I appreciate any help to push further the reflexion or build something...