如何禁用 JSFX 页面上的单个单选按钮?

发布于 2024-08-13 21:50:07 字数 1171 浏览 5 评论 0原文

我有一位客户创建了 Oracle ADF/JSF 1.1 应用程序。在其中一个页面上,他们有一个表格,其中第一列作为启用的互斥单选按钮。我必须增强页面并添加带有禁用单选按钮的总行。如何在不使用 JavaScript 的情况下在 Bean 类或页面上禁用它?我尝试做类似的事情:

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

但这会禁用所有按钮。 我尝试将代码如下所示,但这会禁用第二列上下一页的链接:

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

这是代码片段:

    <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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

念﹏祤嫣 2024-08-20 21:50:07

我必须增强页面并添加禁用单选按钮的总行。如何在不使用 JavaScript 的情况下在 Bean 类或页面上禁用它?

只需在 disabled 属性中使用 EL:

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

当满足上述条件。

或者,您可以在表格组件内使用页脚:

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

这将生成一个,您可以在其中放置一个独立的行,因此不会受到其他行的影响,反之亦然。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文