Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2019-03-08 Thread renciac
You are a STAR Stefaan!! Thank you so much. After adding validation to the 
inputCell it was a real problem to get the tabbing sorted again. Thank you!

On Friday, September 21, 2012 at 11:11:10 PM UTC+2, Stefaan Vanderheyden 
wrote:
>
> Sorry, I forgot to mention:
>
> You get the currentRow from the index value provided in the field updater 
> and the currentCol by querying the celltable for the updated column's index 
> (cellTable.getColumnIndex(updatedCol))...
>
> On Friday, September 21, 2012 11:09:08 PM UTC+2, Stefaan Vanderheyden 
> wrote:
>>
>> Here is some code you might also find applicable to your use case:
>>
>> private void focusOnNext(final int currentRow, final int currentCol) {
>> // Scan remaining cells in table for a form element to focus on.
>> for (int r = currentRow; r < this.pricingTable.getRowCount(); 
>> r++) {
>> final NodeList rowCells =
>> this.pricingTable.getRowElement(r).getCells();
>> for (int c = 0; c < rowCells.getLength(); c++) {
>> if ((r == currentRow) && (c <= currentCol)) {
>> // don't process these cells since we would be moving 
>> the
>> // focus backwards!
>> } else {
>> if (rowCells.getItem(c).getElementsByTagName("input")
>> .getItem(0) != null) {
>> rowCells.getItem(c).getElementsByTagName("input")
>> .getItem(0).focus();
>> return;
>> }
>> if (rowCells.getItem(c).getElementsByTagName("select")
>> .getItem(0) != null) {
>> rowCells.getItem(c).getElementsByTagName("select")
>> .getItem(0).focus();
>> return;
>> }
>> if 
>> (rowCells.getItem(c).getElementsByTagName("textarea")
>> .getItem(0) != null) {
>> 
>> rowCells.getItem(c).getElementsByTagName("textarea")
>> .getItem(0).focus();
>> return;
>> }
>> }
>> }
>> }
>> }
>>
>> I call this method in my FieldUpdater after redrawing the row on a value 
>> change.  It works very nicely!
>>
>> On Wednesday, July 25, 2012 11:26:04 AM UTC+2, Nitin wrote:
>>>
>>> In the cell table to have tab flow working, I had to do the 
>>> following: 
>>> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>>>
>>> apart from changing the template of TextInputcell. This helped me in 
>>> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
>>> to the next editable cell of the celltable.
>>>
>>> But there is one more requirement in my project which says that the 
>>> enter key should behave as the tab key and hence when we hit enter on a 
>>> particular TextInputcell, the focus should move to the next TextInputcell 
>>> of the celltable. Can anyone please help me with this?
>>>
>>> I have tried lots of things to achieve this, but none is working. This 
>>> is very urgent for the project. Please let me know, if you need more 
>>> information on the issue.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2012-09-21 Thread Stefaan Vanderheyden
Sorry, I forgot to mention:

You get the currentRow from the index value provided in the field updater 
and the currentCol by querying the celltable for the updated column's index 
(cellTable.getColumnIndex(updatedCol))...

