If there is a need to add custom html content inside a form, only the
following choices are available:
Without using the single-form feature build the whole content using direct html text (render-mode/text)
Use single-form widget to build the form. Use javascript jQuery(document).ready to override / insert the parts of html that needs to be built.
Both these options are convoluted and do not employ the power of widgets
completely. Instead, if we are able to insert render-mode/text within a form,
it would be a good enhancement.
Is there any other solution that I am unable to see, that can be employed?
-Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is another solution: have two single-form elements, the first with skip-
end, and the second with skip-start and the HTML included or inlined between
them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for explaining the skip-start and skip-end attributes. I overlooked
them completely. I think it certainly solves the problem.
But, wouldnt allowing render-mode/text inside a form be a simpler solution (to
the developer) than having 2 form definitions. This solution also makes the
form definition more readable. Do you foresee any downside of allowing this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In commit 3761087 I made some small changes to allow this. As I mentioned
elsewhere, because of the way the FTL transformation of the XML screens and
forms work, you can put these widgets anywhere, even if not supported in the
XSD which is a little more constrained. You can even add a macro to the FTL
file (or an extended one configured in the moqui-conf XML file) and not add it
to the XSD and it will work fine. The XML validation will complain, but it
will still work fine.
There was also a small fix needed for this in a utility method that does a
deep copy of Groovy Node objects so that it supports text under a node (which
was breaking before).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If there is a need to add custom html content inside a form, only the
following choices are available:
Both these options are convoluted and do not employ the power of widgets
completely. Instead, if we are able to insert render-mode/text within a form,
it would be a good enhancement.
Is there any other solution that I am unable to see, that can be employed?
-Thanks
There is another solution: have two single-form elements, the first with skip-
end, and the second with skip-start and the HTML included or inlined between
them.
Thanks for explaining the skip-start and skip-end attributes. I overlooked
them completely. I think it certainly solves the problem.
But, wouldnt allowing render-mode/text inside a form be a simpler solution (to
the developer) than having 2 form definitions. This solution also makes the
form definition more readable. Do you foresee any downside of allowing this?
This is a good idea Vasanth.
In commit 3761087 I made some small changes to allow this. As I mentioned
elsewhere, because of the way the FTL transformation of the XML screens and
forms work, you can put these widgets anywhere, even if not supported in the
XSD which is a little more constrained. You can even add a macro to the FTL
file (or an extended one configured in the moqui-conf XML file) and not add it
to the XSD and it will work fine. The XML validation will complain, but it
will still work fine.
There was also a small fix needed for this in a utility method that does a
deep copy of Groovy Node objects so that it supports text under a node (which
was breaking before).