I don't understand your question. What do you want mean?
I'll try to explain better ...
Pay RecordSet.
$pay_method = new RBO_Field_CommonData(_M('Pay method'), 'Custom/Pays/Pay_Method');
$pay_method->set_QFfield_callback(array('Custom_PaysCommon', 'QFfield_pay_method'));
$pay_method->set_required()->set_filter()->set_visible()->set_filter();
$fields[] = $pay_method;
$pay_1 = new RBO_Field_Float(_M('Pay 1'));
$fields[] = $pay_1;
$pay_2 = new RBO_Field_Float(_M('Pay 2'));
$fields[] = $pay_2;
...
$pay_12 = new RBO_Field_Float(_M('Pay 12'));
$fields[] = $pay_12;
$pay_date_1 = new RBO_Field_Date(_M('Pay date 1'));
$fields[] = $pay_date_1;
$pay_date_2 = new RBO_Field_Date(_M('Pay date 2'));
$fields[] = $pay_date_2;
...
$pay_date_12 = new RBO_Field_Date(_M('Pay date 12'));
$fields[] = $pay_date_12;
$pay_check_1 = new RBO_Field_Checkbox(_M('Pay check 1'));
$fields[] = $pay_check_1;
$pay_check_2 = new RBO_Field_Checkbox(_M('Pay check 2'));
$fields[] = $pay_check_2;
...
$pay_check_12 = new RBO_Field_Checkbox(_M('Pay check 12'));
$fields[] = $pay_check_12;
The possibles commondata values are: 1 pay, 6 pays and 12 pays.
Depending the option selected by user, I need hide more or less fields.
For example:
User select 1 pay = I need show only Pay 1, Pay date 1 and Pay check 1. And hide Pay 2 to Pay 12, Pay date 2 to Pay date 12 and Pay check 2 to Pay check 12.
User select 6 pays = I need show only Pay 1 to Pay 6, Pay date 1 to Pay date 6 and Pay check 1 to Pay check 6. And hide Pay 7 to Pay 12, Pay date 7 to Pay date 12 and Pay check 7 to Pay check 12.
User select 12 pays = I need show all fields. Pay 1 to Pay 12, Pay date 1 to Pay date 12 and Pay check 1 to Pay check 12.
For this in the QFfield callback defined in: $pay_method->set_QFfield_callback(array('Custom_PaysCommon', 'QFfield_pay_method'));
I made this:
// 1 pay
if($default == 0) {
for ($i = 2; $i <= 12; $i++) {
$form->addElement('hidden', 'pay_'.$i, null);
$form->addElement('hidden', 'pay_date_'.$i, null);
$form->addElement('hidden', 'pay_charged_'.$i, null);
}
}
I "ADD" elements because I don't know another way to make this. I think that it is correct, but if I don't it make good, please tell me the solution or something about it.
This solution hide 11 fields of each type (float and date), less the fields check type.
I don't know I can tell you more.
Thank you