PrimeFaces page Redirecting when checkbox is clicked - java

I am trying to attach a simple checkbox to a datalist in primefaces. The checkbox is for the user to do multiple approvals for Purchase Orders. When I do not attach the checkbox, I click on the datalist and it goes to next page successfully. But when I do attach the checkbox, it is not successful. Any help would be greatly appreciated. Thank you!
Front End Xhtml:
<p:dataList id="poList" value="#{purchaseOrder.purchaseOrders}"
var="po" type="inset">
<f:attribute name="filter" value="true" />
<f:attribute name="placeholder" value="Search" />
<f:attribute name="autoDividers" value="true" />
<f:attribute name="icon" value="grid" />
<f:attribute name="iconSplit" value="true" />
<h:outputLabel for="name" value="Standard Label:" />
<p:column>
<p:commandLink id="poItem" action="pm:poDetails?transition=slide"
update=":poDetailsForm:content" styleClass="selection">
<f:setPropertyActionListener value="#{po}"
target="#{purchaseOrder.po}" />
#{po.poNumber}9 for #{po.vendorName} at <br />
<font color='red'>#{po.moneyValue}</font>
<p:column>
<p:selectBooleanCheckbox id="ApprovePOcb" value=""
itemLabel="Approve" />
</p:column>
</p:commandLink>
</p:column>
<f:facet name="footer">
<strong>#{fn:length(purchaseOrder.purchaseOrders)} PO(s)</strong>
</f:facet>
</p:dataList>
PurchaseOrderMBean:
public class PurchaseOrderMBean implements Serializable
{
List<PurchaseOrder> purchaseOrderList;
PurchaseOrder selectedPo;
public PurchaseOrderMBean()
{
purchaseOrderList = new ArrayList<PurchaseOrder>();
purchaseOrderList.add(
new PurchaseOrder(232324, "ABC", "USD" , 500000.00, "LargeCap"));
purchaseOrderList.add(
new PurchaseOrder(43342, "XYZ", "USD", 700000.00, "MediumCap"));
}
public List<PurchaseOrder> getPurchaseOrders()
{
List<PurchaseOrder> pendingPos = new ArrayList<PurchaseOrder>();
for (PurchaseOrder po : purchaseOrderList)
{
if ((po.getStatus().equals("PEN")))
{
pendingPos.add(po);
}
}
return pendingPos;
}
public void setPo(PurchaseOrder po)
{
selectedPo = po;
System.out.println("PO selected: " + po);
}
public PurchaseOrder getPo()
{
return selectedPo;
}
public void savePurchaseOrder()
{
System.out.println("savePurchaseOrder() called");
}
public void setUpdateStatus(String poid)
{
System.out.println("setUpdateStatus() called");
PurchaseOrder po=(PurchaseOrder)getPurchaseOrder(poid);
po.setStatus("APPROVE");
System.out.println("setUpdateStatus() updated");
}
public String getUpdateStatus()
{
return "";
}
public PurchaseOrder getPurchaseOrder(String poid)
{
PurchaseOrder po=null;
System.out.println("getPurchaseOrder() called");
for (int i=0;i<this.getPurchaseOrders().size();i++)
{
po=(PurchaseOrder)getPurchaseOrders().get(i);
if (po.getPoNumber()==Long.parseLong(poid))
break;
}
System.out
.println("getPurchaseOrder() po returned");
return po;
}
public String gotoDetails()
{
return "po_details?transition=slide";
}
}
I just get stuck when I add in the checkbox. Been trying for very long.

Add to call a bean and do a rederict,
like this:
<p:selectBooleanCheckbox id="ApprovePOcb" value="" itemLabel="Approve" />
<p:ajax event="change" listener="#{bean.checkboxChanged}"/>
</p:column>
and in the beans do:
public class bean implements Serializable {
//all variabile and methode
public void checkboxChanged() {
try {
FacesContext.getCurrentInstance()
.getExternalContext().redirect("./page.jsf");
}
catch (IOException e) {
//error
}
}
}

Related

Can't get submit button work

