0 Replies Latest reply on May 18, 2010 10:39 AM by poschd

    Does an extendedDataTable have a focus?

    poschd

      Hi everyone,

       

      I am working on a dynamic table that has input fields in it and saves changes automatically. It basically works using <a4j:support/> within the input fields. Now, a user might enter a last input and then click directly on the menu - and the expected behavior is to save the last row as well. My idea was to check if the <rich:extendedDataTable/> loses its focus and, if so, call another action method. You will get an idea of my intention when having a look at the code. Anyway, that does not work (neither did it work in any other way that I have tried so far). That leads me to the following questions:

       

      • Does a <rich:extendedDataTable/> have a focus?
      • If so, how can I check when it loses the focus?
      • If not, do you have any other ideas how to manage saving my data automatically?

       

      Thanks a lot for your help!

       

      Best regards,

      Daniel

       

      PS: Here's the code that I want to get working

       

      <h:form>
          <rich:extendedDataTable id="etTable" value="#{etList}" var="viewet"
              sortMode="multi" height="720px" rowClasses="rvgRowOne,rvgRowTwo">
              
      
              <a4j:support event="onblur" action="#{iws1e_detail.onTableBlur}"
                  ajaxSingle="true" /> <!-- this does NOT work -->
              
      
              <!-- ... -->
      
              <!-- this works fine -->
              <rich:column sortBy="#{viewet.contype}" label="Contype" width="8%"
                  filterBy="#{viewet.contype}" id="columnContype">
                  <f:facet name="header">ConType</f:facet>
                  <h:inputText id="inputContype" value="#{viewet.contype}"
                      onkeypress="Navigate(event,this)">
                      <a4j:support event="onfocus" action="#{iws1e_detail.onEditFocus}"
                          ajaxSingle="true"/>
                  </h:inputText>
              </rich:column>
              <rich:column sortBy="#{viewet.application}" label="Application" width="8%"
                  filterBy="#{viewet.application}" id="columnApplication">
                  <f:facet name="header">Application</f:facet>
                  <h:inputText id="inputApplication" value="#{viewet.application}"
                      onkeypress="Navigate(event, this)">
                      <a4j:support event="onfocus" action="#{iws1e_detail.onEditFocus}"
                          ajaxSingle="true"/>
                  </h:inputText>
              </rich:column>
              <rich:column sortBy="#{viewet.comments}" label="Comments" width="8%"
                  filterBy="#{viewet.comments}" id="columnComments"
                  text-align="center">
                  <f:facet name="header">Comments</f:facet>
                  <h:inputText id="inputComments" value="#{viewet.comments}"
                      onkeypress="Navigate(event,this)">
                      <a4j:support event="onfocus" action="#{iws1e_detail.onEditFocus}"
                          ajaxSingle="true"/>
                  </h:inputText>
              </rich:column>
              <rich:column sortBy="#{viewet.memodate}" label="Memodate" width="8%"
                  filterBy="#{viewet.memodate}" id="columnMemodate">
                  <f:facet name="header">MemoDate</f:facet>
                  <h:inputText id="inputMemodate" value="#{viewet.memodate}"
                      onkeypress="Navigate(event,this)">
                      <a4j:support event="onfocus" action="#{iws1e_detail.onEditFocus}"
                          ajaxSingle="true"/>
                  </h:inputText>
              </rich:column>
      
              <!-- ... -->
      
          </rich:extendedDataTable>
      </h:form>