I had to add very simple logic into existing Framework page. One this page 2 checkboxes exists. Lets call one of them “first” and second one will be “second”. Desired result – whenever user clicking on “first” it should disable “second” checkbox. Well first of all I tried to do it on the server side. To do it , I had to submit the page when user clicking on “first” checkbox. This is not a problem. Just choose proper options in the GUI element as you can see in the picture bellow
So, user clicking on the checkbox and submitting the page to the server. It is important to give some name in the event field.
Second step is to catch this event inside the controller. User can catch this event in processFormRequest method
Well, I thought that I am one step of achieving the goal. The last think that I should do is to get a reference to “second” checkbox and disable it in the following way
And so I did. And it didn’t work at all!!! Instead I got an error message saying "blah.. blah.. blah.. You can not do it in processFormRequest method. Nice. The only other place I could do this logic is inside processRequest method. But I can catch my event only in processFormRequest methos. Why Oracle did it in this way?? Who knows.
Any way if I wanted to proceed this this approach I had to resubmit the page by using pageContext.forwardImmediately() to the same page and then I could proceed my code in processRequest method. I am thinking that it is too much. So I decided to write client code and attach it to the “first” checkbox.
First of all it need to written in the “processRequest” method. Only several lines of code