On Friday, September 21, 2012 11:09:08 PM UTC+2, Stefaan Vanderheyden wrote:
>
> Here is some code you might also find applicable to your use case:
>
> private void focusOnNext(final int currentRow, final int currentCol) {
> // Scan remaining cells in table for a form element to focus on.
> for (int r = currentRow; r < this.pricingTable.getRowCount(); r++) 
> {
> final NodeList rowCells =
> this.pricingTable.getRowElement(r).getCells();
> for (int c = 0; c < rowCells.getLength(); c++) {
> if ((r == currentRow) && (c <= currentCol)) {
> // don't process these cells since we would be moving 
> the
> // focus backwards!
> } else {
> if (rowCells.getItem(c).getElementsByTagName("input")
> .getItem(0) != null) {
> rowCells.getItem(c).getElementsByTagName("input")
> .getItem(0).focus();
> return;
> }
> if (rowCells.getItem(c).getElementsByTagName("select")
> .getItem(0) != null) {
> rowCells.getItem(c).getElementsByTagName("select")
> .getItem(0).focus();
> return;
> }
> if 
> (rowCells.getItem(c).getElementsByTagName("textarea")
> .getItem(0) != null) {
> 
> rowCells.getItem(c).getElementsByTagName("textarea")
> .getItem(0).focus();
> return;
> }
> }
> }
> }
> }
>
> I call this method in my FieldUpdater after redrawing the row on a value 
> change.  It works very nicely!
>
> On Wednesday, July 25, 2012 11:26:04 AM UTC+2, Nitin wrote:
>>
>> In the cell table to have tab flow working, I had to do the 
>> following: 
>> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>>
>> apart from changing the template of TextInputcell. This helped me in 
>> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
>> to the next editable cell of the celltable.
>>
>> But there is one more requirement in my project which says that the enter 
>> key should behave as the tab key and hence when we hit enter on a 
>> particular TextInputcell, the focus should move to the next TextInputcell 
>> of the celltable. Can anyone please help me with this?
>>
>> I have tried lots of things to achieve this, but none is working. This is 
>> very urgent for the project. Please let me know, if you need more 
>> information on the issue.
>>
>

-- 
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/-/He1vUgXUeFIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2012-09-21 Thread Stefaan Vanderheyden
Here is some code you might also find applicable to your use case:

private void focusOnNext(final int currentRow, final int currentCol) {
// Scan remaining cells in table for a form element to focus on.
for (int r = currentRow; r < this.pricingTable.getRowCount(); r++) {
final NodeList rowCells =
this.pricingTable.getRowElement(r).getCells();
for (int c = 0; c < rowCells.getLength(); c++) {
if ((r == currentRow) && (c <= currentCol)) {
// don't process these cells since we would be moving 
the
// focus backwards!
} else {
if (rowCells.getItem(c).getElementsByTagName("input")
.getItem(0) != null) {
rowCells.getItem(c).getElementsByTagName("input")
.getItem(0).focus();
return;
}
if (rowCells.getItem(c).getElementsByTagName("select")
.getItem(0) != null) {
rowCells.getItem(c).getElementsByTagName("select")
.getItem(0).focus();
return;
}
if (rowCells.getItem(c).getElementsByTagName("textarea")
.getItem(0) != null) {
rowCells.getItem(c).getElementsByTagName("textarea")
.getItem(0).focus();
return;
}
}
}
}
}

I call this method in my FieldUpdater after redrawing the row on a value 
change.  It works very nicely!

On Wednesday, July 25, 2012 11:26:04 AM UTC+2, Nitin wrote:
>
> In the cell table to have tab flow working, I had to do the 
> following: 
> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>
> apart from changing the template of TextInputcell. This helped me in 
> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
> to the next editable cell of the celltable.
>
> But there is one more requirement in my project which says that the enter 
> key should behave as the tab key and hence when we hit enter on a 
> particular TextInputcell, the focus should move to the next TextInputcell 
> of the celltable. Can anyone please help me with this?
>
> I have tried lots of things to achieve this, but none is working. This is 
> very urgent for the project. Please let me know, if you need more 
> information on the issue.
>

-- 
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/-/75zP9aeD6GoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2012-07-25 Thread Andrei
It's called on all events in all cells, i.e. Blur, MouseOver, Click, etc. 
Just add a check for the type of event you want to process, like

if ("blur".equals(event.getNativeEvent().getType())) {
// do something with a cell that loses focus
}
if ("focus".equals(event.getNativeEvent().getType())) {
// do something with a cell that receives focus
}

-- 
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/-/-3DdvZ6VO2gJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2012-07-25 Thread Thomas Broyer


On Wednesday, July 25, 2012 6:23:05 PM UTC+2, Nitin wrote:
>
> cellTable.addCellPreviewHandler() did the trick for me. 
>
> Now the issue is that, this method is getting called twice. Could someone 
> explain the reasons for the handler getting called twice?
>

