ChoiceCallback displays Radio Buttons instead of Dropdown

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ChoiceCallback displays Radio Buttons instead of Dropdown

J Singh
Hi,

I'm using OpenAM 13 on Apache Tomcat 7. I need to render a ChoiceCallback to user which is essentially a list of items to select from. The problem I'm running into is - the list essentially can be 100s of items and by default the ChoiceCallback renders each item as a RadioButton. I need to render all items in a DropDown List. I was unable to find a setting inside ChoiceCallback to toggle between RadioButton vs. DropDown List. 

Could you please provide me some guidance around this requirement - so that I can render a DropDown instead of Radio Button? 

Thanks.



_______________________________________________
Visit the OpenAM forum at https://forgerock.org/forum/fr-projects/openam/
OpenAM mailing list
[hidden email]
https://lists.forgerock.org/mailman/listinfo/openam
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ChoiceCallback displays Radio Buttons instead of Dropdown

Alberto Treviño

I ran into the same problem several months ago. If you are using Legacy UI, you need to modify Login.jsp. (For XUI I'm sure the process would be similar.)


In Login.jsp, there is a section that contains the following code:


  <jato:content name="choice">


Everything inside that section is what renders the radio buttons. Inside the choice content area there is an iterator that steps through the choices:

  <jato:tiledView name="tiledChoices" type="com.sun.identity.authentication.UI.CallBackChoiceTiledView">

Somewhere before the iterator you would add your <select> tag and inside the iterator you would add the <option> tags, replacing the <input type=radio" ...> that is there presently.

This approach will change all Choice Callbacks to dropdowns. Another choice is to make a copy of Login.jsp (to MyLogin.jsp for example), make the changes in the copy and add the template attribute to the appropriate Callbacks entry in your Module Properties XML:

  <Callbacks length="2" order="1" timeout="600" header="..." template="MyLogin.jsp" ...>

When OpenAM loads your module in that given state, it will use MyLogin.jsp instead of Login.jsp. This will allow you switch to a drop-down only in your module and maintain the original OpenAM behavior for all other login screens. (Unfortunately, I don't know how the template attribute is handled in XUI.)


From: [hidden email] <[hidden email]> on behalf of J Singh <[hidden email]>
Sent: Tuesday, July 5, 2016 8:24 AM
To: Users
Subject: [OpenAM] ChoiceCallback displays Radio Buttons instead of Dropdown
 
Hi,

I'm using OpenAM 13 on Apache Tomcat 7. I need to render a ChoiceCallback to user which is essentially a list of items to select from. The problem I'm running into is - the list essentially can be 100s of items and by default the ChoiceCallback renders each item as a RadioButton. I need to render all items in a DropDown List. I was unable to find a setting inside ChoiceCallback to toggle between RadioButton vs. DropDown List. 

Could you please provide me some guidance around this requirement - so that I can render a DropDown instead of Radio Button? 

Thanks.



_______________________________________________
Visit the OpenAM forum at https://forgerock.org/forum/fr-projects/openam/
OpenAM mailing list
[hidden email]
https://lists.forgerock.org/mailman/listinfo/openam
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ChoiceCallback displays Radio Buttons instead of Dropdown

J Singh
Great! Thank you for a very detailed answer Alberto. I was in fact going that route. I was initially under the impression that I'm perhaps missing something as such a basic feature cannot be missing. I guess I was wrong. 

Thanks a lot for your answer.

On Tue, Jul 5, 2016 at 1:06 PM, Alberto Treviño <[hidden email]> wrote:

I ran into the same problem several months ago. If you are using Legacy UI, you need to modify Login.jsp. (For XUI I'm sure the process would be similar.)


In Login.jsp, there is a section that contains the following code:


  <jato:content name="choice">


Everything inside that section is what renders the radio buttons. Inside the choice content area there is an iterator that steps through the choices:

  <jato:tiledView name="tiledChoices" type="com.sun.identity.authentication.UI.CallBackChoiceTiledView">

Somewhere before the iterator you would add your <select> tag and inside the iterator you would add the <option> tags, replacing the <input type=radio" ...> that is there presently.

This approach will change all Choice Callbacks to dropdowns. Another choice is to make a copy of Login.jsp (to MyLogin.jsp for example), make the changes in the copy and add the template attribute to the appropriate Callbacks entry in your Module Properties XML:

  <Callbacks length="2" order="1" timeout="600" header="..." template="MyLogin.jsp" ...>

When OpenAM loads your module in that given state, it will use MyLogin.jsp instead of Login.jsp. This will allow you switch to a drop-down only in your module and maintain the original OpenAM behavior for all other login screens. (Unfortunately, I don't know how the template attribute is handled in XUI.)


From: [hidden email] <[hidden email]> on behalf of J Singh <[hidden email]>
Sent: Tuesday, July 5, 2016 8:24 AM
To: Users
Subject: [OpenAM] ChoiceCallback displays Radio Buttons instead of Dropdown
 
Hi,

I'm using OpenAM 13 on Apache Tomcat 7. I need to render a ChoiceCallback to user which is essentially a list of items to select from. The problem I'm running into is - the list essentially can be 100s of items and by default the ChoiceCallback renders each item as a RadioButton. I need to render all items in a DropDown List. I was unable to find a setting inside ChoiceCallback to toggle between RadioButton vs. DropDown List. 

Could you please provide me some guidance around this requirement - so that I can render a DropDown instead of Radio Button? 

Thanks.



_______________________________________________
Visit the OpenAM forum at https://forgerock.org/forum/fr-projects/openam/
OpenAM mailing list
[hidden email]
https://lists.forgerock.org/mailman/listinfo/openam



_______________________________________________
Visit the OpenAM forum at https://forgerock.org/forum/fr-projects/openam/
OpenAM mailing list
[hidden email]
https://lists.forgerock.org/mailman/listinfo/openam
Loading...