I am using Oracle ADF12C, I have a table which has an strong textselect One Choice>(Customized Query) as a column, on change of the value I need to open a popup, I have tried using value Change Listener to fetch the ID but not able to find. Any Suggestions….
I have tried using the JavaScript to fetch the ID, still it did not work
<af:selectOneChoice value="#{row.bindings.ProfileId.inputValue}"
label="#{row.bindings.ProfileId.label}"
required="#{bindings.Assets1.hints.ProfileId.mandatory}"
shortDesc="#{bindings.Assets1.hints.ProfileId.tooltip}"
id="soc7"
binding="#{GenericListenerBean.assetprofileBV}">
<f:selectItems value="#{row.bindings.ProfileId.items}"
id="si8"/>
<f:validator binding="#{row.bindings.ProfileId.validator}"/>
<af:clientListener method="profileLovValue"
type="valueChange"/>
</af:selectOneChoice>
function profileLovValue() {
alert("function called");
var lov_value = document.getElementById('soc8');
alert("Executedd ======"+lov_value);
var strUser = lov_value.options[lov_value.selectedIndex].value;
alert("value ======"+strUser);
}
There is a couple issues in your code. you are doing a :
when your af:selectOneChoice Html DOM ID will be something like "p1::pc2::soc7".
If you want to get the real Html DOM ID of an element from your browser, you need to right-click it in your browser and click Inspect to check the real ID in your console.
Since you are using the oracle ADF framework, you should also avoid JavaScript and use Java with built-in java ADF fonction.
—If you want to get the value of this #{row.bindings.ProfileId.inputValue} use resolveExpression as describe here https://cedricleruth.com/how-to-retreive-the-value-of-an-iterator-binding-variable-programmatically-in-adf/
—If you want to get the ID of the element that trigger an event :