Generating dynamic forms with grails - grails

Using Grails 2.3.5 and try to make a dynamic form like described in link below:
http://omarello.com/2010/08/grails-one-to-many-dynamic-forms/
But when access the create, none phone field are shown.
I've copied exactly like the example. I don't know if there are some kind of conflicts with the javascript or something else.

Related

How to use vitejs app and ant desing ui framework without poluting global styles

With assumption I cannot simply get rid off antd (but definitely going to at first opportunity) is there any way how to keep antd from polluting global css with as little code modifications as possible or with code modifications which could be done with any mass code edit tool (search and replace, rollup plugin)?
As you could have guessed if you follow official guide on how to use antd you will pollute your global styles which becomes problem when you have routes in your app each using different ui framework like having /admin route or something similar and whenever you navigate from non-admin to admin route the admin app will load with polluted global styles.
There are many people with this exact problem, multiple issues, multiple proposed solutions which all have any combination of: not working, uses webpack (vite uses rollup), written in Chinese, links to dead repo, or requires you to modify basically every file you have.
I don't think you could link me to any existing google search hit I don't know about so I would really like to get an answer from someone who has this solved in some reasonable way with up to date dependencies and so on.

How to upload a file in Grails 3

Grails 2 had a plugin for that, there also used to be
request.getFile
method. There is no method like this in Grails 3 as far as I can see, or a plugin.
I tried using
request.getInputStream
But this one is always empty. Other thing I tried was by using Spring-boot way of handling Uploads, but this one relies on
#RequestParam("file") MultipartFile file
It cannot be used in Grails, controllers there do not allow parameters to be defined this way AFAIK.
How to upload files in Grails 3?
Actually there is
request.getFile(fileName)
in Grails 3 as well. It was just not displayed in autofill in my IDE for some reason (the rest of the request methods like getParameters or isPost are displayed correctly).

maxSize validation for <g:textarea ... />

when grails creates view, it automatically adds a maxLength attribute to text fields. This is great because users will not be able to input a string which is longer than the contraint. This helps to avoid getting an error message...
however, if you try the same with a textarea, grails will not place such a contraint in the html code. I know: html has no maxLength for textareas. But there are many javascript based solutions out there which even show how many characters are left...
Does anybody know of a plugin which adds this feature?
PS: I am speaking of Grails 1.3.7 - don't know if a newer version already implements this.
I don't know of a Grails plugin that does this. There are many JQuery plugins that provide this feature, but if you use one of those you'll need to devise some mechanism for keeping the domain constraints in synch with the JavaScript (or do it manually).

Grails global styling

I was wondering how one would apply a global stylesheet to their entire site? I want to add twitter bootstrap, and a select number of other global styles, so that all the visuals are consistent.
Would I add a <link> to the layouts/main.gsp file?
UPDATE
Seems it's the css/main.css file that I'm interested in. Along with the layouts/main.gsp's reference to it. Could someone confirm this?
By default grails will use the "main" layout for scaffolding. So yes, those are the two files you are interested in.

Adding html form and input tags into Symfony static pages

I inherited the management of a Symfony site and need to add some HTMl form tags to one of the "static" pages via the CMS. The scenario I have is:
/index.php/splash/welcome pulls up the welcome screen.
We want to be able to add a subscription button on that page.
The HTML has been supplied for us by the company that handles the subscriptions.
The form post method has an action that references a script on a remote site (no lectures on the security implications please ;-).
When I add the <form... and <input... tags via the CMS admin panel, the tags get removed automatically by Symfony.
Is there a way to tell Symfony to allow these tags?
Thanks in advance,
Marty.
This is goign to depend completely on how the developer set up the CMS. Youre using a rich text editor in source mode i would take a look at that editor's config file and documentation because its probably the one responsible for stripping the tags.
If its just a plain text area i would check the submit action for the edit form and take a look at the code... he may be using something to strip them in there.
If youre using one of the Symfony CMS plugins (Diem, Apostrophe, Sympal) i might be able to help further if i know which one youre using. If its something custom we would need to see the code. This isnt really indiciative of the Symfony core, but rather the CMS youre using.

Resources