How to change the selection between two checkboxes?

Asked

Viewed 30 times

1

I need to perform the selection of two checkbox, when I click on one the other is not selected, and when the other is selected this previous cannot be selected, and can select only one.

inserir a descrição da imagem aqui

                workerWOReprogram.sisteplant_CBReprogPeriod_OnChangeValue = function(oCheck, isChecked)
            {
                console.log("sisteplant_CBReprogPeriod_OnChangeValue");

                if(isChecked)
                     scr.setValue("CBReprogWO", false);         
                else scr.setValue("CBReprogPeriod", true);

                var RSWorkOrder = scr.getObject("RSWorkOrder");
                var RSWorker    = scr.getObject("RSWorker");
                RSWorkOrder.setSelectionType(SELECTIONTYPE.All);
                RSWorker.setSelectionType(SELECTIONTYPE.All);
            }

            workerWOReprogram.sisteplant_CBReprogWO_OnChangeValue = function(oCheck, isChecked)
            {
                console.log("sisteplant_CBReprogWO_OnChangeValue");

                if(isChecked)
                     scr.setValue("CBReprogPeriod", false);
                else scr.setValue("CBReprogWO", true); 

                var RSWorkOrder = scr.getObject("RSWorkOrder");
                var RSWorker    = scr.getObject("RSWorker");
                RSWorkOrder.setSelectionType(SELECTIONTYPE.All);
                RSWorker.setSelectionType(SELECTIONTYPE.All);
            }

That’s my code, but I’ve been through it and I don’t know where I went wrong!

Once only one was selected, now I can select both, and that’s not what I want.

Can anyone help me? HTML BELOW

            <fieldset name="LabelAndCheckBoxes_fieldset">
              <checkbox labelText="_T(F_REPROG_PERIOD)" name="CBReprogPeriod" defaultValue="1" />
              <checkbox labelText="_T(F_REPROG_WO)" name="CBReprogWO" defaultValue="0" />
            </fieldset>
Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.