function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
zhufengjackzhufengjack 

taborderhint is not supported for <apex:inputField> when this component is child of <apex:dataTable>

Hi ,

I am learning how to use visualforce. And I copy an example of visualforce developer guide.  And when I save to salesforce server from ecilpse, I meet this error message"Attribute taborderhint is not supported for <apex:inputField> when this component is a direct or indirect child of <apex:dataTable>". codes as below:

<apex:page controller="OppsController">
<apex:form>
<apex:dataTable value="{!OpportunitiesWithIndex}" var="oppWrapped">
<apex:column>
<apex:facet name="header">Opportunity</apex:facet>
<apex:outputField value="{!oppWrapped.opp.name}"/>
</apex:column>
<apex:column>
<apex:facet name="header">Amount</apex:facet>
<apex:inputField value="{!oppWrapped.opp.amount}"
taborderhint="{!oppWrapped.tabIndex}"/>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:page>

 

 

apex:

public class OppsController {
// Get a set of Opportunities
public ApexPages.StandardSetController setCon {
get {
if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
[SELECT name, type, amount, closedate FROM Opportunity]));
setCon.setPageSize(5);
}
return setCon;
}
set;
}
public List<Opportunity> getOpportunities() {
return (List<Opportunity>) setCon.getRecords();
}
public List<OppWrapper> getOpportunitiesWithIndex() {
List<Opportunity> opps = this.getOpportunities();
List<OppWrapper> oppsWrapped = new List<OppWrapper>();
Integer idex = 1;
for (Opportunity opp : opps) {
oppsWrapped.add(new OppWrapper(opp, idex));
idex++;
}
return oppsWrapped;
}

 

 

 

craigmhcraigmh

Interesting, I wonder what is enforcing that rule.

 

Have you tried saving it in the Salesforce IDE?

praveen reddypraveen reddy
I am also facing similar issue
Alka BajajAlka Bajaj
I had to use inputText instead of inputField for using tabIndex because tabOrderHint was not working neither in dataTable tag nor in pageBlockTable tag...
Allan CabreraAllan Cabrera
Alka Bajaj's answer worked for me
Mona Das 7Mona Das 7

Use html-tabIndex as attribute in pageBlockTable. Here is the code


<apex:page StandardController="Opportunity" recordSetVar="OpportunitiesWithIndex">
    <apex:form >
        <apex:pageBlock >
            <apex:variable value="{!0}" var="rowNum"/>
            <apex:pageBlockTable value="{!OpportunitiesWithIndex}" var="oppWrapped" rows="5">                
                      <apex:column >
                        <apex:variable var="rowNum" value="{!rowNum+1}"/> 
                    </apex:column>
                
                <apex:column >
                    <apex:facet name="header">Amount</apex:facet> 
                    <apex:inputField value="{!oppWrapped.name}" html-tabIndex="{!rowNum}"/> 
                    --{!rowNum}--  
                </apex:column> 
            </apex:pageBlockTable>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>
 

 

Karthik PKarthik P
Thanks Mona! That worked for me.