cancel
Showing results for 
Search instead for 
Did you mean: 

how to hide a body page at run time depending on some condition

Former Member
0 Kudos

hi all,.

i have 3 master pages in my form...now the 1st page contains the line items and can overflow as usual....the 2nd page contains terms and conditions..

now the 2nd page will fire only if a certain condition is true ie if the condition is false then only i have to stop the 2nd master page from firing.....

similar with 3rd master page..

now the 2nd master page can overflow to 2 pages..so i have created a separate body page for the 2nd master page...

now the terms and conditions is a standard text..i ahve put a condition on this text in the context....but still the master page is firing..how to stop that...

i have tried a formcalc script on the 2nd body page subform like this on form ready event at client.

if ($record.main.mode.value = "2")

$.presence = "hidden"

endif.

but this is not working....ie i am getting a blank page with the subforms on the master page....also we cant write script on a master page..

please provide me a solution(script in java or formcalc)...i am stuck at this point..

also tell me that if i have syntax error in my scrip how do i find it i mean how to debug it...because sometimes due to syntax error also script does not work....

please help me....

please provide me a solution(script ) ....

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member191062
Active Contributor
0 Kudos

Hello,

you can try the following:

myBodyPage.occur.min = "0";

_myBodyPage.removeInstance(0);

Please be aware that this will remove all the content of the binded data elements.

Best regards,

Dezso

Former Member
0 Kudos

Hello,

I think controlling master pages is difficult or not possible in your case.

Can you explain how the 3 master pages are designed or look like.

pavan meda

Former Member
0 Kudos

hi pavan,

the first master page will contain the purchase order details,2nd master page contains the terms and conditions of po and 3rd page contains subcontract details...

i can tell you the things that i tried...

i have written script to hide the subforms on the master pgae but still ablank page is firing..how to suppress that blank page? i tred in many ways using instancemanager.removeinstance..

the main problem is that we cannot write script on master page..what is the correct reference syntax for accesing the master page..

any idea??

Former Member
0 Kudos

if the number of items flow to next page, which master page its using for items 1st or 2nd master page.Are the 1st master page content area dimentions and 2nd master page area dimentions are same or different.

Can you try as below.

Place condtions and terms in the 2nd body page/ subform and on condition you can print on new page.same with subcontract infomation provided there are 2 master pages when items flow to next page it will use 2nd master page.

make a backup before doing any changes.

As I told in the previous reply , handling master page is not possible in your case.

You have to approch other alternatives.

Goodluck.

pavan meda

Former Member
0 Kudos

hi pavan

can u explain a little bit more...print conditionally on new page...how to do that?

Former Member
0 Kudos

An external page break can be triggered by using the Edit button in the Pagination Tab of the Object palette.

Click on the Edit button, press the PLUS symbol to add the script.

Below that select the Break radio button either before or after depending on the requirement and then in TO: select the “Top of Next Page”. If you want to display header and footer of the table in the next page s also select the Trailer and Leader sub forms.

<a href="http://img216.imageshack.us/img216/1807/image002lu3.jpg">screen shot</a>

or

To trigger External Page Break:

Depending on some condition, if you want to trigger a Page break, add the below script to the table subform where the page break has to be trigger. If the hierarchy is as below, then add the below code on the table subform.

Table

Table_Header

Table_Data

Var recnt = $.data.all.length

For I = 0 upto ( recnt - 1 ) step 1 do

If ( Condition ) then

$.data<i>.break.after = “pageArea”

$.data<i>.break.startNew = “1”

endif

endfor

if you are getting an empty page at the end, add the below script to the table subform.

$.data[recnt-1].break.after = “”

$.data[recnt-1].break.startNew = “0”

This will suppress the blank page, which is generating because of external page break coding.

Former Member
0 Kudos

hi all,

no solution....ia m really stuck at this point and really need your help..

any help is appreciated..