0 Replies Latest reply on Jan 29, 2010 4:17 PM by Arbi Sookazian

    Dynamically setting tabindex for multiple components

    Arbi Sookazian Master

      I have multiple input fields in my form (some h: and some rich:).

       

      I need to be able to set the tabindex dynamically (i.e. no hardcoding like below) in case we add another component in the future to the facelet so we don't have to go thru and change all the hard-coded values to keep the tabbing in proper order.  How can we accomplish this in RF/Seam/JSF?  I was thinking about storing and incrementing the tabindex value in the conversation-scoped backing bean but I'm not sure if it's possible for the program to know what order the tabbing needs to be in (left to right, top down).  Is there a solution for this or must we hard-code the tabindex attribute for all input fields?  thx.

       

      <rich:calendar inputClass="dateField"
                                      required="true"
                                      tabindex="3"
                                      disabled="#{pageaction == 'view'}"
                                      value="#{cardBillingAndSettlementEditorUI.chargebacksEffectiveDate}"
                                      datePattern="MM/dd/yyyy"
                                      enableManualInput="true"
                                      onchanged="checkDateRange(this, 90, 90);"
                                      oninputkeypress="return restrictDate(this, event);"
                                      oninputchange="checkDateRange(this, 90, 90);"
                                      label="#{messages['/restricted/merchant/chargebacks.xhtml/field.effectiveDate']}" />