How to create "choice" field on "UI PAGE"

sinu2
Tera Expert

Hi all,

 

I have created a UI PAGE and i need to create one choice field with four options. How to create choice field. I have created reference field and string field but i am stuck to create a choice field with options.

 

plese find my script

 

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<!--<div>
the Below Employee Name to be updated</div>-->
<g2:evaluate var="jvar_changes" jelly="true">
var tc = new GlideRecord('cmdb_ci_computer');
tc.query();
</g2:evaluate>
<g:ui_form>
<div><label id="success_label" style="color:green;display:none;">You have Updated Record SuccessFully !</label></div>

<div style="width:300px;">
Select Device to Rename : <g:ui_reference name="cmdb_sysid" id="cmdb_sysid" table="cmdb_ci_computer" query="active=true" show_popup="true" show_lookup="true" />
</div>
<div style="width:300px;">
Device Location : <g:ui_reference name="location_sysid" id="location_sysid" table="cmn_location" query="active=true" show_popup="true" show_lookup="true" />
</div>
<div style="width:300px;">Device New Name : <input type="text" id="Device_New_Name" name="device" value=""/></div>
<div><input type="button" onClick="getSelectedEmployeeValue();" value="Rename Device"/></div>
</g:ui_form>
</j:jelly>

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,

Please try this in your HTML and let me know if it works for you. 

g:ui_choice_input_field is used for choice list/

<?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>
</j:jelly>

View solution in original post

3 REPLIES 3

Alikutty A
Tera Sage

Hi,

Please try this in your HTML and let me know if it works for you. 

g:ui_choice_input_field is used for choice list/

<?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>
</j:jelly>

@Alikutty A ,

Hey, I have to remove two options from choice field which is referred to a table from html tag of jelly script.

Any ideas how to do that?

Hi 

Any idea how can we make it work without manually tping all options instead somehow calling some choices from sys_choice table? Is it possible?