0

I have wrote a Validator in JSf2 to validate two input fields but for this validation i want to know the selecteditem from the SelectOneMenu

I tried below code but its not working

    SelectOneMenu selectOneMenu = (SelectOneMenu) context.getViewRoot().findComponent("tabView:dialogWindow:valueType");
    selectOneMenu.get
    UIInput  submittedVal = (UIInput)selectOneMenu.getSubmittedValue();

But this is giving Null .

Can i have to go through the child of selectOneMenu or something else?

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • @BalusC I want to know how to access selecteditem from the SelectOneMenu .I know how to get component in Validator that i already done . – Subodh Joshi Nov 12 '15 at 09:40
  • 1
    I know. The duplicate answers how to get value of another component in a custom validator. Try reading answer from top to bottom. – BalusC Nov 12 '15 at 09:42
  • Ok Got you point `selectOneMenu.getValue();` because its already validated so this `selectOneMenu.getSubmittedValue();` is coming `NULL` – Subodh Joshi Nov 12 '15 at 09:51

0 Answers0