ADF selectOnechoice 如何在项目中显示标签 [英] ADF selectOnechoice how to display label in items

查看:55
本文介绍了ADF selectOnechoice 如何在项目中显示标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 ADF.我需要在鼠标悬停时为每个下拉值显示帮助文本.我挣扎了很多,但力图在模型层找到任何事情要做.最后,我最终玩起了字符串 EL 表达式.

I am working on ADF. I need to display help text on mouse hover for each value of drop down. I struggled al lot but dint find any thing to do in model layer. Finally I endded up playing with string EL expression.

<af:table value="#{bindings.LetterUIConfig1.collectionModel}" rendered="false"
        width="98%" styleClass="AFStretchWidth" var="row"
        rows="#{bindings.LetterUIConfig1.rangeSize}"
        emptyText="#{bindings.LetterUIConfig1.viewable ? 'No data to display.' : 'Access Denied.'}"
        fetchSize="#{bindings.LetterUIConfig1.rangeSize}"
        rowBandingInterval="0" id="t1" columnStretching="column:c1"
        inlineStyle="border-style:hidden;" horizontalGridVisible="false"
        verticalGridVisible="false">
<af:column sortProperty="#{bindings.LetterUIConfig1.hints.Name.name}"
           sortable="false" id="c1" noWrap="false" headerText="">
  <af:panelFormLayout id="pfl1" labelWidth="40%" fieldWidth="60%"
                      maxColumns="1" labelAlignment="start">
    <af:panelLabelAndMessage label="#{row.Name}" id="plam1"
                             styleClass="alignLeft"
                             labelStyle="text-align: left;">
      <af:panelGroupLayout id="pgl1">

        <af:selectOneChoice value="#{row.bindings.Name.inputValue}"
                            label="#{row.bindings.Name.label}"
                            required="#{bindings.LetterUIConfig1.hints.Name.mandatory}"
                            shortDesc="#{bindings.LetterUIConfig1.hints.Name.tooltip}"
                            id="soc1">
            <af:forEach items="#{bindings.LetterAttributeLOV.rangeSet}" var="list">
                <af:selectItem id="si1" value="#{list.AttVal}"/>
          </af:forEach>
        </af:selectOneChoice>
        <af:selectBooleanCheckbox value="#{row.bindings.Name.inputValue}"
                                rendered="#{row.Type eq 'SBC'}"
                                label="#{row.bindings.Name.label}"
                                shortDesc="#{bindings.LetterUIConfig1.hints.Name.tooltip}"
                                id="sbc1"/>
      <af:selectManyCheckbox label="#{row.Name}" id="smc1"
                             rendered="#{row.Type eq 'SMC'}">
        <f:selectItems value="#{row.bindings.Name.items}" id="si2"/>
      </af:selectManyCheckbox>
      </af:panelGroupLayout>
    </af:panelLabelAndMessage>
  </af:panelFormLayout>
  <af:spacer id="s1" height="10"/>
</af:column>

我的问题是选择项不显示子字符串,它只显示值.我确实使用了 valuePassThrough 但没有运气.

My problem is select item is not displaying substring it is displaying only value. I did use valuePassThrough but no luck.

推荐答案

尝试一个define方法初始化为itemList;

Try a define method for initialize to itemList;

public List getSelectItemList(){
    ArrayList list = new ArrayList();
    Iterator<Object> iterator = resolveExpression("#{bind here your LOV}");
        while (iterator.hasNext()) {
          Object obj= iterator.next();
          list.add(new SelectItem(enterObjValue, enterObjValueLabel));
        }
        return list;
      }  

 public Object resolveExpression(String expression) {
            FacesContext fc = getFacesContext();
            ELContext elCtx = fc.getELContext();
            return fc.getApplication().getExpressionFactory().createValueExpression(elCtx, expression, Object.class).getValue(elCtx);
          }

并将此列表绑定到 Select one choice 组件.

and bind this list to Select one choice component.

 <af:selectOneChoice value="#{row.bindings.Name.inputValue}"
                        label="#{row.bindings.Name.label}"
                        required="#{bindings.LetterUIConfig1.hints.Name.mandatory}"
                        shortDesc="#{bindings.LetterUIConfig1.hints.Name.tooltip}"
                        id="soc1">
      <f:selectItems value="#{yourBean.selectItemList}"
                           id="sadsadsa"/>
    </af:selectOneChoice>

这篇关于ADF selectOnechoice 如何在项目中显示标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