Accurev Plugin - RadioButtons

I am trying to add radio buttons to the VCS Node page of the Accurev  Plugin.
I have successfully added the radio buttons but I am unable to link them such that selecting one deselects the other.

Also there is a check box on the page.
If that check box is unselected then both radio buttons must be DISABLED.
If the checkbox is selected then the both radio buttons become ENABLED but UNSELECTED.

Please baer in mind that I have very little knowledge of java server pages.
Any help is appreciated.
Thank you.

I have attached two files to demonstrate what I mean.



Attachment(s):
example.jsp.zip
radioButtons.JPG
6 comments

Abraham,

You should probably set the same "name" attribute for the props:radioButtonProperty  tags that you need to be in the same group.
Enabling/disabling should probably be handled in the onclick event handler of the radio buttons.
This seems to be more of HTML/JavaScript then JSP thing.

BTW, you can use open-source plugnis to get examples on UI pages. e.g. the one from FXCop
.

0

Thanks for your response.

I now have only one remaining problem with my code.
I am trying to enable and disable the radio buttons based on the value of the checkbox.
Unfortunately I cannot get the value of the checkbox.

please see the attached file:

the value of
     <c:when test="${checkbox_promoteOnSuccess.checked == true}" >
always evaluates to false.

I have tried other statements but nothing seems to work.

Any suggestions are greatly appreciated.
Thank you.



Attachment(s):
conditional_example.jsp.zip
0

Abraham,

You try to get the value of the checkbox on the server (<c:when> is JSP contruct that is evaluated on the server).  Is this what you mean?
It seems you might need getting the value in the JavaScript within the browser like $("checkbox_promoteOnSuccess").checked

0

The aim of the jsp script I sent you can be redefined as follows.

if (checkbox_promoteOnSuccess.checked == true)
{
     //enable radio buttons
}
else
{
     //disable radio buttons.
}

The problem is that the jsp construct to evaluate the value of checkbox_promoteOnSuccess.checked never evaluates to true.
So the radio buttons are always deactivated.

I do not understand what you mean by getting the value through javascript.

Thank you

0

I have found the solution.
See the attached file.

The solution requires the addition of jsp code directly into the onclick event handler.
The onclick event then cycles through all the html elements on the page and disables those that begin with the prefix "radioButton_".

Thanks



Attachment(s):
solution.jsp.zip
0

I have found an even better solution.
See the attached file.



Attachment(s):
betterSolution.jsp.zip
0

Please sign in to leave a comment.