on 06-13-2007 8:15 AM
Hello All,
I am new to web Dyn Pro. I have to read the value of the input Field on the click of button.
For that I creted a application. In the aplication a create a start view. In the layout of
start view I define two field one input field and other is button. And define inbound Plug
and the outbound Plug. In the context tab I create a node node1. In the node define an
attibute of type String.Then in the layout Bind the input field value with the context node
attibute. And also define the event on the onAction of the Button as onclick.And also drag
the view in the window.Now my requirement is to get the value of the input field on the
click on button in the onclick action.
PLease suggest me what code I have to write in the onAction to read the value of input Field
Regards
Hi,
Create a node in your context and declare an attribute of type string. Bind this attribute to the "value" property of your input field.
Once you enter a value in the input field and click the button, all you have to do is read the attribute value from the context. You can use the wizard to help you with the code.
Hope this helps.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have selected the option to fire an event. You should select the option "Read context node/attribute" in the wizard.
Then using F4 help, select the context which you want to read. You can directly select an attribute itself. Then the code will be generated. Go through some beginners tutorials which will probably help you with screenshots.
Regards,
Nithya
Hi Harpeet,
The option you have chosen is used to call a method. Since you have chosen an event handler method, you have to supply the formal parameters - which is not possible.
So, to read the attribute, use the read context/attribute option and select your attribute name.
Before this, you need to create an event handler for your button. This can be done by specifying a name in the 'OnAction' (under 'events') in the properties for the button. Once this is done, just double click on the method name to open the code editor for the event handler.
Once you are inside the event handler, you can use the code wizard to read the value.
Regards,
Ram
hi.
you can find an example how to read the context in this wiki:
https://wiki.sdn.sap.com/wiki/display/WDABAP/Context
Cheers,
Sascha
Thanks a lot Nithya. I have assign you ful points.
Now I have another query I have to go to the next page and passing the value of the inputfield in the next page.I will open a new thread for that.
Regards
Harpreet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harpeet,
You can use the code wizarrd (ctrl + F7) to read the context attribute that you have bound to the input field.
Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.