You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Bernd Bohmann <be...@googlemail.com> on 2017/04/19 18:11:07 UTC

Pass-through Attributes support for Trinidad

Hello,

with my latest commits on trinidad trunk pass-through Attributes should
work.

But there are some open questions.

Inside some Renderer there are several calls to responseWriter.startElement
with a component instance.

For example inputText will result following Html rendering:


<tr:inputText label="Username:" simple="true">
    <f:passThroughAttribute name="placeholder" value="Enter username"/>
</tr:inputText>

<span placeholder="[Enter username]" class="af_inputText">
  <input placeholder="[Enter username]" id="id" name="id"
class="af_inputText_content" size="30" type="text">
  <label placeholder="[Enter username]" for="id"
class="p_OraHiddenLabel">Username:</label>
</span>

I could reduce the usage of responseWriter.startElement with a component
instance. But then it will be only rendered inside the span element and not
inside the input element.

Now I'm asking for feedback, suggestions.... and of cause bug reports

Thanks

Bernd

Re: Pass-through Attributes support for Trinidad

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

I think it is safe to only pass the component in
responseWriter.startElement when it is really wanted, and pass null in
other cases. Trinidad overrides the default (and updated)
HtmlResponseWriter, so it is necessary to update the ResponseWriter there
with the new JSF 2.2 logic. There is no other logic involved in that part,
in fact before JSF 2.2, the component was passed but it was just ignored.

In the example I would say the html <input> is the relevant one (the
<label> and the <span> is renderkit decoration).

regards,

Leonardo Uribe



2017-04-19 13:11 GMT-05:00 Bernd Bohmann <be...@googlemail.com>:

> Hello,
>
> with my latest commits on trinidad trunk pass-through Attributes should
> work.
>
> But there are some open questions.
>
> Inside some Renderer there are several calls to
> responseWriter.startElement with a component instance.
>
> For example inputText will result following Html rendering:
>
>
> <tr:inputText label="Username:" simple="true">
>     <f:passThroughAttribute name="placeholder" value="Enter username"/>
> </tr:inputText>
>
> <span placeholder="[Enter username]" class="af_inputText">
>   <input placeholder="[Enter username]" id="id" name="id"
> class="af_inputText_content" size="30" type="text">
>   <label placeholder="[Enter username]" for="id" class="p_OraHiddenLabel">
> Username:</label>
> </span>
>
> I could reduce the usage of responseWriter.startElement with a component
> instance. But then it will be only rendered inside the span element and not
> inside the input element.
>
> Now I'm asking for feedback, suggestions.... and of cause bug reports
>
> Thanks
>
> Bernd
>