Editable CellTable with password column

76 views
Skip to first unread message

Kanagaraj M

unread,
Aug 17, 2012, 1:57:19 PM8/17/12
to google-we...@googlegroups.com
I have CellTable with password as one column. I want the password column to be editable.

I have used EditTextCell to make the password as editable, but the problem is, the password is shown as plain text.

As like we have PasswordTextBox, do we have any alternative for EditTextCell? or i need to write my own by extending EditTextCell?

Can anyone please help me in this?

Juan Pablo Gardella

unread,
Aug 17, 2012, 1:59:52 PM8/17/12
to google-we...@googlegroups.com
You must write a custom EditTextCell.

2012/8/17 Kanagaraj M <kanaga...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/v_owA6X5h1wJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Kanagaraj M

unread,
Aug 20, 2012, 7:23:29 AM8/20/12
to google-we...@googlegroups.com
I have tried doing that. 
My code is something like follows

public class EditPasswordTextCell extends EditTextCell {


    @Override
    protected void edit(Context context, Element parent, String value) {
        setValue(context, parent, value);
        InputElement input = getInputElement(parent);
        input.setAttribute("type", "password"); //$NON-NLS-1$ //$NON-NLS-2$
        input.focus();
        input.select();
    }
}

This brings up a password box when clicking on the cell. But after finished editing and the value shown in the column is in plain text. Then i decided to override the renderer methods. But most of the methods in EditTextCell class are private, so i ended up overriding 

    @Override
    public void render(Context context, String value, SafeHtmlBuilder sb) {
        value = "******"; //$NON-NLS-1$
        super.render(context, value, sb);
    }

The above code works fine for first rendering and not for the subsequent. 

Now the question arises, should i extend from EditTextCell or AbstractEditableCell?

Can anyone please help me in this?


On Friday, 17 August 2012 23:29:52 UTC+5:30, Juan Pablo Gardella wrote:
You must write a custom EditTextCell.

2012/8/17 Kanagaraj M <kanaga...@gmail.com>
I have CellTable with password as one column. I want the password column to be editable.

I have used EditTextCell to make the password as editable, but the problem is, the password is shown as plain text.

As like we have PasswordTextBox, do we have any alternative for EditTextCell? or i need to write my own by extending EditTextCell?

Can anyone please help me in this?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/v_owA6X5h1wJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages