Copy link to clipboard
Copied
Hi,
How can I make the fill color of the following field blue? I tried "fillcolor: color.blue" but it did not work.
{
type: "static_text",
item_id: "sta8",
name: "Filename Preview:",
font: "palette",
fillcolor: color.blue
},
{
type: "edit_text",
item_id: "Exmp",
width: 300,
height: 65,
char_width: 8,
multiline: "true",
readonly: "true",
},
1) setForeColorRed() takes a string as a parameter, not an object and will only work when it is added to the initialize function of the dialog . The string is the item id of the element you want to be red. Please see my example higher up in the thread. If you don't have an initialize function, you need to create one.
2) It would be helpful if you posted the code for the entire dialog. With dialogs, it too hard to diagnose problems from snippets.
Copy link to clipboard
Copied
You're lucky you wanted red. Red is the only color you can use other than black. In your initialize function add the following line. Adjust the item_id to meet your needs.
dialog.setForeColorRed("sta8");
Copy link to clipboard
Copied
Hi,
I can't get it to work still. The Item ID is "Exmp."
function DoSetDocNumberFn(dialog, oDlg)
{
var oRslt = dialog.store();
var strExample = oRslt["LPfx"];
dialog.setForeColorRed("Exmp");
dialog.load({"Exmp":strExample});
DoSetFileName(dialog,oDlg);
}
It still shows up as black text.
Copy link to clipboard
Copied
You have the line right but as I stated in my answer, the code must be added to the initialize function of the dialog.
Like this...
initialize: function (dialog)
{
dialog.setForeColorRed("Exmp");
},
There might be other code in initialize as well. My example is just the simplest case.
Copy link to clipboard
Copied
Hi,
Does anyone know why this is still not working? I tried the following, which is differnet from yesterday. It loads but there is no change in color.
dialog.setForeColorRed({"Exmp":strExample});
dialog.load({"Exmp":strExample});
Sue
Copy link to clipboard
Copied
1) setForeColorRed() takes a string as a parameter, not an object and will only work when it is added to the initialize function of the dialog . The string is the item id of the element you want to be red. Please see my example higher up in the thread. If you don't have an initialize function, you need to create one.
2) It would be helpful if you posted the code for the entire dialog. With dialogs, it too hard to diagnose problems from snippets.
Copy link to clipboard
Copied
Oh, I see. Thx for your help. Next time I will post the entire dialog.
Copy link to clipboard
Copied
Den er Grei
Find more inspiration, events, and resources on the new Adobe Community
Explore Now