Good morning,
This is my code:
<p:dialog header="Directorio" widgetVar="dirDialog" modal="true" showEffect="explode" hideEffect="explode" resizable="false">
<p:outputPanel id="dirDetail" style="text-align:center; width: 150px; height: 150px;">
<a href="#{busquedaBean1.autor.directorio}" target="_blank" id="txtCopiar">#{busquedaBean1.autor.directorio}</a>
</p:outputPanel>
</p:dialog>
Image of the dialog:
I need the text not to go over the edge of the dialog, that is to say that the text, instead of going over, stays inside the dialog and if it goes over, it extends down to show the full text.
EXAMPLE:
NEW CODE
I did some research and found a possible solution,
Code:
<p:dialog header="Directorio" widgetVar="dirDialog" modal="true" showEffect="explode" hideEffect="explode" resizable="false">
<p:outputPanel id="dirDetail" style="text-align:center;">
<a href="#{busquedaBean1.autor.directorio}" target="_blank" id="txtCopiar">#{busquedaBean1.autor.directorio}</a>
</p:outputPanel>
</p:dialog>
the dialog as it is presented in the code is auto responsive therefore it will adjust depending on the number of characters.
but some computers have zoom in their browsers, so it looks very big and goes over the screen.
I was thinking if instead of auto-adjusting sideways, it would auto-adjust downwards.
If you just want to break long words, you could use
overflow-wrap: break-word
. Microsoft usedword-wrap
to do something similar before, but when the rest of the browsers incorporated it, they gave it a nameoverflow-wrap
( source ).With
overflow-wrap
you specify to the browser how it should break the lines. The main values:normal
(words are not broken, default value) orbreak-word
(if there is a long word, it will be broken and part will appear on one line and part on the next line).So the code would look like this:
The URL has text without spaces. I understand that this is the problem with the dialogue that you present in the first image. Add the word-break style to the <a> tag .
Have you tried setting resizable = true?