Expand my Community achievements bar.

Presence says Visible but fields do not appear

Avatar

Level 1

The attached form gathers information to create class sessions for courses.

The users determine how many classes they want to schedule.  After they determine the number of classes the form creates a Form page for each class. On a form page there are fields to collect information about a class. Fields appear and disappear depending on if they are needed.

For this post I will focus on the "holiday week" fields but the problem occurs elsewhere as well.  The Holiday week fields should appear after you select the Holiday week check box.  Here is the code for the holiday checkbox:

form1.ClassPage.VacationWeekCheck::click - (JavaScript, client)

if (this.rawValue == "1")
{   
    xfa.host.messageBox("The value of this.rawValue is: " +        this.rawValue, "Debugging", 3);   
    VacationWeekForm.presence = "visible";
    xfa.host.messageBox("The value of VacationWeekForm.presence is: " +        VacationWeekForm.presence, "Debugging", 3);   
    xfa.form.recalculate(1);   
}else {   
    VacationWeekForm.presence = "hidden";   
    xfa.host.messageBox("The value of VacationWeekForm.presence is: " +        VacationWeekForm.presence, "Debugging", 3);
    xfa.form.recalculate(1);
}

It work fine if

1) I have one class

2) If I have multiple classes and go to week 2

Currentlhy the fields that I want to appear do not The firest time I select them.

It does not work if there are multiple classes and then go to to the 1st class and select the Holday week checkbox.  What is weird is that in this case, you can see from the debugging windows it says that VacationWeekForm.presence is "visible",  but you can't see it. It doesn't appear on the screen

Also, I think the code should work without the "xfa.form.recalculate(1);" statements, but when they are gone, and there are multiple week it only works class 2.  The Holiday vacation fields do not appear in any other class.

If you play with it you will see other similar quirky stuff

Help - Any suggestions

0 Replies