Closed ma-hack closed 7 years ago
use decorator ? not so hard ;)
The generated ui is dynamic and can have multiple password fields. When i use a decorator then i must know before i get the schema which fields are the password fields.
Have you an example how this can be work? I already look over the example: https://github.com/brutusin/json-forms/blob/master/src/js/brutusin-json-forms-bootstrap.js
can u show me your source ? or send to me ?
Sorry, that is not possible because it is a larger JavaEE project with multiple applications. The applications offer an webservice what provides the data as JSON Schema (jackson-mapper). This schema is used in the webfrontend to build a configuration ui to change the settings of this application.
I use in the schema fields like readOnly, title, description, etc. My hope was that it is possible to set something like form:password in the schema and brutusin display the field as password field.
@fabifabi maybe you can show him some examples of decorators, like the ones used for selecting colors or folders?
i never did dynamic schema.....thats' change something of the problem ? if not,i will post it tomorow,i use some plugin for color slecting (spectrum,if u know,very good one !) i need do a more easy sample.
Btw! conrgat,u are in a french magazine this month ;)
BrutusinForms.addDecorator(function (e, s) { var $this = $(e); if (s && s.format === "color") $this.attr("type", "color"); });
with Jquery.
Maybe this example is good for the question too: http://brutusin.org/json-forms/#9 The insight is to add a custom format to the strings, for example "password" and add a decorator that whenever this format is used in a string input, it change the type of the input accordingly
Thanks @fabifabi! You rock man
full agree
2017-07-21 16:43 GMT+02:00 Ignacio del Valle Alles <notifications@github.com
:
Maybe this example is good for the question too: http://brutusin.org/json- forms/#9 The insight is to add a custom format to the strings, for example "password" and add a decorator that whenever this format is used in a string input, it change the type of the input accordingly
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/brutusin/json-forms/issues/97#issuecomment-317019876, or mute the thread https://github.com/notifications/unsubscribe-auth/AYbVLVYV_UMUPaOFztZJxsHxVg6Pox_tks5sQLj_gaJpZM4OfOQC .
Thank you very much for your help! That easy solution works!!
For others just put in the schema a format tag
{"title":"Password", "description":"If authentification is needed than specifiy the password.", "format":"password", "type":"string"}
upper the brutusin js add the decorator
BrutusinForms.addDecorator(function (element, s) { var $this = $(element); if (s && s.format === "password") { $this.attr("type", "password"); } });
I have in the form a field that contains a password. Please, can you integrate support for the html input type option "password"? I look in the documentation but can not found anything about it.
Best regards, Marco