This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i want to show some default text in PasswordTextBox. first time.
when user clicks on that text box the text should get removed n then i want to allow user to enter password.
so at 1st time it should show text, n then password characters...
Nilesh Pat wrote:
can i put two widgets in same cell?
In the realm of HTML thats possible, in GWT, there is just one setWidget(Widget w) method, so you cant.
However, you could make a widget that contains 2 widgets and shows one at a time.
It sounds like a candidate for the DeckPanel. Heck i would prefer the horizontal panel with one element visible at a time.
As for the rounded corner background, its probably just a style, I dont see why that could create issues.
The way I solved this problem was to extend the TextBox and create a new widget (It was because I had a promptTextBox, which I used for both password and textbox functions: the original source was from turbomanage).
*note: because I'm using this as both a TextBox and PasswordTextBox, I added a Boolean isPassword to my constructor
1st I implement keypresshandler on the widget that extends the TextBox.
2nd onkeypress, I just store what they type into a String called passwordString, and cancel the input, then insert another String called masked with the ASCII code for *.
I know of the old swap of label with textbox, but I don't like the solution because when you add styles, it kind shifts a little.
I don't know how good the solution is for security, so use it at your own risk.