I am new to java and trying to learn how to add data into database.
I cannot make my submit button work. I am getting error of "target unreachable". I am using hibernate and phpMyAdmin.
As I said I new to this. Please let me know if I am missing information that needed.
Instead of calling class in my submit button should I create private String method for the text boxes?
I am confused.
Thanks a lot for your help.
additem.xhtml
<h:body>
<ui:composition template="template.xhtml">
<ui:define name="content">
<h1>Add a New Item</h1>
<br />
<h:form>
<p:panel id="panel" header="Enter an Item" style="margin-bottom:20px;">
<p:growl id="growl" showDetail="true" sticky="false" />
<h:outputLabel value="Item Number" />Item Number:
<p:inputText value="#{LibraryItem.itemNumber}" />
<br />
<h:outputLabel value="Title" />Title:
<p:inputText value="#{LibraryItem.title}" />
<br />
<h:outputLabel for="type" value="Type">Item Type:
<p:selectOneMenu value="#{libraryItem.type}" style="width:228px">
<f:selectItem itemValue="" itemLabel="Select One" />
<f:selectItem itemValue="book" itemLabel="Book" />
<f:selectItem itemValue="magazine" itemLabel="Magazine" />
<f:selectItem itemValue="movie" itemLabel="Movie" />
<f:selectItem itemValue="music" itemLabel="Music" />
</p:selectOneMenu>
</h:outputLabel>
<br />
<h:outputLabel value="Status" />Status:
<p:inputText value="#{LibraryItem.status}" />
<br />
<p:commandButton value="Submit" actionListener="#{AddLibraryItem.addItem}" update="growl" />
<br />
</p:panel>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
AddLibraryItem.java
#Named
#ManagedBean
#Scope("request")
public class AddLibraryItem {
//no arg constructor
public AddLibraryItem(){
}
#Inject private LibraryItem libraryItem;
#Inject private ILibraryService libraryService;
public String addItem(){
//return value
String returnValue = "success";
//assign values
libraryItem.setStatus("CHECKED_IN");
//add to library
try {
libraryService.add(libraryItem);
displayMessage("Success","Item added");
}catch (Exception e){
displayMessage("Error", e.toString());
return "fail";
}
return returnValue;
}
//Getters and Setters
public LibraryItem getLibraryItem() {
return libraryItem;
}
public void setLibraryItem(LibraryItem libraryItem) {
this.libraryItem = libraryItem;
}
public ILibraryService getLibraryService() {
return libraryService;
}
public void setLibraryService(ILibraryService libraryService) {
this.libraryService = libraryService;
}
//method to display messages
private void displayMessage(String title, String message){
//get faces context
FacesContext currentInstance = FacesContext.getCurrentInstance();
//message to show
FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, title, message);
//display the message
currentInstance.addMessage(null, fm);
}
}

set related values to null after selecting <f:selectItem>

below is my jsf code,
<h:outputText value="SP Id" styleClass="required"/>
<h:selectOneMenu style="padding-left:60px;" class="input" id="spid" required="true" requiredMessage="Select SP Id"
value="#{applicationController.spid}">
<p:ajax listener="#{applicationController.onFromChange()}"
update="fromnames" />
<f:selectItem itemValue="" itemLabel="--Select--" />
<f:selectItems value="#{applicationController.spids}"></f:selectItems>
</h:selectOneMenu>
<h:message for="spid" class="hmsg" />
<h:outputText value="Sp Name" class="left1"/>
<h:inputText class="input" id="fromnames"
value="#{applicationController.spname}" />
<h:message for="fromnames" />
backing bean code is(method),
public void onFromChange() {
if (spid != null && !spid.equals("")) {
int spId = Integer.parseInt(spid);
spname = baseService.getSalesPersonById(spId);
} else {
}
}
//setter-getters
public String getSpname() {
return spname;
}
public void setSpname(String spname) {
this.spname = spname;
}
public List<Integer> getSpids() {
return spids;
}
public void setSpids(List<Integer> spids) {
this.spids = spids;
}
from above code every thing works fine.
problem:if i select f:selectItems values, relating values(spname)
are displaying. after selecting f:selectItem spname should set to null but it's not setting to null, instead of that previous values are displayed.
change jsf code as below,
<h:selectOneMenu style="padding-left:60px;" class="input" id="spid" required="true" requiredMessage="Select SP Id"
value="#{applicationController.spid}">
<p:ajax listener="#{applicationController.onFromChange()}"
update="myForm1" event="change" process="#this"/>
<f:selectItem itemValue="0" itemLabel="--Select--" noSelectionOption="false" />
<f:selectItems value="#{applicationController.spids}"></f:selectItems>
</h:selectOneMenu>
<h:message for="spid" class="hmsg" />
and modify backing bean method as,
public void onFromChange() {
if (spid != null && !spid.equals("")) {
try{
int spId = Integer.parseInt(spid);
spname = baseService.getSalesPersonById(spId);
}
catch(Exception exception){
spname = null;
}
} else {
spname = null;
}
}

