I am working with PrimeFaces components and noticed that the default width of the growl component was not large enough to fit the filenames that I list in it. I increased the width of the growl component but the text does not seem to realign with the new width.
My CSS knowledge is extremely limited and have only tried playing with left-padding and text-align, both of which had no effect.
What attribute would I need to look at to go about adjusting this?
Here's a picture with the component and the generated html circled.
mystyle.css
.ui-clock, .ui-fileupload-buttonbar, .ui-fileupload-content, .ui-widget-content{
background-color: white;
border: white;
}
.ui-growl {
width: 600px;
left-padding: 0px;
}
main.xhtml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<meta http-equiv="refresh"
content="#{session.maxInactiveInterval};url=index.xhtml" />
<f:view contentType="text/html">
<h:head>
<title>My Title</title>
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/aristo/mystyle.css"/>
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="center">
<ui:insert name="pagebody" />
</p:layoutUnit>
</p:layout>
</h:body>
</f:view>
</html>
index.xhtml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" template="/templates/main.xhtml">
<ui:define name="pagebody">
<h:body>
<h:form id="uploadform" enctype="multipart/form-data">
<center>
<p:fileUpload fileUploadListener="#{uploadBean.handleFileUpload}" mode="advanced"
allowTypes="/(\.|\/)(csv)$/" update="messages"/>
<p:growl id="messages" showDetail="true" />
</center>
</h:form>
</h:body>
</ui:define>
</ui:composition>
UploadBean.java
@RequestScoped
@ManagedBean(name = "uploadBean")
public class UploadBean implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private File file = null;
@PostConstruct
public void init() {
}
public void handleFileUpload(FileUploadEvent event){
FacesMessage message = new FacesMessage("Upload Failed", "my message");
FacesContext.getCurrentInstance().addMessage(null, message);
}
}