Since User Info & Address were used at the time of Signing Up & Updating Profile, so How to design GWT Gui to reuse the components & action?

StackOverflow https://stackoverflow.com//questions/22062998

  •  23-12-2019
  •  | 
  •  

Question

Ok, Here is the problem.

At the time user signup, user need to provide info such as:

-Email:______________   -UserName:____________
-FName:______________   -LName:_______________
-Address:____________ (User can have option to update Address lately)
....

-Captcha:__________

[Sign Up]    [Reset]

Now suppose that user already got an account & they want to modify their info, then the Gui Could be 40% similar to the the above one.

-FName:______________   -LName:_______________ [Update Name]

-Address:____________ [Update Address]
....

My question is how to design GWT Gui in such a way that we can reuse the Gui components and the Action in both situations?

Maybe put all GUI into 1 page & have 2 different params: 1 for handling Signing Up Ex: #profile;actionParam="signup", & the other for Updating Profile Ex:#profile;actionParam="modify".

We can also use PresenterWidget but I think PresenterWidget is for using the exact same code everywhere, but in my case the Gui need to be modified a bit.

In Java we can do like Parent and Child Inheritance, but I am not sure if we an do similar things like that in GWT?

Can u find a better solution?

Was it helpful?

Solution

You can use the exact same view (widget) and simply hide some fields based on your criteria. You can also group these extra components in one container, so you can hide/show them with a single call:

.newUserPanel.setVisible(user == new);

You can extends widgets in GWT - all of the "standard" widgets extend and implement something - but in this use case the benefits are probably too small to justify two separate views/widgets. But it's possible if you decide to go this route.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top