cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox Problem !?!?

Former Member
0 Kudos

Hi Community,

Ive got an strange checkbox problem. I build 4 checkboxes in my aif. They should only appear/disappear 4 subforms.

Subform1

---Checkbox 1 ( visible/hidden Subform 1)

---Subform 1.1

---Subform 1.2

Subform2

---Checkbox 2 (visible/hidden Subform 2)

---Subform 2.2

---Subform 2.3

Subform3

---Checkbox3 (visible/hidden Subform 3)

---Subform 3.1

Subform4

---Checkbox4.1 (visible/hidden Subform 4)

(Initialize:

1 Checkbox: checked

2 Checkbox: unchecked

3,4 unchecked)

My coding is in the "click" and "initialize" event of my checkboxes.

if (this.rawValue=="1"){

subformname.presence="visible"

}

else {subformname.presence="hidden"

}

It works out at first. But e.g. if i uncheck the first checkbox - the subform of the second doesnt appear if i checked the second box.

But if i uncheck the first and check it afterwards - the 2,3,4 checkboxes work out....

strange...

Could anyone help me?

greets

chris

Edited by: blaxus on Dec 20, 2010 10:47 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

Please check if the code below will help you or not.

Initialize event of the subform which contains all the 4 check boxes:

this.checkBox1.rawValue = 1;

SubForm1.presence = 'visible';

SubForm2.presence = 'hidden';

SubForm3.presence = 'hidden';

SubForm4.presence = 'hidden';

Click event of the corresponding checkBoxes:

First checkbox code is given as example

SubForm1.presence = 'hidden';

SubForm2.presence = 'hidden';

SubForm3.presence = 'hidden';

SubForm4.presence = 'hidden';

if (this.rawValue == 1){

SubForm1.presence = 'visible';

}

if (this.parent.checkBox2.rawValue == 1){

SubForm2.presence = 'visible';

}

if (this.parent.checkBox3.rawValue == 1){

SubForm3.presence = 'visible';

}

if (this.parent.checkBox4.rawValue == 1){

SubForm4.presence = 'visible';

}

Paste the similar code related to other checkbox click event also.

Please try.

Thanks & Regards,

Sanoosh

Edited by: Sanoosh P K on Dec 20, 2010 11:35 AM

Former Member
0 Kudos

Thank you very much - but it doesn't work. I didn't use your code exactly because the main subforms (1-4) should also be visible. So I said e.g. subform1.subform1.1.presence = "hidden". But I think that doesn't matter.

Anyhow - thank you for your answer.

Any other suggestions?

Regards,

Chris

Former Member
0 Kudos

Hi Chris,

I guess your requirement as, subform should be visible only if the corresponding checkBox has been checked true. If all the four has been checked true, then all four subforms should be visible and viceversa. And the code was to attain this functionality. I can help if you make it more clear.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi Sanoosh,

Thank you very much for your help.

If you check e.g. subform 1 - subform 1.1 and subform 1.2 should be visible. Otherwise = "hidden".

The main Subforms (1-4) should always be visible.

The same for subform2, subform3, subform4.

That means no dependencies between the 4 subforms.

Best Regards,

Chris

Former Member
0 Kudos

Hi Blaxus,

I have done some sample file for you.

check it from below link.

http://www.mediafire.com/?yjdlprbyi92qz

hope this solves it.

Cheers,

Sai

Former Member
0 Kudos

Hi Sai,

Thank you very much for your effort.

How can I open thes .xdp file?

Best Regards,

Chris

Former Member
0 Kudos

Did you download that file on your desktop..?

Once done, right click-->open with ADLC.

Its the entire form source code.

If you couldn't download the file send a test mail to my id located in my business card.

I can send it stright away...

Cheers,

Sai

Former Member
0 Kudos

Thank you - but the code doesn*t work in my adif.

(x)subform1

---subform1_1

---subform1_2

( )subform2

(x)subform3

--subform3_1

--subform3_2

( )subform4

Maybe it doesn't work because the subforms are "flowed". That means if you uncheck for example subform2 (like above) the subform2_1 + subform 2_2 are invisible like above. Therefore there is no space between subform2 and subform3.

Thats so strange?!?!

Regards,

Chris

Former Member
0 Kudos

Hi Cris,

Sorry I missed it..

The visibility of the subforms have nothing to do with the flow type.

The flow type just helps use of the available realestate to use it or keep it reserved.

Did you check my forms...? does it work...?

Let me know, else if possible sent it to me let me have a look.

Cheers,

Sai

Former Member
0 Kudos

Thanks but it doesn't work.

Regards,

Chris

Former Member
0 Kudos

sent your form fixed ..check it out and let me know ..

Cheers,

Sai

OttoGold
Active Contributor
0 Kudos

sorry for jumping in late. I would check the binding of those fields as well as addressing fields in the script (same subform names and same checkbox names could produce a weird behavior).

Otto

Answers (0)