cancel
Showing results for 
Search instead for 
Did you mean: 

simple web dynpro application

gill367
Active Contributor
0 Kudos

i m new to web dynpro java. i m trying to make an application having only one view. In this view there is one button , one label and one input field.i want that whatever the user enters in inputfield is passed to the label. for that what i need to add in the context of the view and what i need to write in the eventhandeller of the button.

can anybody please suggest on this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

U have to follow following steps...

1. Create a context with name like inputfield( that u will mapped to Input field by going in to the properties of input field values).

2.create one more context with name label and mapped this to label field.

3. go to button properties select action there will be three button in the right hand side click on last one one window will open there create new action.

4. now click on go button there just write this line of code

wdcontext.currentcontext.setlabel(wdcontext.currentcontext.getinput)

deploy it will work....

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Step-1:

Create 3 UI elements one lable and one inputfilsd and one button.

Step-2;

Take one value attribute in context called valueinput.

Step-3:

Map the value property of the inputfield to context value attribute created(valueinput);

and map the text property of the label to context value attribute created(valueinput).

Finally rebuild and deploy and run.

Regards,

H.V.Swathi

Former Member
0 Kudos

Hi,

1) Create two context attributes .(Va_Input, Va_Label)

2) Bind Va_Input to the input field .

3) In the text property of label, bind the context attribute Va_Label.

(On the Right Hand side of the Text propert there is a button after Reset, using which you can bind the context attribute with the label)

4) In the implementation of the action associated with the button write the following code:

wdContext.currentContextElement().setVa_Label(wdContext.currentContextElement().getVa_Input());

Hope it helps.

Regards.

Rajat

Former Member
0 Kudos

Hi,

create one value attribute and bind that attribute to value property of input field.

Create an action in that action get that value from that attribute and set it to label field.

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi

that means you want pass the value enter in the input field to the label after an event is triggered.

Take two attributes in the context node.

Context

attr1--->inputfield

attr2-->Label

bind one context attribute to the inputfield and another to the label.

On Action of Button,add the following code.

String str1= wdContext.currentContextElement().getattr1();

wdContext.currentContextElement().setattr2(str1);