hardcode values in paragraph field

Certified Associate Developer

Hi, 

I have a paragraph field. I need to hardcode a value, with the below code, the user can change the value. When I used the a!richtextdisplayfield, I was getting an error. 

Can someone pls guide here. 

a!paragraphField(
label: "Rejection Comment",
value: "REJECTION " & local!comment,
saveInto:  local!comment,
)

  Discussion posts and replies are publicly visible

Parents
  • When I used the a!richtextdisplayfield

    because a!richTextDisplayField() is a read-only component.

    value: "REJECTION " & local!comment,

    So if you were trying to make it a READ-ONLY paragraph field, this would be an OK way to DISPLAY the value.  However it's a bit more tricky if you want the text to show up in the field as a default but then save only the user input that follows that value - because, when "REJECTION " is included in the "value" field, that text populates into the user entry, and then it flows to the saveInto when the user changes the value of the field, so any time the user touches it, it'll save a redundant "REJECTION " at the front of the message.

    There are ways around this involving manual work inside the saving, but honestly I fear it's just going to cause more confusion.

    This makes me ask though, why the redundant "REJECTION" label *inside* the field value?  What's wrong with using the... "label" as the label?  What value does it add to have the word again?

Reply
  • When I used the a!richtextdisplayfield

    because a!richTextDisplayField() is a read-only component.

    value: "REJECTION " & local!comment,

    So if you were trying to make it a READ-ONLY paragraph field, this would be an OK way to DISPLAY the value.  However it's a bit more tricky if you want the text to show up in the field as a default but then save only the user input that follows that value - because, when "REJECTION " is included in the "value" field, that text populates into the user entry, and then it flows to the saveInto when the user changes the value of the field, so any time the user touches it, it'll save a redundant "REJECTION " at the front of the message.

    There are ways around this involving manual work inside the saving, but honestly I fear it's just going to cause more confusion.

    This makes me ask though, why the redundant "REJECTION" label *inside* the field value?  What's wrong with using the... "label" as the label?  What value does it add to have the word again?

Children