views:

241

answers:

1

I have a customer who created an Oracle ADF/JSF 1.1 application. On one of the pages they have a table with first column as an enabled mutually exclusive radio buttons. I had to enhance the page and add the total line with disabled radio button. How can I disable it in Bean class or on the page without using JavaScript? I've tried to do something like:

<af:tableSelectOne id="slctone"  disabled="true"/>

but that disable all buttons. I've tried to put the code like the one below, but that disables the link to next page on the second column:

TcpiVO t= (TcpiVO) JSFUtils.getManagedBeanValue("row");
if(t.getLabel().contains("TOTALS")){
    return false;
}

Here's the code snippet:

    <f:facet name="selection">
      <af:tableSelectOne id="slctone"  />
    </f:facet>

    <af:column sortable="false" headerText="#{tcWizard.partsHeaderLabel}"  width="325"  >

      <af:commandLink text="#{row.label}" action="#{tcWizard.retrieveDrillDownList}" actionListener="#{tcWizard.nextDrillDownElement}"
                      rendered="#{tcWizard.continueDrill }" id="drlLnk" />
      <af:outputText value="#{row.label}" rendered="#{!tcWizard.continueDrill }" />

    </af:column>
    <af:column sortable="false" headerText="#{msg.SALES}" styleClass="bordersBottomGrey"  width="80">
      <af:outputText value="#{row.sales}"/>
    </af:column>
+1  A: 

I had to enhance the page and add the total line with disabled radio button. How can I disable it in Bean class or on the page without using JavaScript?

Just make use of EL in the disabled attribute:

disabled="#{we are in the last row}"

This should return true when the mentioned condition is met.

Alternatively you can make use of a footer inside the table component:

<f:facet name="footer">
    ...
</f:facet>

This will generate a <tfoot> wherein you can place an independent row which would thus not be affected by other rows nor vice versa.

BalusC
You are my hero!!! Thank you very much.
Roman Kagan
You're welcome.
BalusC