I am also confused on the purpose of the field. If you are not saving the calculated value anywhere, it can't show up anywhere else. It would just show up on your content edit screen and cease to exist when you close the edit window.
Every custom field has a hidden HTML element associated with it to store a value if you so desire. Setting this value must be done in JavaScript.
In this example I have a select box in my custom field. I then have to manually save the value of the select box into the hidden field that stores a value for the custom field.
groupIds -> this is the Velocity variable for the custom field.
#groupIds_field -> this is the div where dotCMS puts your custom field output. (My select element lives in here.)
#groupIds -> this is the hidden field where the value is saved.
jQuery save code snippet:
/* When new option is selected, copy multi-select value to the hidden field. */
$( "#groupIds_field select" ).change( function() {
$( "#groupIds" ).val( $(this).val() );
});
From:
dot...@googlegroups.com <
dot...@googlegroups.com> on behalf of Mark Orciuch <
mark_o...@ngsltd.com>
Sent: Tuesday, April 13, 2021 11:19 AM
To: dotCMS User Group
Subject: Re: [dotcms] Custom Field marked as Show in List
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Thanks everyone for the great feedback! My custom field is a calculated field (not saved with the contentlet). Are you saying that I need to save it with the contentlet in order to be displayed in the list view? Kind of like with URL Title where the field gets "recalculated" when any of the dependent fields change?
On Tuesday, April 13, 2021 at 6:28:23 AM UTC-5 Chris Falzone wrote:
I was going to say that I didn't think you could do that with custom fields, but now that I look -- we have some custom fields shown on the listing. Should work. When you pull the content is the value actually getting set on the contentlet? Like maybe the edit screen is displaying it based on the logic in the custom field, but isn't actually setting the value back to the field that gets saved to the contentlet. Like a urlTitle field, sometimes I have a fake "display field" that the user can interact with (or not) but the JS has to actually save that value back to the hidden field because that is what gets saved to the contentlet in the database. If it doesn't, the logic to display the value still triggers on the edit screen so it appears that the value is set but in reality it is not.
Hope that makes sense.
On Mon, Apr 12, 2021 at 7:49 PM Mark Orciuch <
mark_o...@ngsltd.com> wrote:
Hello,
I created a custom field called Full Name which is a concatenation of First and Last Name fields. I marked Full Name as Show in List.
In detail view, the Full Name is shown correctly.
In list view, there is nothing shown in the Full Name column.
Are such computed custom fields not supported in list views? Is there another technique that I could use? Many thanks in advance.
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,3qJYkcTG3e744GFXmQfhHI3LSPooOS5P79g4cIaNAJBn55SmxXmwnNXbJe8fWPrqjjgnAKPTik_pyTFCS4c4lpNxrjvlgouEVPwnEn4HvxQdnL_7IFMhWA,,&typo=1> - 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+un...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/230c1b07-6053-4577-bf77-cd5574210a29n%40googlegroups.com<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f230c1b07-6053-4577-bf77-cd5574210a29n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,kP1hXpJNTUcv-iW470qZYSAEnx3qFJV7wWgGVZhQMMS3Kuih7zLCBiCMLzTUnf5DWWECACdSXArMHYmYnPm_s110Y3uoxFUFTomy-io5&typo=1>.
--
Christopher Falzone
DevOps Engineer
A Q U E N T / VITAMIN T<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2faquent.com&c=E,1,IbVh2driM2u6Tu267oQX7TcSa8hK3olrIjVH-PORTgf5VF8HNgmWisAyvcppLRscS5TJwOybFnyBzqB7zEMdIWBCdP0BrB0AMAdeqqpkJxegMTeax9sisNzZ8A,,&typo=1>
--
http://dotcms.com<
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,JZ0OjFTgkv238bLdnGwkAQaTpsiGIyOzMpMU4n6RzGHy42H7SOStp8HpEtAh8hygkQ2rq9JbyYXDjREQcyQOUMruyd6Gn98zzND6DlP6-jgGLF9DAtC1BNPwyoj1&typo=1> - 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+un...@googlegroups.com<mailto:
dotcms+un...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dotcms/20e6ab01-00b2-4f52-aa29-86f4d2db4d26n%40googlegroups.com<
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f20e6ab01-00b2-4f52-aa29-86f4d2db4d26n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,d_Yq3hMx86x9cE8g7VBeMwame-Dqw5-XlWr9sCegGY7z53HYu3YpG9YvlC-ZAwj_oeUEIIYDTqOrgOJ8T2sNvqYshHOKN12XKevvvCvD_tROWLf0JO_dxp8,&typo=1>.