Setting Editable/NotEditable area with link in JSF?

Hello everyone i am new at JSF-Hibernate. I have a table in my database called "Personels" and I am getting records from there with a function and showing at "ListAllPersonels.xhtml" page. I have a link next to each surname and when click on it the row that clicked should turn to editable area. I have boolean variable for holding value of each records. Everthing is work except editable area link.When click on it, nothing changes. The value of "editable" doesnt turn to "true" from "false". So my codes are here, where is problem? Thanks....
My ManagedBean - PersonelMB;
#ManagedBean
#SessionScoped
public class PersonelMB implements Serializable{
/**
* Creates a new instance of PersonelMB
*/
public PersonelMB() {
}
private int personelid;
private String personelname,personelsurname;
public int getPersonelid() {
return personelid;
}
public void setPersonelid(int personelid) {
this.personelid = personelid;
}
public String getPersonelname() {
return personelname;
}
public void setPersonelname(String personelname) {
this.personelname = personelname;
}
public String getPersonelsurname() {
return personelsurname;
}
public void setPersonelsurname(String personelsurname) {
this.personelsurname = personelsurname;
}
private NewHibernateUtil hu;
private Session s;
private Personels personel;
private List<Personels> plist;
public List<Personels> getAllPersonelsFromDatabase(){
plist=new ArrayList<>();
s=hu.getSessionFactory().openSession();
s.beginTransaction();
Query qu=s.createQuery("from Personels");
plist=qu.list();
s.getTransaction().commit();
s.close();
return plist;
}
public String addRecord(){
Personels p=new Personels();
p.setPersonelName(personelname);
p.setPersonelSurname(personelsurname);
s=hu.getSessionFactory().openSession();
s.beginTransaction();
s.save(p);
s.getTransaction().commit();
s.close();
p=null;
personelname="";
personelsurname="";
return "success";
}
public String editRecord(Personels p){
p.setEditable(true);
return null;
}
public String saveAlteration(Personels pr){
for(Personels pers:mylist)
pers.setEditable(false);
s=hu.getSessionFactory().openSession();
s.beginTransaction();
s.update(pr);
s.getTransaction().commit();
s.close();
return null;
}
public String deleteRecord(Personels p){
s=hu.getSessionFactory().openSession();
s.beginTransaction();
s.delete(p);
s.getTransaction().commit();
s.close();
return "deleted";
}
}
My Java Class - Personels.java
public class Personels implements java.io.Serializable {
private Integer personelId;
private String personelName;
private String personelSurname;
public Personels() {
}
public Personels(String personelName, String personelSurname) {
this.personelName = personelName;
this.personelSurname = personelSurname;
}
public Integer getPersonelId() {
return this.personelId;
}
public void setPersonelId(Integer personelİd) {
this.personelId = personelİd;
}
public String getPersonelName() {
return this.personelName;
}
public void setPersonelName(String personelName) {
this.personelName = personelName;
}
public String getPersonelSurname() {
return this.personelSurname;
}
public void setPersonelSurname(String personelSurname) {
this.personelSurname = personelSurname;
}
boolean editable;
public boolean isEditable() {
return editable;
}
public void setEditable(boolean editable) {
this.editable = editable;
}
}
My index.xhtml
<h:form>
<h:panelGrid columns="2">
<f:facet name="Personel Register Form"/>
<h:outputLabel value="NAME: "/>
<h:inputText value="#{personelMB.personelname}"/>
<h:outputLabel value="SURNAME: "/>
<h:inputText value="#{personelMB.personelsurname}"/>
<h:commandButton value="Reset" type="reset"/>
<h:commandButton value="Save" type="submit" action="#{personelMB.addRecord()}"/>
</h:panelGrid>
<h:commandLink value="List All Personels" action="listallpersonels.xhtml"/>
</h:form>
My listallpersonels.xhtml;
<h:form>
<h:dataTable value="#{personelMB.getAllPersonelsFromDatabase()}" var="p" >
<h:column>
<f:facet name="header">NAME</f:facet>
<h:inputText value="#{p.personelName}" rendered="#{p.editable}" size="15"/>
<h:outputText value="#{p.personelName}" rendered="#{not p.editable}"/>
</h:column>
<h:column>
<f:facet name="header">SURNAME</f:facet>
<h:outputText value="#{p.personelSurname}" rendered="#{not p.editable}"/>
<h:inputText value="#{p.personelSurname}" rendered="#{p.editable}" size="15" />
</h:column>
<h:column>
<f:facet name="header">DELETE</f:facet>
<h:commandLink value="Delete" action="#{personelMB.deleteRecord(p)}"/>
</h:column>
<h:column>
<f:facet name="header">EDIT</f:facet>
<h:commandLink value="Edit" action="#{personelMB.editRecord(p)}"
rendered="#{not p.editable}"/>
<h:commandButton value="Save Alteration" action="#{personelMB.saveAlteration(p)}"
rendered="#{p.editable}" />
</h:column>
</h:dataTable>
</h:form>
You should take a look at primefaces, it had some features. And you should find some responses to your questions.
http://www.primefaces.org/showcase/ui/data/datatable/edit.xhtml
And then try something like this
<p:dataTable value="#{personelMB.getAllPersonelsFromDatabase()}" var="p" editable="true" editMode="cell" widgetVar="cellP">

