BAEL-1303 Intro to Primefaces (#3874)
* ivan.ljubicic.app.developer@gmail.com * Added unit tests, configuration class and minor adjustments * primefaces intro module added * deleted primefaces old module * deleted different bean injection types sample project * deleted addition different bean injection types file * Renaming archetype in web.xml * Added primefaces in jsf module * Primefaces improvements * Added commandButton and dialog * Added PFM * Code formatting * Update pom.xml * Formatting changes
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
package com.baeldung.springintegration.controllers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.el.ELContextEvent;
|
||||
import javax.el.ELContextListener;
|
||||
import javax.faces.bean.ManagedBean;
|
||||
import javax.faces.bean.ViewScoped;
|
||||
|
||||
@ManagedBean(name = "helloPFBean")
|
||||
@ViewScoped
|
||||
public class HelloPFBean {
|
||||
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
|
||||
private String componentSuite;
|
||||
|
||||
private List<Technology> technologies;
|
||||
|
||||
private String inputText;
|
||||
private String outputText;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
firstName = "Hello";
|
||||
lastName = "Primefaces";
|
||||
|
||||
technologies = new ArrayList<Technology>();
|
||||
|
||||
Technology technology1 = new Technology();
|
||||
technology1.setCurrentVersion("10");
|
||||
technology1.setName("Java");
|
||||
|
||||
technologies.add(technology1);
|
||||
|
||||
Technology technology2 = new Technology();
|
||||
technology2.setCurrentVersion("5.0");
|
||||
technology2.setName("Spring");
|
||||
|
||||
technologies.add(technology2);
|
||||
}
|
||||
|
||||
public void onBlurEvent() {
|
||||
outputText = inputText.toUpperCase();
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getComponentSuite() {
|
||||
return componentSuite;
|
||||
}
|
||||
|
||||
public void setComponentSuite(String componentSuite) {
|
||||
this.componentSuite = componentSuite;
|
||||
}
|
||||
|
||||
public List<Technology> getTechnologies() {
|
||||
return technologies;
|
||||
}
|
||||
|
||||
public void setTechnologies(List<Technology> technologies) {
|
||||
this.technologies = technologies;
|
||||
}
|
||||
|
||||
public String getInputText() {
|
||||
return inputText;
|
||||
}
|
||||
|
||||
public void setInputText(String inputText) {
|
||||
this.inputText = inputText;
|
||||
}
|
||||
|
||||
public String getOutputText() {
|
||||
return outputText;
|
||||
}
|
||||
|
||||
public void setOutputText(String outputText) {
|
||||
this.outputText = outputText;
|
||||
}
|
||||
|
||||
public class Technology {
|
||||
private String name;
|
||||
private String currentVersion;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCurrentVersion() {
|
||||
return currentVersion;
|
||||
}
|
||||
|
||||
public void setCurrentVersion(String currentVersion) {
|
||||
this.currentVersion = currentVersion;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.baeldung.springintegration.controllers;
|
||||
|
||||
import javax.faces.bean.ManagedBean;
|
||||
import javax.faces.bean.SessionScoped;
|
||||
|
||||
@ManagedBean(name = "helloPFMBean")
|
||||
@SessionScoped
|
||||
public class HelloPFMBean {
|
||||
|
||||
private String magicWord;
|
||||
|
||||
public String getMagicWord() {
|
||||
return magicWord;
|
||||
}
|
||||
|
||||
public void setMagicWord(String magicWord) {
|
||||
this.magicWord = magicWord;
|
||||
}
|
||||
|
||||
public String go() {
|
||||
if (this.magicWord != null && this.magicWord.toUpperCase()
|
||||
.equals("BAELDUNG")) {
|
||||
return "pm:success";
|
||||
}
|
||||
return "pm:failure";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user