When changing the focused element while processing a keyboard event, some 
browsers fire the event again on the newly focused element. That's probably 
the reason it's being called twice in your case.

-- 
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/-/TGW4pYWdKbwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Enter key to change the focus from one TextInputCell to another in a celltable.

2012-07-25 Thread Nitin
cellTable.addCellPreviewHandler() did the trick for me. 

Now the issue is that, this method is getting called twice. Could someone 
explain the reasons for the handler getting called twice?

On Wednesday, 25 July 2012 14:56:04 UTC+5:30, Nitin wrote:
>
> In the cell table to have tab flow working, I had to do the 
> following: 
> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>
> apart from changing the template of TextInputcell. This helped me in 
> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
> to the next editable cell of the celltable.
>
> But there is one more requirement in my project which says that the enter 
> key should behave as the tab key and hence when we hit enter on a 
> particular TextInputcell, the focus should move to the next TextInputcell 
> of the celltable. Can anyone please help me with this?
>
> I have tried lots of things to achieve this, but none is working. This is 
> very urgent for the project. Please let me know, if you need more 
> information on the issue.
>

On Wednesday, 25 July 2012 14:56:04 UTC+5:30, Nitin wrote:
>
> In the cell table to have tab flow working, I had to do the 
> following: 
> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>
> apart from changing the template of TextInputcell. This helped me in 
> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
> to the next editable cell of the celltable.
>
> But there is one more requirement in my project which says that the enter 
> key should behave as the tab key and hence when we hit enter on a 
> particular TextInputcell, the focus should move to the next TextInputcell 
> of the celltable. Can anyone please help me with this?
>
> I have tried lots of things to achieve this, but none is working. This is 
> very urgent for the project. Please let me know, if you need more 
> information on the issue.
>

On Wednesday, 25 July 2012 14:56:04 UTC+5:30, Nitin wrote:
>
> In the cell table to have tab flow working, I had to do the 
> following: 
> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>
> apart from changing the template of TextInputcell. This helped me in 
> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
> to the next editable cell of the celltable.
>
> But there is one more requirement in my project which says that the enter 
> key should behave as the tab key and hence when we hit enter on a 
> particular TextInputcell, the focus should move to the next TextInputcell 
> of the celltable. Can anyone please help me with this?
>
> I have tried lots of things to achieve this, but none is working. This is 
> very urgent for the project. Please let me know, if you need more 
> information on the issue.
>

On Wednesday, 25 July 2012 14:56:04 UTC+5:30, Nitin wrote:
>
> In the cell table to have tab flow working, I had to do the 
> following: 
> cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
>
> apart from changing the template of TextInputcell. This helped me in 
> getting the tab flow working properly i.e. when I hit TAB the focus shifts 
> to the next editable cell of the celltable.
>
> But there is one more requirement in my project which says that the enter 
> key should behave as the tab key and hence when we hit enter on a 
> particular TextInputcell, the focus should move to the next TextInputcell 
> of the celltable. Can anyone please help me with this?
>
> I have tried lots of things to achieve this, but none is working. This is 
> very urgent for the project. Please let me know, if you need more 
> information on the issue.
>

-- 
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/-/zG2Y3qN6bhgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Enter key to change the focus from one TextInputCell to another in a celltable.

2012-07-25 Thread Nitin


In the cell table to have tab flow working, I had to do the 
following: 
cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);

apart from changing the template of TextInputcell. This helped me in 
getting the tab flow working properly i.e. when I hit TAB the focus shifts 
to the next editable cell of the celltable.

But there is one more requirement in my project which says that the enter 
key should behave as the tab key and hence when we hit enter on a 
particular TextInputcell, the focus should move to the next TextInputcell 
of the celltable. Can anyone please help me with this?

I have tried lots of things to achieve this, but none is working. This is 
very urgent for the project. Please let me know, if you need more 
information on the issue.

-- 
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/-/Hc-P6fZQIZQJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.