cancel
Showing results for 
Search instead for 
Did you mean: 

Positioning a subform using javascript

0 Kudos

I have 2 positioned subforms containing several textfields.

In some cases subform A has to be printed left, subform B right.

In other cases subform A has to be printed right, subform B left.

I want to position the subforms in runtime using below javascripts.

data.MasterPages.PageFront.Header.CompanyAddress::initialize - (JavaScript, client)

if ( $record.PUBLIC.OPTIONS.PRINT_OPTIONS.Z_LOGO_POS.value == 'L' )

this.x = "1cm";

else

this.x = "11cm";

data.MasterPages.PageFront.Header.CustomerAddress::initialize - (JavaScript, client)

if ( $record.PUBLIC.OPTIONS.PRINT_OPTIONS.Z_LOGO_POS.value == 'L' )

this.x = "11cm";

else

this.x = "1cm";

For some reason the subforms are not positioned correctly.

The condition field reference is 100% correct.

Even if i remove the condition, the forms are not positioned correctly.

Any idea what could be the problem ?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Subform A and Subform B must be wrapped under another Positioned Subform, then only you can change the coordinates.

Thanks.

UmaS.

raul_daimiel
Participant
0 Kudos

Dear UmaS.

I have a similar issue there. Would that also work in case of having a simple subform?.

I mean, so far I have two subforms ( one per each area - left and right ) and I use the presence property.

But it would be just amazing if I would only use one subform and would be able to move it to the right or left.

Would it be possible?.

Kind Regards.

Raul

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

There is another solution for this problem.

Create two subforms

One having subform A in left and Sub B in right

second with subform B in left and Sub A in right

Give one subform to be hidden

Give condition in formcalc/javascript which one to be visible and which one to be hidden.

this should work 'cos i have worked on the same prb and it worked fine

Try out this