cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

0 Likes
View Entire Topic
Former Member
0 Likes

Hi Thank You for your help

but the Method

wd_comp_controller->refresh( )

does not exist. where can i find the method refresh()?

former_member211591
Contributor
0 Likes

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

former_member211591
Contributor
0 Likes

oh I am sorry, I now get Amy's first approach.

She suggest to refresh at componentcontroller, thus WDDOINIT of the views will be called again.

This really would the easiest approach.

Any drawbacks?

amy_king
Active Contributor
0 Likes

Hi Tobias,

The refresh method is a method that I added to the componentcontroller myself. Create a new method in your componentcontroller with the following code.

  
  method refresh .     
    wd_context->invalidate( ).   
  endmethod. 

Cheers,

Amy