Another example of a file into the bottom of a button and a function parameter for ActionListener would like to run.
for example;
Maintoolbar.xhtml
<p:commandButton id="warnButton" value="#{BtnWarn}" actionListener="#{action}" update="messages" rendered="#{render2}"/>
Index.xhtml:
<ui:include src="MainToolbar.xhtml">
<ui:param name="BtnWarn" value="Uyarı Mesajı"/>
<ui:param name="Alisten" value="#{mesajlar.addWarn}"/>
<ui:param name="render2" value="true"/>
</ui:include>
measajlar.java
@ManagedBean(name="mesajlar")
@SessionScoped
public class MessageController implements Serializable
{
public void addWarn(ActionEvent actionEvent)
{
FacesMessage message = new FacesMessage("Invalid password length");
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, message);
}
}
According to the data above, I wanted to do;
damn buttons in a page will only include these buttons in the page and there I wanted çalıştıracağım related functions. So if Maintoolbar.xhtml which page I want to run it, type its function within the Button.
a page of the function = aClass.save
function b = bClass.delete page.
parameters include which page is the same button, I wrote a while at the same time the delete button will save somewhere.
1 Answer