Datalist width problem

UI Components for JSF
Post Reply
fcoexposito
Posts: 8
Joined: 24 Feb 2012, 11:22

16 Jul 2014, 10:29

I have a datalist where I want to show a label and below that a selectOneButton. The problem is that if the label width is too long for the screen, it is not word wrapped.

Code: Select all

<p:dataList value="#{feedbackController.puntoControl.prototipo.preguntas}"
				  var="preg">					 			
		<p:outputLabel value="#{preg.pregunta}"></p:outputLabel>
					 			
		<p:panelGrid columns="1" style="width:100%; text-align:center;">
 			<p:selectOneButton id="selectOneButton" value="#{preg.resultado}">
			        <f:selectItems value="#{preg.respuestas}" var="resp" itemLabel="#{resp.texto}" itemValue="#{resp.valor}" />
                        </p:selectOneButton>
	         </p:panelGrid>						
</p:dataList>
I've tried to use a dive inside the label, but it doesn't work:

Code: Select all

<div style="width:100px important;word-wrap:break-word;">
	<p:outputLabel value="#{preg.pregunta}"></p:outputLabel>
</div>
Any help?

Thanks in advance
Primefaces 5.0

fcoexposito
Posts: 8
Joined: 24 Feb 2012, 11:22

16 Jul 2014, 11:08

I've found a way to do that, but I don't like it..... I use a table to show the label.

Code: Select all

<table>
  <tr>
    <td>
        <p:outputLabel value="#{preg.pregunta}""></p:outputLabel>
    </td>
  </tr>
</table>
Any other option with divs and css, if possible?

Thanks.
Primefaces 5.0

fcoexposito
Posts: 8
Joined: 24 Feb 2012, 11:22

16 Jul 2014, 13:07

I've solve using an h:panelGrid, which do the same but it looks better.

Code: Select all

<h:panelGrid columns="1">
    <p:outputLabel value="#{preg.pregunta}"></p:outputLabel>
</h:panelGrid>	
Primefaces 5.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 43 guests