Boa tarde, pessoal.
Estou trabalhando em uma pagina JSF, mas o html renderizado pelo h:outputText está quebrando meu layout:
<span>
<h:outputText value="Valor"/>
</span>
O codigo acima renderiza o seguinte:
<span>
</td>
</tr>
<tr>
<td>Valor</td>
</tr>
<tr>
<td>
</span>
Eu acho isso bizarro,e não faço ideia do porquê isso acontecer. Isso é um comportamento padrão da tag jsf?
Alguém sabe como fazer isso não acontecer?
Obrigado.
Coloca o resto do código o que tem circundando o span e o outputText.
Segue:
<div id="abas">
<h:panelGrid class="ui-widget ui-corner-all ui-widget-content widget" id="abasContent" title="abas" style="width: 100%; height: 100%">
<h:panelGrid id="abasFrameContent" style="width: 100%; height: 100%">
<div class="ui-widget-header ui-corner-all widgetheader">
<span class="widgettitle">
<h:outputText value="Teste"/>
</span>
</div>
<iframe id="iframeAbas" src="#{regulacaosinistroremb.urlPainelSuperior}" frameborder="1" style="width: 100%; height: 100%"/>
</h:panelGrid>
</h:panelGrid>
</div>
O panel grid não renderiza o html da form que você espera caso os filhos diretos dele sejam html puro e não componentes JSF.
Troca a div por um panelGroup com layout block. E coloca o iframe dentro de um panelGroup tambémVocê pode fazer assim:
<h:panelGrid class="ui-widget ui-corner-all ui-widget-content widget" id="abasContent" title="abas" style="width: 100%; height: 100%">
<h:panelGrid id="abasFrameContent" style="width: 100%; height: 100%">
<h:panelGroup layout="block" class="ui-widget-header ui-corner-all widgetheader">
<span class="widgettitle">
<h:outputText value="Teste"/>
</span>
</h:panelGroup>
<h:panelGroup>
<iframe id="iframeAbas" src="#{regulacaosinistroremb.urlPainelSuperior}" frameborder="1" style="width: 100%; height: 100%"/>
</h:panelGroup>
</h:panelGrid>
</h:panelGrid>
O panelGroup renderiza uma div caso você coloque layout=block.
Obrigado, ayslanms!
esse layout=“block” resolveu esse problema e muitos outros que apareceram depois. Aprendi mais uma.
Valeu mesmo!