2 Replies Latest reply on Jul 1, 2011 6:03 AM by Julia López

    UIInputContainer id and label

    Julia López Newbie


      I've created a custom component using the UIInputContainer (copy/paste the example) and I've seen some weird behaviour.
      The thing is that if I specify and id and a label attributes in my component, the label is ignored and the id is used. I've checked the code and the next part seems okey.

      if (!getAttributes().containsKey(getLabelAttributeName())) {
          getAttributes().put(getLabelAttributeName(), generateLabel(elements, context));

      Doing a further debug I saw that the if condition is always true, so the containsKey is always false even so you put the label attribute. The weird thing is that if you do the next call


      you get the label value!! but the containsKey returns false!! How is this even possible?!?! XD

      I'm using Mojarra and I suppose the problem is theirs. Maybe the if condition should be

      getAttributes().containsKey(getLabelAttributeName()) == null

      to make it work as expected