Stefan Cameron on Forms
Building intelligent forms using Adobe LiveCycle Designer

Archive for October, 2008

Bug: Cannot Clear Radio Button List Selection

Description

Normally, setting a field’s rawValue property to null essentially clears its value. It should follow that setting a radio button list’s rawValue property would clear its selection (i.e. if one of its radio buttons was selected, none would be selected when its value is set to null).

To clear a text field, for example, you would do the following:

MyTextField.rawValue = null;

To clear a radio button list, the following should also work:

MyRadioButtonList.rawValue = null;

The issue is that the above statement for clearing a radio button list doesn’t work: The selection remains and the radio button list’s rawValue property remains set to the value of the selected radio button.

Workaround

There are two workarounds to this issue. The first consists of clearing the data node associated with the radio button list, provided the radio button list is bound to data (which means the “Object palette > Binding tab > Default Binding property” is set to something other than “None”):

MyRadioButtonList.dataNode.isNull = 1;

Note that if you attempt to use this workaround when the radio button list is not bound to data, an error will occur because its dataNode property will be null and you’ll attempt to access the isNull property of a null object.

The second workaround consists of using the xfa.host.resetData() method to clear the radio button list:

xfa.host.resetData(MyRadioButtonList.somExpression);

The advantage of the second workaround is that it will work regardless of whether the radio button list has a data binding or not.

Fix

Please refer to the Bug List for updated information on the version(s) affected by this bug as well as if and when it was/will be fixed.


Posted by Stefan Cameron on October 9th, 2008
Filed under Acrobat,Bugs,Scripting,XFA

Tab Order Video Tutorial

I noticed that Alex Kalaidjian, from the LiveCycle Designer Team, has posted another training video on Adobe’s LiveCycle DevNet. This time it’s on tab order, which is a great complement to my tab order article from the other day. Alex shows just how easy it is now to fix some common tab order issues with your forms using the new user interface for tab order available in Designer 8.2.


Posted by Stefan Cameron on October 7th, 2008
Filed under Designer,Tutorials

Hyperlinks in Form Objects

The newest releases of Adobe LiveCycle Designer and Adobe Acrobat/Reader (versions 8.2 and 9.0, respectively) add support for hyperlinks in form objects. You can set hyperlinks to websites, files or email addresses in text objects and field captions.

Text Objects

Creating hyperlinks is easy. Consider the following text object (I’ve bolded one word to highlight the fact that hyperlinks work with plain and/or rich text):

To set “Adobe LiveCycle Developer Center” as a hyperlink, simply highlight the text and choose “Insert Hyperlink” from the context menu or choose “Insert > Hyperlink” from the top-level menu. You’ll get the following dialog where you can specify the URL or email information (notice you can even set the subject of the new email if you set an email hyperlink):

That’s it! Pretty simple. Once the hyperlink is created, you can edit it again by choosing “Edit Hyperlink” or you can remove it by choosing “Remove Hyperlink” from the context menu. You can also choose “Open Hyperlink” to test that the link is valid.

Over in Acrobat/Reader, when the user hovers their mouse over the hyperlink, the cursor will change to a small hand with a “w” over it and a tooltip will appear indicating the hyperlink destination:

Clicking on the hyperlink will result in a security dialog providing the user with the opportunity to “allow” or “deny” Acrobat’s request to open the link. (Before you ask, the security dialog cannot be avoided. I did notice that it sometimes doesn’t appear when you click on a hyperlink within the context of Designer’s “PDF Preview” tab but it will definitely appear when the form is run within Acrobat/Reader on its own.)

Field Captions

As I mentioned earlier, you can also set hyperlinks on field captions. This could be really handy, especially to provide extra help. Consider the scenario where a drop down list is asking a user to choose a policy. It might be useful to provide a way for the user to obtain more information about each policy. Before the hyperlink feature was added, you would’ve had to use a button with the following script in its click event:

xfa.host.gotoURL("http://www.somewhere.com/policy-help/");

That doesn’t look really nice. Sure, you could take the time to format the button’s appearance to remove the highlight, remove the border, remove the background color and set the font to “blue + underline” but that’s a lot of work. Now you can just make a hyperlink out of the word “policy” with just a couple of clicks (and it looks much better too):


Posted by Stefan Cameron on October 6th, 2008
Filed under Acrobat,Designer,Tutorials