SelectItemsConverter Omnifaces preselected object value?

I have a problem, well when I save my object to the DB it works fine, but when i want to retrieve it from the DB doesn't work, I'm using selectItemsConverter by Omnifaces
I have my Object "Modelo" which has two other objects inside, which are "Marca" and "Gama"
These are my Java entities (the toString() is for Omnifaces):
Modelo:
private Marca marca;
private Gama gama;
getters and setters...
#Override
public String toString() {
return String.format("%s[codigo=%d]", getClass().getSimpleName(), getCodigo());
}
Marca:
getters and setters...
#Override
public String toString() {
return String.format("%s[codigo=%d]", getClass().getSimpleName(), getCodigo());
}
Gama:
getters and setters...
#Override
public String toString() {
return String.format("%s[codigo=%d]", getClass().getSimpleName(), getCodigo());
}
Well and this is my managedBean
ModeloBean
#ManagedBean
#ViewScoped
public class ModeloBean {
private Modelo modelo = new Modelo();
getters and setters ...
//This is for call the DB to retrieve the value, and works fine, but i cant show the preselected value to the xhtml
public void leer(Modelo mo) throws Exception {
ModeloDAO dao = new ModeloDAO();
try {
this.init();
this.modelo = dao.leer(mo);
} catch (Exception e) {
throw e;
} finally {
dao = null;
}
}
This is my xhtml Page
I have a dialog which I used it for save and update an object
<p:dialog id="dlgDatos" widgetVar="wdlgDatos" modal="true" appendToBody="true" header="#{modeloBean.accion}" draggable="false" resizable="false">
<h:form>
<h:panelGrid columns="2">
<p:outputLabel value="Marca" />
<p:selectOneMenu value="#{modeloBean.modelo.marca}" converter="omnifaces.SelectItemsConverter" filter="true" filterMatchMode="startsWith" required="true">
<f:selectItem itemLabel="Seleccione" itemValue="#{null}" noSelectionOption="true" />
<f:selectItems value="#{marcaBean.lstMarcasVigentes}" var="marca" itemLabel="#{marca.nombre}" itemValue="#{marca}" />
</p:selectOneMenu>
<p:outputLabel value="Gama" />
<p:selectOneMenu value="#{modeloBean.modelo.gama}" converter="omnifaces.SelectItemsConverter" filter="true" filterMatchMode="startsWith" required="true">
<f:selectItem itemLabel="Seleccione" itemValue="#{null}" noSelectionOption="true" />
<f:selectItems value="#{gamaBean.lstGamasVigentes}" var="gama" itemLabel="#{gama.nombre}" itemValue="#{gama}" />
</p:selectOneMenu>
<p:outputLabel for="txtNombre" value="Modelo" />
<p:column>
<p:inputTextarea id="txtNombre" value="#{modeloBean.modelo.nombre}" />
<p:watermark for="txtNombre" value="Para registrar varios modelos, sepárelos por comas (,)" />
</p:column>
<p:outputLabel value="Vigencia" rendered="#{modeloBean.accion eq 'Modificar'}"/>
<p:selectBooleanCheckbox value="#{modeloBean.modelo.vigencia}" rendered="#{modeloBean.accion eq 'Modificar'}"/>
<p:commandButton value="#{modeloBean.accion}" actionListener="#{modeloBean.operar()}" oncomplete="PF('wdlgDatos').hide(); PF('wdtLista').clearFilters();" update=":frmLista:dtLista, :msj"/>
<p:commandButton value="Cancelar" immediate="true" onclick="PF('wdlgDatos').hide();"/>
</h:panelGrid>
</h:form>
</p:dialog>
The selectOneMenu works fine for save, but for update only retrieve me the Strings value and not the preselected value of my comboBoxes
This is the dialog which only retrieve the String value of "105" cause is a String and my boolean value for the checkbox "Vigencia" but not my comboBoxes values. Where am I wrong?
I solved it adding this to my entites (hashCode and equals)
#Override
public int hashCode() {
int hash = 5;
hash = 83 * hash + this.codigo;
return hash;
}
#Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Modelo other = (Modelo) obj;
if (this.codigo != other.codigo) {
return false;
}
return true;
}

