Skip to content
Snippets Groups Projects
Commit 6f357a0f authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Made sure that rows are selected correctly in the project overview.

parent 8dceb4d1
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,8 @@ import javax.faces.context.FacesContext; ...@@ -31,6 +31,8 @@ import javax.faces.context.FacesContext;
import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.beans.application.ProjectsBean;
import org.primefaces.event.SelectEvent;
/** /**
* This bean is used in the context of the project overview page. * This bean is used in the context of the project overview page.
* *
...@@ -76,6 +78,16 @@ public class CurrentProjectOverviewBean { ...@@ -76,6 +78,16 @@ public class CurrentProjectOverviewBean {
this.projectName = projectName; this.projectName = projectName;
} }
/**
* This is the event listener used to select a row instantaneously.
*
* @param event
* The select event.
*/
public void onRowSelect(final SelectEvent event) {
this.setProjectName((String) event.getObject());
}
/** /**
* This method should only be called automatically by the JVM to update the projects list. * This method should only be called automatically by the JVM to update the projects list.
*/ */
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
<p:layoutUnit position="center"> <p:layoutUnit position="center">
<h:form id="projectsListForm"> <h:form id="projectsListForm">
<p:dataTable rows="15" paginator="true" paginatorPosition="both" var="project" rowsPerPageTemplate="5,10,15,25,50" value="#{currentProjectOverviewBean.projects}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" selection="#{currentProjectOverviewBean.projectName}" rowKey="#{project}" selectionMode="single"> <p:dataTable rows="15" paginator="true" paginatorPosition="both" var="project" rowsPerPageTemplate="5,10,15,25,50" value="#{currentProjectOverviewBean.projects}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" selection="#{currentProjectOverviewBean.projectName}" rowKey="#{project}" selectionMode="single">
<!-- Makes sure that rows are selected instantaneously. -->
<p:ajax event="rowSelect" listener="#{currentProjectOverviewBean.onRowSelect}" />
<p:column headerText="Project Name" id="modelHeader" sortBy="#{project}"> <p:column headerText="Project Name" id="modelHeader" sortBy="#{project}">
<p:commandLink id="dynaButton" value="#{project}"/> <p:commandLink id="dynaButton" value="#{project}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment