cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic UI control "type"

Former Member
0 Kudos

Hello,

I am attempting to find the best way to handle the following situation:

I have a form with two elements: a drop down list and an input field. The drop down has multiple values. Based on the value selected, the input field will need to be bound to a specific context attribute.

A simple application of this would be a drop down with two values:

Carr ID

Conn ID

If Carr ID is selected, I'd like the input field to be bound to an attribute of type s_carr_id so that I get the appropriate search help. Just the same, if the user selects Conn ID, the input field would be bound to an attribute of type s_conn_id.

I don't know if dynamically assigning attribute types is the right way (or even possible). I know work arounds (such as multiple input fields bound to individual attributes of the correct type that I would manipulate the visibility of per the drop down selection) but I'd like to see what the general input on this is.

thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can achieve this functionality by creating input field in WDDOMODIFY method of that view.

by checking the value user have selected from dropdown you can create new input field in WDODMODIFY method dynamically.

this is the right way to do it.

Former Member
0 Kudos

I contemplated that however considering the user can select as many values as the like from the drop down (that is, they can change a selected value many times before submitting) I would be creating multiple dynamic fields and having to juggle the visibility etc the same as I am doing now with static fields. I am not sure what this gains for me at all.

I was hoping for 1 static field element who's bound attribute type could be changed. I think I'll probably just be going with x forms where x is the number of drop down choices with only 1 visible at any time.

Thanks for your input.

Answers (1)

Answers (1)

Former Member
0 Kudos

Just created at design time the fields and juggled them according to selected values at runtime.

Closing.