Re: CellTable keyboard events troubles in Chrome
I know this is not a "funny" question, but if someone already had this kind of issue or have any suggestion, help would be very appreciated as I could not make it work correctly in Chrome.
GWT-team ?
Thanks
Yves
Le dimanche 3 novembre 2013 19:37:03 UTC+1, yves a écrit :
-- GWT-team ?
Thanks
Yves
Le dimanche 3 novembre 2013 19:37:03 UTC+1, yves a écrit :
Hi All,
After a search on the internet and in this group I didn't found help for the issue I have.
So I ask here if someone has any advice or workaround.
I just tried basic example of CellTable found here http://www.gwtproject.org/doc/latest/DevGuideUiCellWidgets. , and put the cellTable in an empty VerticalPanel somewhere in my app.html
In Chrome only, the example doesn't work correctly : almost all keyboard events have no effect. Only Delete, Backspace, CTRL-Z + other CTRLs and ENTER keys work. It is impossible to type in some text : alphanumeric key events have no effect on the content of the cells.
With other browsers than Chrome the CellTable example works without any problem !
For the test I use :
GWT 2.5.1
Test NOT OK : Chrome 32.0.1687.2 dev-m Aura
Test OK : Firefox : 24.0
Test OK : Opera : 12.11
Test OK : Safari : 5.1.7
(no test on IE as I have only IE6, for other tests purpose...)
Thank you for your help.
Yves
/**
* A simple data type that represents a contact with a unique ID.
*/
private static class Contact {
private static int nextId = 0;
private final int id;
private String name;
public Contact(String name) {
nextId++;
this.id = nextId;
this.name = name;
}
}
/**
* The list of data to display.
*/
private static final List<Contact> CONTACTS = Arrays.asList(new Contact("John"), new Contact("Joe"), new Contact("George"));
/**
* The key provider that allows us to identify Contacts even if a field
* changes. We identify contacts by their unique ID.
*/
private static final ProvidesKey<Contact> KEY_PROVIDER =
new ProvidesKey<Contact>() {
@Override
public Object getKey(Contact item) {
return item.id;
}
};
.........
initWidget(uiBinder.createAndBindUi(this));
// Create a CellTable with a key provider.
final CellTable<Contact> table = new CellTable<Contact>(KEY_PROVIDER);
table.setKeyboardSelectionPolicy( KeyboardSelectionPolicy. ENABLED);
// Add a text input column to edit the name.
final TextInputCell nameCell = new TextInputCell();
Column<Contact, String> nameColumn = new Column<Contact, String>(nameCell) {
@Override
public String getValue(Contact object) {
// Return the name as the value of this column.
return object.name;
}
};
table.addColumn(nameColumn, "Name");
// Add a field updater to be notified when the user enters a new name.
nameColumn.setFieldUpdater(new FieldUpdater<Contact, String>() {
@Override
public void update(int index, Contact object, String value) {
// Inform the user of the change.
Window.alert("You changed the name of " + object.name + " to " + value);
// Push the changes into the Contact. At this point, you could send an
// asynchronous request to the server to update the database.
object.name = value;
// Redraw the table with the new data.
table.redraw();
}
});
// Push the data into the widget.
table.setRowData(CONTACTS);
vp.add(table);
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home