on 2012 Aug 02 2:40 PM
Hi,
i created a View with severel Input Fields. Normal Text Filds and Dropdown by Index Fields and some Date Fields.
Now i wanted to give the User the ability to clear his input.
I try to use Invalidate() but this kills my Dropdown Fields.
Is there a Function that resets my fields, without destroying my Dropdown Fields?
Regards
Tobias Kübler
Hi Tobias,
I have a method of my componentcontroller which clears all nodes of the context, in effect resetting all views to their initial states.
method refresh .
wd_context->invalidate( ).
endmethod.
Since I populate my dropdown lists in the componentcontroller WDDOINIT method, I can call wd_comp_controller->refresh( ) from any view and not lose the dropdown list value sets.
An alternate approach could be to put your code which populates your dropdown lists into a separate method. Then you could call
lo_nd_mynode->invalidate( ).
wd_this->initialize_node_dropdown( ).
Cheers.
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
We can simply do this task by using code wizard...
Set the node attributes to null on click of RESET button.
For Ex.
i have LOGIN node with two attribute username and password.On click of Reset button we have to reset the values present in Username and Password I/O field.
Inside the Onaction handler of RESET button...code wizard + SET radio button + select the the LOGIN node as context node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finaly Did it.
Thanks a lot for all helpers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ah ok...so the WDDOINIT cann not be called....
lol how should i now this.
ok no i will move my coding...to method i think now this whis solve my problem...
i will report if i am successfull
Thanks to all helpers
Regrads Tobias Kübler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tobias,
You cannot call the WDDO** methods yourself though you can add your own code to them. Those methods are called hook methods and are called by the Web Dynpro runtime during its processing flow.
Cheers,
Amy
ok no i get it a little bedder my fault was to create the method refresh in my view.
now i created it in the Component controles as Amy sad (shame on me)
an now i can use
this code
method ONACTIONCLEAR .
WD_COMP_CONTROLLER->REFRESH( ).
endmethod.
but again all DD Filds are gedding killed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How does your drop down gets filled? Do you have a method which fills your DD?
Say you have a method for example FILL_DD in your component controller to fill your drop down when the application starts, all you have to do is.
method ONACTIONCLEAR .
WD_COMP_CONTROLLER->REFRESH( ).
WD_COMP_CONTROLLER->FILL_DD( ).
endmethod.
Say you have a method for example FILL_DD in your VIEW to fill your drop down when the application starts, all you have to do is
method ONACTIONCLEAR .
WD_COMP_CONTROLLER->REFRESH( ).
WD_THIS->FILL_DD( ).
endmethod.
Hi Tobias,
There are two parts to this approach. You've created the componentcontroller method refresh, but you also need to populate your dropdown lists in the componentcontroller's WDDOINIT method so that when the refresh happens, the WDDOINIT method is called by the runtime and your dropdown lists are repopulated.
Cheers,
Amy
I Created the Method REFRESH in my View
whith this coding
method REFRESH .
wd_context->invalidate( ).
endmethod.
In my Method ONACTIONCLEAR (my button)
i wrote
method ONACTIONCLEAR .
WD_COMP_CONTROLLER->REFRESH( ).
endmethod.
but i get this error
Web-Dynpro-Comp. / Intf. ZWD_ABSOLVENTEN_BETA,Web-Dynpro-View ANLEGEN
Methode ONACTIONCLEAR
Die Methode "REFRESH" ist unbekannt bzw. PROTECTED oder PRIVATE.
Now it tryed
WD_THIS->REFRESH().
and i didnt get any errors and the button worked but my DD-Lists are geding killed (empty) as before
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And this may help you.
Consider an example.
You have a component controller, a view VIEW1 and a method METH1.
Case 1: If METH1 is in Component Controller.
- You can call this method from within the component controller using WD_THIS->METH1.
- you can also call this method from VIEW1 using WD_COMP_CONTROLLER->METH1.
Case 2: If METH1 is in VIEW1
- You can only call this method from VIEW1 using WD_THIS->METH1.
You cannot call WDDOINIT method. It is only called from run time.
Do one thing.
Remove the code that fills DD from WDDOINIT and create a new method say for example FILL_DD.
Now write the code here.
1. Call this method from WDDOINIT
2. Also call this method from ONACTIONCLEAR. ( Remember, do this only AFTER invalidate( ). )
Hi Tobias,
From what you wrote, you created the refresh method in your VIEW, but then you ask the COMPONENTCONTROLLER to execute it. If refresh is a method of your view, then your VIEW should call it. Otherwise create the method in your componentcontroller and then any view can call the method by asking the componentcontroller to execute it.
wd_comp_controller->refresh( ).
Cheers,
Ah ok it is possiple to refresh the hole Method WDDOINIT of the view...
but how?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ismail,
ah i think now i understand. My DD-List ist actualy not created by supply functions, so i have this problem. Is there a list of Supply Functions for DD Lists mhh. maybe someone here has a tip for me.
i Tink i can see a little light at the end of the tunnel 😄
Thanks for all Helpers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thank You for your help
but the Method
wd_comp_controller->refresh( )
does not exist. where can i find the method refresh()?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tobias,
you have to create refresh( ) by yourself. Refresh( ) must not be a method of the component controller, only if you have a context mapping from your view to your component controller. i.e. you can create refresh( ) also in your view-controller.
If you populate your drop-down list by a supply-function, the drop down list will be repopulated if you invalidate( ). invalidate( ) initializes all fields, thus also calls the supply functions .
so you have imho two possible approaches:
1. if you don't use supply-functions, you got to use Amy's approch. Refresh and populate yourself.
2. you use supply functions and just call invalidate( ). as you tried before.
So maybe it is easier for you to try the second approach. Change your method, which populates your drop-down-list to its supply function and test your component again.
BR,
ismail
User | Count |
---|---|
69 | |
13 | |
11 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.