...or Different Secondary attrs cannot be selected for the same primary attr
Scenario
Let's say that we have a VO based on entity that has t least attrs:
- AttrPK1 which is PK
- AttrPK2 also a PK
- AtrrsDesc is a required description
The following scenarion breaks it:
- raise LOV
- select a different row that has the same AttrPK1 but differnetAttrPK2 and press ok
- then LOV does not return the AttrPK2 and Desc based on the different row cos AttrPK1 that the Lov is on did not change and it thinks that there no changes
Solution
In order to fix this we change AttrPK1 Lov
page
popupTitle="Lov title"
value="#{bindings.AttrPK1.inputValue}"
label="#{bindings.AttrPK1.hints.label}"
model="#{bindings.AttrPK1.listOfValuesModel}"
required="#{bindings.AttrPK1.hints.mandatory}"
shortDesc="#{bindings.AttrPK1.hints.tooltip}"
simple="true" autoSubmit="true"
launchPopupListener="#{backing.attrPK1_LaunchListener}">
backing
public void attrPK1_LaunchListener(LaunchPopupEvent launchPopupEvent) {
//Always trigger the value change event.
triggerValueChange(this.getAttrPK1());
}
/**
* Triggers a change in the specified control's value.
* The change is triggered even if there is not an actual change by the user.
* Useful in cases where we always want the component to call its value change listener.
*/
private void triggerValueChange(UIXValue cntrl) {
//trigger only when the control already has a value
if (cntrl.getValue() != null) {
//put a dummy value just to trigger value change
cntrl.setValue(" ");
}
}
No comments:
Post a Comment