When I try copying in
app.runtimeHighlight = true;
to docready, and then F5 (preview), the field hi's don't show by default.
I also tried
if (!app.runtimeHighlight){
app.runtimeHighlight = true;
}
for layout ready, but still no luck.
What am I doing wrong? Thanks.
Views
Replies
Total Likes
Hi,
The script should work perfectly in the docReady event:
app.runtimeHighlight = true;
Check that the language is set to JavaScript. Also when previewing make sure that the Preview Type is set to "Interactive Form", in the File > Form Properties > Preview tab.
See example here: http://assure.ly/jiZ6tn.
Does that work?
Niall
Views
Replies
Total Likes
Thanks but DocReady (along with 95% of the drop-down) is greyed out ..unless I'm on a specific field. I don't want to put this at any particular field. I want to be at the root I guess.
How do I make sure I'm at the root?
Also, when I paste the color code from that form, I assume I'm putting it just below the existing line 1, or:
" form1.page1::docReady - (JavaScript, client)" ?
Also, on save, I get the following:
"Failed to save the file. Additional error information can be found in the Log tab of the Report pallette."
and the first line of the color code pasted in, gets pink highlight (error I guess), namely:
" form1.#pageSet[0].Page1.header::docReady - (JavaScript, client)"
I'm wondering if there's a conflict between the 1st line that was already there and the first line of the new code (pasted after the already-existing one):
ALREADY THERE: form1.page1::docReady - (JavaScript, client)
FIRST LINE OF COLOR CODE: form1.#pageSet[0].Page1.header::docReady - (JavaScript, client)
Thanks for clarifying these points.
David
Views
Replies
Total Likes
Hi,
If you are copying script from one object to another, you must not paste in the reference syntax. This does not have a line number and is not part of the script.
The reference syntax gives you the full SOM expression for the selected object, the event that you are scripting in, the language and where the script will run.
Delete duplicates of these lines from your script.
You can place the code from the example in the docReady event of the root node. This is normally "form1", unless you have imported an exiting document into LC Designer, in which case the root node is something like "TopUpperMostSubform".
The highlighting will apply to all fields that are not set to readOnly.
Hope that helps,
Niall
Views
Replies
Total Likes
1. Does the script have to come first in docready or can it be anywhere within that root?
2. Are manual code changes mode only in XML view?
3. I notice lines (maybe "SOM"s?) can not be changed, so...about those 2 conflicting lines, you said to delete one, I'd like to delete the one that was "already there" and not the one that goes with the script, but it seems like those existing lines can't be changed...at least in script area, maybe in XML view.
My docready* starts with this code:
form1.page1::docReady - (JavaScript, client)
////RIGHT HERE, I DELETED YOUR DUPLICATE LINE 1 (since I couldn't delete the above line////
if (app.viewerVersion >= 10)
{
this.border.fill.color.value = "86,86,86";
}
else if (app.viewerVersion >= 9 || app.viewerVersion < 10)
{
this.border.fill.color.value = "51,51,51";
}
else
{
this.border.fill.color.value = "103,103,103";
}
form1.#pageSet[0].Page1.header.AssureDynamicsURL2::docReady - (JavaScript, client)
if (app.viewerVersion >= 10)
{
this.border.fill.color.value = "86,86,86";
}
else if (app.viewerVersion >= 9 || app.viewerVersion < 10)
{
this.border.fill.color.value = "51,51,51";
}
else
{
this.border.fill.color.value = "103,103,103";
}
However, my highlighting is still NOT showing by default / on form open.
Please remember, I'm brand new at this.
Thanks.
Views
Replies
Total Likes
Hi,
I have gone now so won't be able to help much.
However NEVER, EVER script in the XML Source view. All scripting in the Script Editor (see Help).
The script that you have copied relates to a button on my form. Do not copy this script. All you need is the app.runtime.Hightlight = true; line.
Niall
ah ok will do.
I think you meant app.runtimeHighlight = true;
you added an extra "t" and an extra period.
goodbye
Views
Replies
Total Likes
Yes, typed on a phone while bombing down the road (passenger)
Views
Replies
Total Likes
interesting.
I added the line. Still not working for me:
My first 2 docReady* lines read:
form1.page1::docReady - (JavaScript, client)
app.runtimeHighlight = true; //this is the one I pasted after the above pre-existing line//
Still, fields are not defaulted to highlights on.
What am I doing wrong??
Views
Replies
Total Likes
Hi,
I would need to see the form, but gone until Monday. Can you upload the form to Acrobat.com, publish it and the share the link here?
Niall
Views
Replies
Total Likes
will consider. what's the link?
Views
Replies
Total Likes
http://www.acrobat.com or any other file sharing site.
Views
Replies
Total Likes