新增add project按钮
This commit is contained in:
parent
7e25024e3e
commit
1eedecba02
@ -106,6 +106,11 @@ public class ProjectBean implements Serializable {
|
||||
this.selectedKeywords = new ArrayList<>(project.getKeywords());
|
||||
}
|
||||
|
||||
public void addProject() {
|
||||
project = new Project("", "", "", new ArrayList<>(), "", new ArrayList<>(), "", "");
|
||||
projects.add(project);
|
||||
}
|
||||
|
||||
public String loadProject(String title) {
|
||||
project = projects.stream().filter(p -> p.getTitle().equals(title)).findFirst().orElse(null);
|
||||
return "project.xhtml?faces-redirect=true";
|
||||
|
||||
@ -22,6 +22,12 @@
|
||||
<f:ajax render="project-form form"/>
|
||||
</h:commandButton>
|
||||
</ui:repeat>
|
||||
<div class="form-group">
|
||||
<h:commandButton value="Add Project" action="#{projectBean.addProject}"
|
||||
styleClass="project-button">
|
||||
<f:ajax render="project-form form"/>
|
||||
</h:commandButton>
|
||||
</div>
|
||||
</section>
|
||||
</h:form>
|
||||
<h:form id="project-form" styleClass="project-form">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user