should be ab easy one. I have 3 checkboxes and have a multitude of conditional statements that should execute based on which checkboxes are entered. In this case I have all 3 “checked”….so none of these statment should run. It’s looks like I formatted them wrong. Let me know what I did wrong…thanx
logger:
// form.isOpenLevel() = true
// form.isPhyCompLevel() = true
// form.isFinCompLevel() = true
These three statements should only execute if 2 out of the 3 are true. At least thats what I was trying to do.
if ((form.isOpenLevel() == true && form.isPhyCompLevel() == true) && (form.isFinCompLevel() != true));
{
paramBean.addFilter(new DetFilterCriteriaBean("MSST_HEADER_DATA_MV.FIN_COMP_DATE","is","NULL"));
}
if ((form.isPhyCompLevel() == true && form.isFinCompLevel() == true) && (form.isOpenLevel() != true));
{
paramBean.addFilter(new DetFilterCriteriaBean("MSST_HEADER_DATA_MV.PHYS_COMP_DATE","is","NOT NULL"));
}
if ((form.isOpenLevel() == true && form.isFinCompLevel() == true) && (form.isPhyCompLevel() != true));
{
paramBean.addFilter(new DetFilterCriteriaBean("nvl2(MSST_HEADER_DATA_MV.PHYS_COMP_DATE,MSST_HEADER_DATA_MV.FIN_COMP_DATE,'X')","is","NOT NULL"));
}
First off, the extra paranthesis are redundant:
is equivalent to
Also – “These three statements should only execute if 2 out of the 3 are true” means
should be enough.
Finally, the semicolons after the
ifis ending the conditional:is equivalent to
That’s why your statements always execut.
Remove the
;after the conditions.