use of javax.faces.component.html.HtmlInputHidden in project TNTConcept by autentia.
the class ActivityBean method onSelectedProjectChanged.
/**
* Set the projectOrganization value when the combo value changes
*
* @param event
*/
public void onSelectedProjectChanged(ValueChangeEvent event) {
setSelectedProject((Project) event.getNewValue());
if (selectedProject != null) {
HtmlSelectBooleanCheckbox billHtml = (HtmlSelectBooleanCheckbox) FacesUtils.getComponent("activity").findComponent("tabActivity").findComponent("billable");
billHtml.setValue(selectedProject.getBillable());
setBillable(selectedProject.getBillable());
HtmlInputHidden hiddenHtml = (HtmlInputHidden) FacesUtils.getComponent("activity").findComponent("tabActivity").findComponent("defaultBillable");
hiddenHtml.setValue(selectedProject.getBillable());
setDefaultBillable(selectedProject.getBillable());
}
FacesUtils.renderResponse();
}
use of javax.faces.component.html.HtmlInputHidden in project TNTConcept by autentia.
the class ActivityBean method onSelectedOrganizationChanged.
/**
* Set the selectedOrganization value when the combo value changes
*
* @param event
*/
public void onSelectedOrganizationChanged(ValueChangeEvent event) {
setSelectedOrganization((Organization) event.getNewValue());
// Project
List<Project> projectsByOrganization = ProjectManager.getDefault().getOpenProjectsByOrganization(selectedOrganization);
if (projectsByOrganization != null && projectsByOrganization.size() != 0) {
this.selectedProject = (Project) projectsByOrganization.get(0);
FacesContext.getCurrentInstance().getViewRoot().getAttributes();
} else {
this.selectedProject = null;
}
HtmlSelectOneListbox projects = (HtmlSelectOneListbox) FacesUtils.getComponent("activity").findComponent("tabActivity").findComponent("projects");
projects.setValue(selectedProject);
if (selectedProject != null) {
HtmlSelectBooleanCheckbox billHtml = (HtmlSelectBooleanCheckbox) FacesUtils.getComponent("activity").findComponent("tabActivity").findComponent("billable");
billHtml.setValue(selectedProject.getBillable());
setBillable(selectedProject.getBillable());
HtmlInputHidden hiddenHtml = (HtmlInputHidden) FacesUtils.getComponent("activity").findComponent("tabActivity").findComponent("defaultBillable");
hiddenHtml.setValue(selectedProject.getBillable());
setDefaultBillable(selectedProject.getBillable());
}
FacesUtils.renderResponse();
}
Aggregations