在更改父属性时清除从属属性值

时间:2019-03-01 13:06:09

标签: oracle-adf jdeveloper

我有一个父属性OrganizationId和attribute- ProjectId,它依赖于OrganizationId。因此,在清除/更新OrganizationId时应删除ProjectId。在当前方案中,在清除OrganizationId时,尽管现有的ProjectId值仍显示在页面上,但我们无法选择任何ProjectId。

<af:inputComboboxListOfValues id="OrganizationCode"
    popupTitle="#{ResourcesGenBundle['Header.SearchandSelect.Searchandselectanobjectusingad']}: #{bindings.OrganizationCode.hints.label}"
    value="#{bindings.OrganizationCode.inputValue}"
    label="#{bindings.OrganizationCode.hints.label}"
    model="#{bindings.OrganizationCode.listOfValuesModel}"
    required="#{bindings.OrganizationCode.hints.mandatory}"
    columns="#{bindings.OrganizationCode.hints.displayWidth}"
    shortDesc="#{bindings.OrganizationCode.hints.tooltip}"
    searchDesc="#{bindings.OrganizationCode.hints.tooltip}"
    autoSubmit="true"
    partialTriggers="DeliveryName"
    valueChangeListener="#{CreatePickWaveBean.onOrganizationCodeChange}"
    binding="#{CreatePickWaveBean.organizationCode}">

<af:inputListOfValues id="projCostingProjectNumberId"
    popupTitle="#{ResourcesGenBundle['Header.SearchandSelect.Searchandselectanobjectusingad']}: #{bindings.ProjCostingProjectNumber.hints.label}"
    value="#{bindings.ProjCostingProjectNumber.inputValue}"
    label="#{wshpickreleaseuiBundle['ColAttr.ProjectCostingProjectNumber.ProjectPVO.ProjectCostingProjectNumber']}"
    model="#{bindings.ProjCostingProjectNumber.listOfValuesModel}"
    required="#{bindings.ProjCostingProjectNumber.hints.mandatory}"
    columns="#{bindings.ProjCostingProjectNumber.hints.displayWidth}"
    shortDesc="#{bindings.ProjCostingProjectNumber.hints.tooltip}"
    autoSubmit="true"
    binding="#{CreatePickWaveBean.pjcProjectNumber}"
    valueChangeListener="#{CreatePickWaveBean.onPjcNumberChange}">


public void onOrganizationCodeChange(ValueChangeEvent valueChangeEvent) {
    updateEVH(getOrganizationCode());

    private void updateEVH(EditableValueHolder evh) {
    if (evh != null)
        evh.setSubmittedValue(null);
}

1 个答案:

答案 0 :(得分:0)

尝试重置值或将inputListOfValues OrganizationId更改为

您已经将projectId组件的绑定设置为 “#{CreatePickWaveBean.pjcProjectNumber}” 因此,您可以在ProjectId的“值更改侦听器”方法中使用以下代码

this.getPjcProjectNumber().setValue(null);

this.getPjcProjectNumber().resetValue();