Note that there are some explanatory texts on larger screens.

plurals
  1. POFacelet Custom Component - prevent rendering ui:insert content in custom component
    primarykey
    data
    text
    <p>this is my custom component definition:</p> <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"&gt; &lt;c:if test="${empty required}"&gt; &lt;c:set var="required" value="false" /&gt; &lt;/c:if&gt; &lt;c:if test="${empty disabled}"&gt; &lt;c:set var="disabled" value="false" /&gt; &lt;/c:if&gt; &lt;c:if test="${not disabled}"&gt; &lt;div id="#{id}DIV"&gt; &lt;label for="#{id}" class="portlet-form-label"&gt;${label}&lt;/label&gt; &lt;ui:insert name="field" /&gt; &lt;c:if test="${required}"&gt;*&lt;/c:if&gt; &lt;strong class="portlet-msg-error" style="display: none;"&gt;&lt;h:message for="#{id}" /&gt;&lt;/strong&gt; &lt;/div&gt; &lt;/c:if&gt; &lt;/ui:composition&gt; </code></pre> <p>this is how I use it:</p> <pre><code>&lt;my:editLineInsert id="itSIN" label="#{label['label.stocks.income']}" tip="#{label['message.default.tooltip']}" disabled="#{engine.disabled['itSIN']}" required="#{engine.required['itSIN']}" &gt; &lt;ui:define name="field"&gt; &lt;h:inputText id="itSIN" value="#{order.income}" disabled="#{engine.disabled['itSIN']}" required="#{engine.required['itSIN']}" &gt; &lt;f:converter converterId="javax.faces.BigDecimal" /&gt; &lt;f:validator validatorId="V12DGS6DECS" /&gt; &lt;/h:inputText&gt; &lt;/ui:define&gt; &lt;/my:editLineInsert&gt; </code></pre> <p>I have trouble with <code>&lt;ui:insert name="field" /&gt;</code>. It renders ALWAYS. If disabled=true I got just <code>&lt;input type="text" disabled="disabled" value="" name="itSIN" id="itSIN"/&gt;</code> element at the top of view. NOTE: I use ui:insert to pass jsf component because I have no clue how to pass validators to an h:inputText inside custom component.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload