Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

removing subform border when there is no next subform in the same page

Avatar

Former Community Member

Hi Experts,

                 I have a requirement of removing subform border when there is no other subform after the subform having border in the same page. My form is flowed and I want to do this thruout the whole form. The pseudo logic which I thought of is as follows

Check which subforms in the document is having a border

Next find out the current page number

Check whether we have any other element to follow after the subform having border in the same page

loop at the whole document {

     check for form object to be of type subform {

if (xfa.form.[path].border.presence == true) {

            //check whether the page no of the next object

            is same as the current page.

            If yes {

                        No action

                         }

            Else {//No border

                        xfa.form.[path].border.presence = false;

                         }

}    

               }

}

I am using Javascript and not sure how to translate the above pseudo code into a javascript. Please help.

5 Replies

Avatar

Former Community Member

Hi,

      Some more additions

Alternative approach

scripting to be done at the subforms having the border checking if the end of page is reached after the subform is fitted into the page if so border presence is made false

Avatar

Former Community Member

Hi All,

            I tried with the following script its not wrking - cant see any reason

removeBorder(xfa.form.MASTER.P1.sub_PY.subRemborder);

function

removeBorder(container) {

     var nObjects = container.nodes.length;

     var objects = container.nodes;

     for (var i=0; i<nObjects; i++) {

          var object = objects.item(i);

          if (xfa.layout.page(objects.item(i+1)) != xfa.host.currentPage) {

               object.border.presence

== false;

          }

     }

}

basically there is subform subRemborder having two subforms - TaxInfo & ContactInfo both of which has bottom solid borders

Avatar

Former Community Member

Here is an example that shows two ways to hide the border around the subform. The 1st way changes the width of the border to 0 and the second uses the presence property to set the border to invisible.

The code for both is on the button in the subform.

Paul

Avatar

Former Community Member

Hi,

        I have tried out an approach details of which you can find in the attached document. Please have a go thru it and suggest a solution for the same

Thanks,

Rohit

Avatar

Former Community Member

So instead of trying to control a border why not have no border but put a line object after the 1st subform. Then you can include the line in the Contact Person subform. You may find it easier to control in that configuration.

Paul