0

Can any one tell me how I can get the immediate attribute value from Java code ? I tried to the attribute in both the ways as below: My project is in jsf 1.2

        <h:inputText value="" immediate="true">
            <f:attribute name="immediate" value="true"/>
            <f:attribute name="testAttribute" value="true"/>
        </h:inputText>

I can see the 'testAttribute' in attributes Map but not the 'immediate' attribute.

          if (UIComponentBase.getAttributes().containsKey("immediate")) {
              this.immediate = (Boolean)comp.getAttributes().get("immediate");
          }

The getAttributes() return an attributes map which does not have 'immediate' as an entry. Please suggest another way to read the value of an immediate attribute.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I think changing the attribute name `immediate` to another name should solve the problem, because it's reserved key word. – Omar Jun 04 '14 at 08:09
  • Yeah. other attributes are retrieved fine. But I want to know if the component has immediate or not. I'm checking as below: – user3705909 Jun 04 '14 at 09:19
  • if (component instanceof EditableValueHolder) { EditableValueHolder holder = (EditableValueHolder) target; this.immediate = holder.isImmediate(); } else if (component instanceof ActionSource) { ActionSource action = (ActionSource) target; this.immediate = action.isImmediate(); } – user3705909 Jun 04 '14 at 09:25

0 Answers0