Does anyone happen to know of a JS code that will extract the width or height value of a field? For example, if I have a field height set up for “Expand to fit” and I want to extract the actual height of that field so that I can programmatically make an adjacent field the same height, is there a way to do this?
_____________________________________
Brian Falor |
GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958

www.ges.com | bfa...@ges.com
Please
consider the environment before printing this e-mail
Does anyone happen to know of a JS code that will extract the width or height value of a field? For example, if I have a field height set up for “Expand to fit” and I want to extract the actual height of that field so that I can programmatically make an adjacent field the same height, is there a way to do this?
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
www.ges.com <https://www.gesdefyconvention.com/sites/default/Local%20Settings/Temporary%20Internet%20Files/Content.Outlook/4X2FVSU0/www.ges.com> | bfa...@ges.com <mailto:bfa...@ges.com>
Please consider the environment before printing this e-mail
CONFIDENTIAL NOTICE: This e-mail transmission (and the attachments, if any, accompanying it) may contain confidential information. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any forwarding, disclosure, copying, distribution, or the taking of any action in reliance on the contents of this information is strictly prohibited. Any unauthorized interception of this transmission is illegal under the law. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission.
Thanks, Duane – this is very much appreciated and will be quite useful.
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
--
You received this message because you are subscribed to the Google Groups
"Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to
livecycle+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/livecycle?hl=en.
Duane,
Tried it out – almost but not quite. This code works great, but only if the first field (“Rectangle1” in this case) is not set up as “Expand to fit”. When this checkbox is checked, it seems to return a 0 value. I couldn’t think of any way to extract a value from this scenario as it doesn’t actually commit a value to the height or width value boxes when checked.
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
From:
live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of Duane
Nickull
Sent: Thursday, March 18, 2010 11:45 AM
To: Adobe LiveCycle Developers
Subject: Re: field width or height
form1.#subform[0].Button2::click - (JavaScript, client)
--
Since you are assigning the values to another object, you just have to copy
it over.
var newHeight = xfa.layout.h(TextField1, "in");
TextField2.h = newHeight + "in";
Based on the knowledge that it has resized.
This should work, no?
D
On 3/18/10 12:24 PM, "Falor, Brian" <BFa...@ges.com> wrote:
> Duane,
>
> Tried it out almost but not quite. This code works great, but only if the
> first field (³Rectangle1² in this case) is not set up as ³Expand to fit².
> When this checkbox is checked, it seems to return a 0 value. I couldn¹t think
> of any way to extract a value from this scenario as it doesn¹t actually commit
> a value to the height or width value boxes when checked.
>
>
> _____________________________________
> Brian Falor | GES Intellikit Developer
>
> Main 702.515.5500 | Fax 702.515.5953
> Direct 702.515.5986 | Mobile 702.576.4958
>
> www.ges.com
> <https://www.gesdefyconvention.com/sites/default/Local%20Settings/Temporary%20
> Internet%20Files/Content.Outlook/4X2FVSU0/www.ges.com> | bfa...@ges.com
>
> Please consider the environment before printing this e-mail
>
>
> From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf
> Of Duane Nickull
> Sent: Thursday, March 18, 2010 11:45 AM
> To: Adobe LiveCycle Developers
> Subject: Re: field width or height
>
> form1.#subform[0].Button2::click - (JavaScript, client)
> this.resolveNode("Height").rawValue = form1.resolveNode("Rectangle1").h;
> this.resolveNode("Width").rawValue = form1.resolveNode("Rectangle1").w;
>
>
> The attached PDF shows this working.
>
> Duane
>
>
> On 3/18/10 11:21 AM, "Falor, Brian" <BFa...@ges.com> wrote:
> Does anyone happen to know of a JS code that will extract the width or height
> value of a field? For example, if I have a field height set up for ³Expand to
> fit² and I want to extract the actual height of that field so that I can
> programmatically make an adjacent field the same height, is there a way to do
> this?
>
> _____________________________________
> Brian Falor | GES Intellikit Developer
>
> Main 702.515.5500 | Fax 702.515.5953
> Direct 702.515.5986 | Mobile 702.576.4958
>
> www.ges.com
> <https://www.gesdefyconvention.com/sites/default/Local%20Settings/Temporary%20
> Internet%20Files/Content.Outlook/4X2FVSU0/www.ges.com> | bfa...@ges.com
> <mailto:bfa...@ges.com>
>
> Please consider the environment before printing this e-mail
>
>
>
>
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
Please consider the environment before printing this e-mail
This should work, no?
D
--
One more question to see if this is possible or not. Is there a way to assign different traits to text in the same textbox programmatically using JS. For instance if I assign a rawValue of "The dog is in the doghouse because it is snowing outside.", and I want to assign "Bold" to the portion of text "The dog" and maybe "Italic" to the portion of text "doghouse", is this possible?
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
Please consider the environment before printing this e-mail
This should work, no?
D
--
_____________________________________
Brian Falor | GES Intellikit Developer
Main 702.515.5500 | Fax 702.515.5953
Direct 702.515.5986 | Mobile 702.576.4958
Please consider the environment before printing this e-mail
This should work, no?
D
--
This is something from a PHP script I use to align column widths between tables. Maybe it will help.
echo "function doalign() {";
echo "var hc = document.getElementById(\"header\").rows;";
echo "var dc = document.getElementById(\"detail\").rows;";
echo "if (dc.length>0) {";
echo "hc = hc[0].cells;";
echo "dc = dc[0].cells;";
echo "for (var j=0;j<dc.length;j++) {";
echo "var hw = hc[j].clientWidth;";
echo "var dw = dc[j].clientWidth;";
echo "if (hw>dw) {";
echo "dc[j].style.width = hw + \"px\";";
echo "dc[j].style.width = (hw + hw - dc[j].clientWidth) + \"px\";";
echo "}";
echo "else {";
echo "hc[j].style.width = dw + \"px\";";
echo "hc[j].style.width = (dw + dw - hc[j].clientWidth) + \"px\";";
echo "}";
echo "}";
echo "}";
echo "}";
I am unaware of a property that records the current height setting
when autofit is selected.
In a flowed layout, you could do the math by using the x,y coordinates
of the object in question, and the object directly below it to
determine the field size.
Angie
One more question to see if this is possible or not. Is there a way
to assign different traits to text in the same textbox
programmatically using JS. For instance if I assign a rawValue of
"The dog is in the doghouse because it is snowing outside.", and I
want to assign "Bold" to the portion of text "The dog" and maybe
"Italic" to the portion of text "doghouse", is this possible?
If the field is set to a Rich Text Field (as opposed to Plain Text),
then you can use xhtml codes to format the data.
To test this, and see a sample:
Add a text field, set the format to rich text, save as a PDF. Open in
Acrobat (so you can extract the xml). Turn on the properties toolbar
(Ctrl + E). When typing in the text field, select pieces and apply
formatting using the property bar.
Extract the data to examine the xhtml format in that field. Forms-
>Manage Form Data-> Extract Data.
Angie
We love you!!! Do you teach courses for LC Designer? Could this
group get you do do a special one hour presentation on tips and
tricks? How can we bribe you?
Duane
********
22nd Century (my band) - http://22ndcenturyofficial.com/
Twitter - @duanechaos
Blog - http://technoracle.blogspot.com
********