Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF 2 Composite Component rendering problem
    primarykey
    data
    text
    <p>My composite component (cc) creates an inputText-Field. The important part is, that it is rendered depending on the models property "visible". The model is given to the component via parm "name".</p> <pre><code>&lt;cc:interface&gt; &lt;cc:attribute name="name" required="true"/&gt; &lt;/cc:interface&gt; &lt;cc:implementation componentType="ch.sbi.pt.components.PMSInputText"&gt; &lt;h:inputText value="#{cc.attrs.name.value}" rendered="#{cc.attrs.name.visible}"/&gt; &lt;/cc:implementation&gt; </code></pre> <p>In the view i have a panelGrid with 2 cells/row: the first row has a label and my cc, the second is not important. The label renders itself with the same model-property as my cc does.</p> <pre><code>&lt;h:panelGrid columns="2"&gt; &lt;h:outputText value="Name" rendered="#{person.name.visible}"/&gt; &lt;sbic:pmsInputText name="#{person.name}"/&gt; &lt;h:outputText value="Next Label"/&gt; &lt;sbic:pmsInputText name="#{something.name}"/&gt; &lt;/h:panelGrid&gt; </code></pre> <p>The result (and problem) is the following, if "visible"-property returns "false": None of the components are rendered (perfect!) BUT the cc resulting HTML leaves an empty cell (e.g. <code>&lt;td&gt;&lt;/td&gt;</code>) which results in a ugly layouted HTML-Table (offset one cell):</p> <pre><code>&lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;Next Label&lt;/td&gt; &lt;/tr&gt; .... </code></pre> <p>As far as I understand this has to do with the lifecycle (jstl vs. jsf): my cc renders before the <code>&lt;h:outputText../&gt;</code> but how can i get rid of the empty cell (e.g. <code>&lt;td&gt;&lt;/td&gt;</code>)? Am i missing something here?</p> <p>Thanx for your help, experts! Marc </p>
    singulars
    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.
 

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