on 12-20-2010 9:03 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.