You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Helmut Swaczinna (JIRA)" <de...@myfaces.apache.org> on 2007/08/30 14:00:31 UTC

[jira] Reopened: (TOBAGO-465) how I can set the tabindex attribute

     [ https://issues.apache.org/jira/browse/TOBAGO-465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Helmut Swaczinna reopened TOBAGO-465:
-------------------------------------


The cast of the value binding in getTabIndex() should be Number:

java.lang.ClassCastException: java.lang.Long
        at org.apache.myfaces.tobago.component.UISelectBoolean.getTabIndex(UISelectBoolean.java:70)

Because when you have a numeric exprsssion in the value binding it is evaluated to Long by EL.
And as far as I know there's no cast in EL.

I need this for example in a foreach loop:

tabIndex="#{${status.index} * 5 + 1}"


This code should always work:

  public Integer getTabIndex() {
    if (tabIndex != null) {
      return tabIndex;
    }
    ValueBinding vb = getValueBinding(ATTR_TAB_INDEX);
    if (vb != null) {
      return Integer.valueOf(((Number) vb.getValue(getFacesContext())).intValue());
    } else {
      return null;
    }
  }





> how I can set the tabindex attribute
> ------------------------------------
>
>                 Key: TOBAGO-465
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-465
>             Project: MyFaces Tobago
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.0.11
>         Environment: All
>            Reporter: Helmut Swaczinna
>            Assignee: Udo Schnurpfeil
>            Priority: Minor
>             Fix For: 1.0.12
>
>         Attachments: tabindex-diff.zip, tabindex2-diff.zip
>
>
> [Posting from David Steinkopff at Mon, 23 Apr 2007]
> I have different gridlayouts into a other gridlayout. now it the
> displayed layout sequence different to the sequence in the source
> code.
> now I would like to set tabindex to correct this different, it this possible?
> [Answer]
> Added support for html tabindex attribute for all input component, button and links.  You can specify an int directly or you
> can use a value binding to an Integer property in a bean.
> Source code is attached.
> Example:
> <tc:page id="inputPage" width="300px" height="300px"
>     focusId="">
>     <tc:panel id="inputPanel">
>       <f:facet name="layout">
>         <tc:gridLayout margin="5"
>           rows="fixed;fixed;fixed;fixed;fixed;*;40px;fixed" columns="*;2*"/>
>       </f:facet>    
>       
>       <tc:in id="in" tabindex="1"/>
>       <tc:file id="file" tabindex="6"/>
>       
>       <tc:panel>
>         <f:facet name="layout">
>           <tc:gridLayout cellspacing="0" 
>             columns="1*;20px"/>
>         </f:facet>
>         <tc:date id="date" tabindex="2"/>
>         <tc:datePicker for="date" tabindex="2"/>
>       </tc:panel>
>       <tc:time id="time" tabindex="7"/>
>             
>       <tc:selectBooleanCheckbox id="selectBooleanCheckbox" tabindex="3"/>
>       <tc:selectManyCheckbox id="selectManyCheckbox" tabindex="8">
>         <tc:selectItem itemValue="uvw" itemLabel="uvw"/>
>       </tc:selectManyCheckbox>
>       
>       <tc:selectOneChoice id="selectOneChoice" tabindex="4">
>         <tc:selectItem itemValue="xyz" itemLabel="xyz"/>
>       </tc:selectOneChoice>
>       <tc:selectOneRadio id="selectOneRadio" tabindex="9">
>         <tc:selectItem itemValue="abc" itemLabel="abc"/>
>       </tc:selectOneRadio>
>       <tc:selectOneListbox id="selectOneListbox" tabindex="5">
>         <tc:selectItem itemValue="def" itemLabel="def"/>
>       </tc:selectOneListbox>
>       <tc:selectManyListbox id="selectManyListbox" tabindex="10">
>         <tc:selectItem itemValue="ghi" itemLabel="ghi"/>
>       </tc:selectManyListbox>
>       
>       <tc:cell spanX="2">
>         <tc:sheet id="table" 
>           columns="*;*" 
>           showHeader="true"
>           showRowRange="none"
>           showPageRange="none"
>           showDirectLinks="none"
>           first="0"
>           selectable="none"
>           var="row"
>           value="#{controller.list1}">
>           <tc:column label="Column 1">
>             <tc:in id="column1" tabindex="11"
>               value="#{row.column1}"/>
>           </tc:column>            
>           <tc:column label="Column 2">
>             <tc:link id="column2" tabindex="12"
>               label="#{row.column2}"/>
>           </tc:column>            
>         </tc:sheet>
>       </tc:cell>
>       <tc:cell spanX="2">
>         <tc:textarea id="textarea" tabindex="13"/>
>       </tc:cell>
>       <tc:button id="button" label="button" tabindex="14"/>
>       <tc:link id="link" label="link" tabindex="15"/>
>       
>     </tc:panel>    
>   </tc:page>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.