Web GUI Design Problem

I am writing a page with several text fields and a dropdown. Fields in the drop-down list affect the meaning of the text fields.
For example: drop-down list options are "a" and "b". The text fields are "first name" and "last name". When selecting “a,” “name” is populated with “Joe.” When "b" is selected, the name "is populated with" Bob ".

I wrote a class containing a drop-down display name and values ​​for "name" and "last name".

Question: from the point of view of design, what is the right solution - changing the class with text fields or changing text fields from the outside and only access to class data?

Thank.

PS - I use ASP.Net and Javascript, but this is more a design issue, not a language.

+3
source share
3 answers

Since the class contains all three controls, it is correct that it changes the text fields, since this is the internal behavior of the class. Now, if the fields were all separate classes, then it would be wiser to manipulate them from the outside.

+1
source

SELECT? SELECT? , ? , , . , SELECT (, , ).

(, ), , , , , .

, , , . , , .

+2

, , . , , , .

, , . , , , . .

0

Source: https://habr.com/ru/post/1736308/


All Articles