How to get the selected row of a filtered extendedDataTable?

In my application (RichFaces 4.1) I have an extendedDataTable, in my backing bean I need to track the selected rows. I achieve this with the following code:
JSF:
<rich:extendedDataTable id="freie"
selectionMode="multipleKeyboardFree"
selection="#{myBean.tableSelection}"
...
<a4j:ajax execute="#this" event="selectionchange"
listener="#{myBean.tableSelection}"
render="indicatorPanel" />
Java:
UIExtendedDataTable dataTable= (UIExtendedDataTable) event.getComponent();
Object originalKey= dataTable.getRowKey();
_tableSelectedEntries.clear();
for (Object selectionKey: _tableSelection) {
dataTable.setRowKey(selectionKey);
if (dataTable.isRowAvailable()) {
_tableSelectedEntries.add((Entry) dataTable.getRowData());
}
}
dataTable.setRowKey(originalKey);
This works fine, as long as the table is not filtered. I use the standard RichFaces way to filter the table:
<rich:column sortBy="#{mitarbeiter.vorname}"
filterValue="#{mitarbeiterFilterBean.firstNameFilter}"
filterExpression="#{fn:containsIgnoreCase(mitarbeiter.vorname, mitarbeiterFilterBean.firstNameFilter)}">
When the table is filtered and I select for instance the first row, I get the rowKey for the first row of the unfiltered table in the backing bean. How can I get the rowData of the selected row when my table is filtered?
I think my code works the same way as in the showcase.
I could solve my problem by making my filter bean SessionScoped. I also don't bind the currently selected rows to my backing bean anymore. I get the selected rows using:
public void tableSelection (AjaxBehaviorEvent event) {
UIExtendedDataTable dataTable= (UIExtendedDataTable) event.getComponent();
for (Object selectionKey: dataTable.getSelection()) {
It could also be achieved using rowKeyVar to get the correct row index.
Maybe you have overlooked something because I tried it and it works.
I copied the source for selectableTable and added the filter method from filterTable
Example usage: To get the selected item/items data just use a get method for selected items list
Source code (xhtml):
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Richfaces Welcome Page</title>
</h:head>
<h:body>
<h:panelGrid columns="2">
<h:form>
<fieldset style="margin-bottom: 10px;">
<legend>
<h:outputText value="Selection Mode " />
</legend>
<h:selectOneRadio value="#{exTableSelect.selectionMode}">
<f:selectItem itemLabel="Single" itemValue="single" />
<f:selectItem itemLabel="Multiple" itemValue="multiple" />
<f:selectItem itemLabel="Multiple Keyboard-free" itemValue="multipleKeyboardFree" />
<a4j:ajax render="table, res" />
</h:selectOneRadio>
</fieldset>
<rich:extendedDataTable value="#{exTableSelect.inventoryItems}" var="car"
selection="#{exTableSelect.selection}" id="table" style="height:300px; width:500px;"
selectionMode="#{exTableSelect.selectionMode}">
<a4j:ajax execute="#form" event="selectionchange" listener="#{exTableSelect.selectionListener}"
render=":res" />
<f:facet name="header">
<h:outputText value="Cars marketplace" />
</f:facet>
<rich:column filterValue="#{exTableSelect.vendorFilter}"
filterExpression="#{fn:containsIgnoreCase(car.vendor, exTableSelect.vendorFilter)}">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Vendor " />
<h:inputText value="#{exTableSelect.vendorFilter}">
<a4j:ajax render="table" execute="#this" event="change" />
</h:inputText>
</h:panelGroup>
</f:facet>
<h:outputText value="#{car.vendor}" />
</rich:column>
</rich:extendedDataTable>
</h:form>
<a4j:outputPanel id="res">
<rich:panel header="Selected Rows:" rendered="#{not empty exTableSelect.selectionItems}">
<rich:list type="unordered" value="#{exTableSelect.selectionItems}" var="sel">
<h:outputText value="#{sel.vendor} - #{sel.model} - #{sel.price}" />
</rich:list>
</rich:panel>
</a4j:outputPanel>
</h:panelGrid>
</h:body>
</html>
Managed Bean:
public class ExTableSelect {
private String selectionMode = "multiple";
private Collection<Object> selection;
private List<InventoryItem> inventoryItems;
private List<InventoryItem> selectionItems = new ArrayList<InventoryItem>();
private String vendorFilter;
public void selectionListener(AjaxBehaviorEvent event) {
UIExtendedDataTable dataTable = (UIExtendedDataTable) event.getComponent();
Object originalKey = dataTable.getRowKey();
selectionItems.clear();
for (Object selectionKey : selection) {
dataTable.setRowKey(selectionKey);
if (dataTable.isRowAvailable()) {
selectionItems.add((InventoryItem) dataTable.getRowData());
}
}
dataTable.setRowKey(originalKey);
}
public Filter<?> getFilterVendor() {
return new Filter<InventoryItem>() {
public boolean accept(InventoryItem t) {
String vendor = getVendorFilter();
if (vendor == null || vendor.length() == 0 || vendor.equals(t.getVendor())) {
return true;
}
return false;
}
};
}
#PostConstruct
public void addInventory(){
InventoryItem i = new InventoryItem();
i.setVendor("A");
InventoryItem i2 = new InventoryItem();
i2.setVendor("AB");
InventoryItem i3 = new InventoryItem();
i3.setVendor("AC");
InventoryItem i4= new InventoryItem();
i4.setVendor("E");
InventoryItem i5 = new InventoryItem();
i5.setVendor("F");
InventoryItem i6 = new InventoryItem();
i6.setVendor("G");
InventoryItem i7 = new InventoryItem();
i7.setVendor("H");
InventoryItem i8 = new InventoryItem();
i8.setVendor("I");
InventoryItem i9 = new InventoryItem();
i9.setVendor("J");
inventoryItems= new ArrayList<InventoryItem>();
inventoryItems.add(i);
inventoryItems.add(i2);
inventoryItems.add(i3);
inventoryItems.add(i4);
inventoryItems.add(i5);
inventoryItems.add(i6);
inventoryItems.add(i7);
inventoryItems.add(i8);
inventoryItems.add(i9);
}
public Collection<Object> getSelection() {
return selection;
}
public void setSelection(Collection<Object> selection) {
this.selection = selection;
}
public List<InventoryItem> getInventoryItems() {
return inventoryItems;
}
public void setInventoryItems(List<InventoryItem> inventoryItems) {
this.inventoryItems = inventoryItems;
}
public InventoryItem getSelectionItem() {
if (selectionItems == null || selectionItems.isEmpty()) {
return null;
}
return selectionItems.get(0);
}
public List<InventoryItem> getSelectionItems() {
return selectionItems;
}
public void setSelectionItems(List<InventoryItem> selectionItems) {
this.selectionItems = selectionItems;
}
public String getSelectionMode() {
return selectionMode;
}
public void setSelectionMode(String selectionMode) {
this.selectionMode = selectionMode;
}
public void setVendorFilter(String vendorFilter) {
this.vendorFilter = vendorFilter;
}
public String getVendorFilter() {
return vendorFilter;
}
}

Categories

Resources