Is there any way to format a Choice list in a UI Page

MrRalphMan
Giga Expert

Hi,

I'm designing a UI Page and am using the g:ui_choicelist function to pull in a Choice field, but the formatting leaves a little to be desired.

find_real_file.png

After being able to use Bootstrap for the other elements, this just makes the page look odd.

Is there anyway to format this field, I've tried using class="" in the field, but this doesn't seem to work.

Not the end of the world, but would be nice to make it look slightly better.

Paul

1 ACCEPTED SOLUTION

MrRalphMan
Giga Expert

Hi,

Thank you for the replies, yeah I could create my own Select or Choice Input field, but I wanted to use ServiceNow's Choice Field, so I don't have to double key the choices.

I guess we'll just have to live with the standard look.

Paul

View solution in original post

3 REPLIES 3

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

If you want to apply CSS to this  g:ui_choicelist i believe it won't work. you can create a choice list using selectbox option in HTML.

 

https://www.w3schools.com/tags/tag_select.asp


Thanks,
Ashutosh

Shubham Sanjay
Kilo Expert

Hi,

 

Use code like this, hope so it works.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_choice_input_field id="choice_id" name="choice_name" label="${gs.getMessage('Select Option')}"> <option value="none">${gs.getMessage('--None--')}</option> <option value="1">ABC</option> 
<option value="2">CDE</option> <option value="3">EFG</option> <option value="4">HIJ</option> <option value="5">JKL</option> </g:ui_choice_input_field>

 

Mark helpful if it helped solve your problem.

 

Thanks and Regards,

Shubham Sanjay Gupta.

MrRalphMan
Giga Expert

Hi,

Thank you for the replies, yeah I could create my own Select or Choice Input field, but I wanted to use ServiceNow's Choice Field, so I don't have to double key the choices.

I guess we'll just have to live with the standard look.

Paul