Set value with FieldBuilder

43 views
Skip to first unread message

dile...@gmail.com

unread,
Sep 13, 2017, 4:22:14 AM9/13/17
to dotCMS User Group
Hey,

In my dynamic plugin I'm constructing some fields, such as custom fields, with FieldBuilder*. However, I'm only able to set the default value of this field and not the current value (the large textarea in the image below).

My current code looks as follows

Field permission = FieldBuilder.builder(CustomField.class)
                                                            .dbColumn(DataTypes.LONG_TEXT.value)
                                                           .name("Test Custom Field")
                                                            .variable("testCustomField")
                                                           .defaultValue("Value set by FieldBuilder")
                                                           .sortOrder(1)
                                                          .build();


This results in the following


The deprecated com.dotmarketing.portlets.structure.model.Field contains a setValues() method that can be used to set the value of the 'Value' textarea. See https://dotcms.com/docs/4.1.0/javadocs/com/dotmarketing/portlets/structure/model/Field.html#setValues-java.lang.String-

Can anyone tell me how I can set the 'Value' textarea with the FieldBuilder class?

Thank you!

Will Ezell

unread,
Sep 13, 2017, 9:22:06 AM9/13/17
to dot...@googlegroups.com
Ack, it looks like the builder interface does not provide that method - but the implementations do.  We use them internally, e.g.


We will get that fixed but in the meantime you can use the concrete impl.


--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/6d506f18-24eb-42af-952d-09caba466971%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--



3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

   
Reply all
Reply to author
Forward
0 new messages