cancel
Showing results for 
Search instead for 
Did you mean: 

How to Implement One Validating Method for Different Views

detlev_beutner
Active Contributor
0 Kudos

Hi there,

imagine a component (wizard), where the first two steps (views) are static (view Step1 is followed by view Step2), but the third step is dynamic (dependant on input in view Step2, it will be view Step3a or view Step3b or ...).

The only common thing in all views Step3x are two input fields for dates (begin/end).

The question now is how to implement a validation method so that it works for all views Step3x, without copy/paste.

Within the component context, I have got a node "GenericStep3" with beginDate and endDate values. This is mapped to all view contexts of the views Step3x.

So my idea was to implement the validation methods within the main controller (component controller) and call these method(s) from the view controller. This works one time, then the application stops working.

Any pattern to be used for such thing? I think this is a very common task and there should be a general rule how to handle it?!

Thanks in advance

Detlev

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi there again,

strange enough, now it works (the validating process is implemented within three methods, I had started to move the first method and left the two others for testing purposes within the view controller).

Nevertheless, I cannot realize why my first try did not success. And the question stays the same: Is the way I have chosen the intended way?!

Thanks in advance

Detlev