0

I basically have this composite:

<cc:interface>
        <cc:attribute name="value" />
        <cc:attribute name="itemLabel" type="java.lang.String"/>
        <cc:attribute name="itemValue" />
        <cc:attribute name="completeMethod" method-signature="java.util.List oncomplete(java.lang.String))"/>
    </cc:interface>

<cc:implementation>
        <p:autoComplete
            value="#{cc.attrs.value}"
            completeMethod="#{cc.attrs.completeMethod}"
            var="#{cc.attrs.var}"
            itemLabel="#{cc.attrs.itemLabel}" 
            itemValue="#{cc.attrs.itemValue}"
            pt:readonly="#{empty cc.getValueExpression('completeMethod')}" />
</cc:implementation>

I want to make sure that autocomplete is readonly when completeMethod is not defined. Doing this, it always returns true. I guess it is a problem about build/render time. I quote:

"Passthrough elements" is a JSF 2.2 specific term for declaring JSF components as "plain" HTML5 elements which should be automatically converted to real JSF components during view build time, when an "identifying attribute" is present in the plain HTML5 markup.

Is there a way to work this around?

Rapster
  • 484
  • 1
  • 5
  • 23
  • Why must it be a passthrough attribute? The `` has its own `readonly` attribute already. Note that passthrough elements != passthrough attributes. – BalusC May 17 '16 at 20:00
  • So embarrassing, I didn't see that! Thanks BalusC – Rapster May 17 '16 at 23:01
  • My bad, it's not working actually... The property `disabled` does exist but it still not working. I tried with the same condition as above and by doing `#{empty cc.attrs.completeMethod}` – Rapster May 18 '16 at 06:57
  • What exactly is "not working"? – BalusC May 18 '16 at 07:06

0 Answers0