• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Show default text in PasswordTextBox.

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...

 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why have you posted in bold, huge letters ?

You could do something simple like using a label to display a message and when it's clicked, show a password box there.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Salvin is correct.
Nilesh you can use the button to remove the bold
 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Salvin is correct.
Nilesh you can use the button to remove the bold





thank you for your replay..
and it was my first time when i post this message so.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try my suggested solution Nilesh ?
 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i tried it's demo just now.
it's good solution. but i am using rounded corner text boxes. so i have to adjust label perfectly on password text box.
hope it will work.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nilesh Pat wrote:yes i tried it's demo just now.
it's good solution. but i am using rounded corner text boxes. so i have to adjust label perfectly on password text box.
hope it will work.



I believe there is no such thing as a rounded corner textbox,
I think you are probably wrapping up your password widget in a panel having rounded corners (mostly a decorated panel)

What I am suggesting is to wrap a label instead of a password widget in the same place and when user clicks it, change it back to password widget.
 
Nilesh Pat
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i have used a single image of a rounded rectangle and set it as background of password textbox in css.
and then set the text box in a cell of flex table.

can i put two widgets in same cell?? so i can set one visible. and another invisible.
i think it will..
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my first time to post:

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.

Hope this helps.

Jay
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in case anyone wondered here is a very simple solution:

TextBox textBox = new TextBox();
textBox.getElement().setPropertyString("type", "password");
 
Slime does not pay. Always keep your tiny ad dry.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic