cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically changing the UI

Former Member
0 Kudos

Hi Everybody,

I have a view (view 1) which is being mapped with another view(view2). When I trigger my firePlug from View 1, the UI element should be a InputField with STRING as Datatype. and Similarly when I load the View2 thru wdinit(), it should dynamically change into InputField with Date...

Regards/Guru

Accepted Solutions (0)

Answers (5)

Answers (5)

sid_sunny
Contributor
0 Kudos

Hi Kumara Guru,

As mentioned by Monalisa you can have two Input Field one binded to a context attribute of type String and other Input Field element binded to a context attribute of type date and both having there visible property binded to two context attribute both of type Visibility now before navigating to view two change the visibility property of the appropriate Input Field.

Regards

Sid

monalisa_biswal
Contributor
0 Kudos

Instead of changing same input field's type you can have two input fields (one for taking date type input and another for taking string type data) at design time and map their visibility property to two context value attributes.At runtime set one value attribute to WDVisibility.Visible and another to WDVisibility.None .

Former Member
0 Kudos

Why do you want to do that? Can you describe the use case?

Armin

Former Member
0 Kudos

Hi Kumara,

it is not possible to change the Input field type. But if create a second field in the component controller with the type date and than copy the string with the method new date (year, mm, dd) to the this new field.

You must transfrom the String in 3 int field. (2007-03-20)

year = 2007; mm = 03 ; dd = 20 )

Map this date field to the view2 an you get in this view the Date

Component Controller

Field 1 --> type String

Field 2--> type date

View 1 --> Controller

Field1 is mapped to the controller Field 1

View 2 --> controller

Field 2 is mapped to the controller field 2

I hope this helps

Regads

Gunter

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

for input field with string, create a context attribute with string datatype , and follow the code,

IWDTransparentContainer tCont = (IWDTransparentContainer)view.getRootElement();

IWDInputField inFld = (IWDInputField)view.createElement(IWDInputField.class, <name>);

//bind this with string context attribue

inFld.bindValue(<context element>);

tCont.addChild(inFld;)

write this code in fireplug form view1.

for date do the same with context attribute as date and with value set for current date . write this in wdinit()

regards,

abhijeet

Message was edited by:

abhijeet mukkawar