1

I have a dataTable with cell editing enabled. When editing I would like to navigate through table content with tab key. The problem is when the focus is on a selectOneMenu column. When tab key is pressed to navigate from selectOneMenu cell onto the next cell, tab navigation stops (focus is simply lost).

Any idea how to solve this problem?

My code:

<p:dataTable id="tblElement" var="eltItem" value="#{bean.elementList}" binding="#{bean.dtElements}" editable="true" editMode="cell" rowKey="#{eltItem.id}" resizableColumns="true" >

    <p:column headerText="Key" toggleable="false">
        <p:cellEditor>
            <f:facet name="output">
                <h:outputText value="#{eltItem.key}" />
            </f:facet>
            <f:facet name="input">
                <p:inputText value="#{eltItem.key}" />
            </f:facet>
        </p:cellEditor>
    </p:column>

    <p:column headerText="Type" >
        <p:cellEditor>
            <f:facet name="output">
                <h:outputText value="#{eltItem.dataType.code}" />
            </f:facet>
            <f:facet name="input">
                <p:selectOneMenu value="#{eltItem.dataType}" converter="myConverter" >
                    <f:selectItems value="#{bean.dataTypeList}" var="dt" itemLabel="#{dt.code}" itemValue="#{dt}" />
                </p:selectOneMenu>
            </f:facet>
        </p:cellEditor>
    </p:column>

    <p:column headerText="Path" >
        <p:cellEditor>
            <f:facet name="output">
                <h:outputText value="#{eltItem.path}" />
            </f:facet>
            <f:facet name="input">
                <p:inputText value="#{eltItem.path}"  />
            </f:facet>
        </p:cellEditor>
    </p:column>

</p:dataTable> 

Using PF 5.1.

peterremec
  • 488
  • 1
  • 15
  • 46
  • huge chance this is just not supported (personally never use row or cell editing). But you might try if 5.2-SNAPSHOT or an 5.1.x elite version has improved in this regard (don't think it has though) – Kukeltje Jan 23 '15 at 10:50
  • What do you mean, not supported? There's even a showcase on PF page (http://www.primefaces.org/showcase/ui/data/datatable/edit.xhtml). You can tab navigate there through a second table normally. – peterremec Jan 23 '15 at 10:56
  • Cannot reproduce. This happens intuitively even when using `editMode="row"`. Why are you using `binding="#{bean.dtElements}"` in `` by the way? – Tiny Jan 23 '15 at 11:09
  • @Tiny I use binding for detecting index of the row that I'm editing. – peterremec Jan 23 '15 at 11:17
  • This is unrelated to the concrete problem. [This](http://stackoverflow.com/a/27967924/1391249) is one way to get a row index, if it fits your case. – Tiny Jan 23 '15 at 11:25
  • Sorry, then I misunderstood... Lots of combinations in PF datatable are not supported, and since you did not write it worked in the showcase, the chance was high it would not work at all. If it does work in the showcase but not in yours, then I have no clue. – Kukeltje Jan 23 '15 at 11:26
  • @Tiny Thanks for that information. I'm still new in PrimeFaces, so this solution could be useful for me in the future. – peterremec Jan 23 '15 at 11:35
  • @Kukeltje I understand. I thought maybe it's a converter that somehow stops the tab navigation but I can't really explain why exactly... – peterremec Jan 23 '15 at 11:38
  • Have you asked in the official forum? If so, please provide a link. – Kawu Apr 09 '15 at 15:25
  • I did, no answer... http://forum.primefaces.org/viewtopic.php?f=3&t=40948 – peterremec Apr 10 '15 at 09:51

1 Answers1

0

Same here.

A solution that works for me:

Use h:selectOneMenu instead of p:selectOneMenu.

  • But it works with `p:selectOneMenu` in the showcase... Please state version info if it did not work for you – Kukeltje Mar 15 '16 at 11:41
  • In the showcase they also work with `h:selectOneMenu`. I use version 5.1. – Lord_Firlefanz Mar 15 '16 at 14:16
  • Oops... correct, I was mislead by the default FireFox theme which closely resembles the default theme in the showcase! If this also does not work with PF 5.3 (maybe you can try) then please check if there is an issue that is resolved between 5.3 and the latest 6.0 SNAPSHOT, and if not, please file an issue – Kukeltje Mar 15 '16 at 15:38