Hi Buddies,
I need your suggestions urgently on issue described below. Somehow long story. Appreciate your interest& suggestions.
==============Clip==============
I have a form design requirement that certain text content should only appear on a fixed position of the last page.
The form will be multi-pages.
Following is the way how I tried
1) On master page:
Add Text object lblEnding( w =176mm, h =45mm)
Wrap lblEnding into subform ( frmEnding)
Make frmEnding on position as required ( x=20mm, y =200mm, w=176mm);
2) On bodypage:
Add Text object lblBlank; ( no border& transparent). It's used for occuping the page area to flow the bodypage
Wrap lblBlank into subform frmBlank, flowed, top to bottom.
3) Note: The last required content of form template is a subform, called frmInfoBlock.
OK, then here comes to my scripting part.
---------------------------------------------------
1) On Master page:
// To configue frmEnding only appear on last page
// To control the presence of frmEnding based on pageCount()
// scripting on frmEnding
//
FormDeliveryNoteNotification.#pageSet[0].mstMasterPg1.frmEnding::ready:layout - (JavaScript, client)
if (xfa.layout.page(this)!= xfa.layout.pageCount()) this.presence = "hidden";
2) On Bodypage:
// To control the presence of frmBlank based on its position ( property "y")
// scripting on frmBlank
//
FormDeliveryNoteNotification.bdyPage1.frmBlank::ready:form - (JavaScript, client)
var y1 = this.y;
var y2 = frmInfoBlock.y;
var h2 = frmInfoBlock.h;
var yNum1 = parseInt(y1);
var hNum2 = parseInt(h2);
var yNum2 = parseInt(y2);
this.presence = "visible";
if (yNum1 <= "200")
{
if(yNum2 + hNum2 <"200" )
this.presence ="hidden";
}
---------------------------------------------------
Later I found it not worked as expected.
As for property "y"
>>>>
Specifies the y coordinate of a container’s anchor point relative to the top-left corner of the parent
container when placed with positioned layout.
Containers with flowed content do not use y coordinates.
>>>>
As subforms inc. frmBlank & frmInfoBlock all are flowed, variables in above scripts, always have value as below( based on my debugging result)
y1=0 in
y2=0 in
h2=0 in
Accordingly, inc. yNum1, yNum2, hNum2 are always 0.
Result is:
frmBlank will always be hidden
If only 1 page, the bodypage count can be overlapped with master page frmEnding.
==============Clap==============
Hope I've described things clear. :-P
Can you provide your suggestions as alternative suggestion.
-VickyX