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

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;
}
}

Related

How to add h:inputText dynamically in jsf without losing previously dynamically added h:inputText value? [duplicate]

This question already has answers here:
How to dynamically add JSF components
(3 answers)
Closed 6 years ago.
I am trying to add h:inputText and a selectOneMenu dynamically in jsf2. And I got success in that. Now the new problem is that, when I clicked "Add New" button, previously dynamically added h:inputText value is erased. And I don't want that to happen. My code is below. Please help. :)
<h:form>
<h:dataTable id="bankAccountDataTable" value="#{kycBeanJSF.kycDataModelJSF.kycdto.bankAccountInfoDTOs}" var="item" binding="#{kycBeanJSF.htmlDataTable}">
<h:column>
<label class="label-control"><p:outputLabel value="आबेदकको बैंक खाता नम्बर:"/><span class="required">*</span></label>
<h:inputText value="#{item.bankAccountNumber}"/>
</h:column>
<h:column>
<h:selectOneRadio id="radio1" value="#{item.bankAccountType}" layout="lineDirection" >
<f:selectItem itemLabel="चल्ती खाता" itemValue="chalti" />
<f:selectItem itemLabel="बचत खाता" itemValue="bachat" />
<f:selectItem itemLabel="कॉल खाता" itemValue="call" />
</h:selectOneRadio>
</h:column>
<h:column>
<h:commandButton value="Remove" action="#{kycBeanJSF.kycWebCoreBean.remove(item)}" immediate="true"/>
</h:column>
</h:dataTable>
<h:commandButton value="Add New" action="#{kycBeanJSF.kycWebCoreBean.addNew()}" immediate="true"/>
</h:form>
My KycBeanJSF is in Request Scope. KycDataModelJSF is in SessionScope.
KycBeanJSF.java
public class KycBeanJSF {
#ManagedProperty(value = "#{kycDataModelJSF}")
private KycDataModelJSF kycDataModelJSF;
private KycWebCoreBean kycWebCoreBean;
#PostConstruct
public void initWebCore(){
kycWebCoreBean = new KycWebCoreBean();
}
//getters and setters
}
KycDataModelJSF.java
#ManagedBean(name = "kycDataModelJSF")
#SessionScoped
public class KycDataModelJSF {
private KYCDTO kycdto;
#PostConstruct
public void init(){
addNew();
}
public KYCDTO getKycdto() {
if (kycdto == null) {
kycdto = new KYCDTO();
}
return kycdto;
}
public void setKycdto(KYCDTO kycdto) {
this.kycdto = kycdto;
}
public void addNew() {
if(getKycdto().getBankAccountInfoDTOs().size()<3){
getKycdto().getBankAccountInfoDTOs().add(new BankAccountInfoDTO());
}
else if(getKycdto().getBankAccountInfoDTOs().size()>=3){
FacesUtil.setErrorFacesMessage("Sorry, cannot add more than three accounts.");
}
}
}
KycWebCoreBean.java
public class KycWebCoreBean {
private KycDataModelJSF kycDataModelJSF;
public KycWebCoreBean() {
kycDataModelJSF = (KycDataModelJSF) Util.getSessionObject("kycDataModelJSF");
kycDependencyInjection = (KycDependencyInjection) Util.getSessionObject("kycDependencyInjection");
applicantRegisterDataModelJSF = (ApplicantRegisterDataModelJSF) Util.getSessionObject("applicantRegisterDataModelJSF");
}
public void addNew() {
if(kycDataModelJSF.getKycdto().getBankAccountInfoDTOs().size()<3){
kycDataModelJSF.getKycdto().getBankAccountInfoDTOs().add(new BankAccountInfoDTO());
}
else if(kycDataModelJSF.getKycdto().getBankAccountInfoDTOs().size()>=3){
FacesUtil.setErrorFacesMessage("Sorry, cannot add more than three accounts.");
}
}
public void remove(BankAccountInfoDTO b) {
kycDataModelJSF.getKycdto().getBankAccountInfoDTOs().remove(b);
}
}
I will provide more Info if required.
Thanks In Advance.
As h:inputText can store only one value, I assume that you want to append new value to old. If so, than in bean which manages that property in setter method use
public void setValue(String value) {
this.value = this.value + " " + value;
}
instead of usual
public void setValue(String value) {
this.value = value;
}
With string "my string" in h:inputText after changing value to "another string" result is "my string another string"
<h:dataTable id="bankAccountDataTable" value="#{kycBeanJSF.kycDataModelJSF.kycdto.bankAccountInfoDTOs}" var="item">
<h:column>
<label class="label-control"><p:outputLabel value="आबेदकको बैंक खाता नम्बर:"/><span class="required">*</span></label>
<h:inputText value="#{item.bankAccountNumber}"/>
</h:column>
<h:column>
<h:selectOneRadio id="radio1" value="#{item.bankAccountType}" layout="lineDirection">
<f:selectItem itemLabel="चल्ती खाता" itemValue="chalti" />
<f:selectItem itemLabel="बचत खाता" itemValue="bachat" />
<f:selectItem itemLabel="कॉल खाता" itemValue="call" />
</h:selectOneRadio>
</h:column>
<h:column>
<h:commandButton value="Remove" actionListener="#{kycBeanJSF.kycWebCoreBean.remove(item)}">
<f:ajax render="#form"/>
</h:commandButton>
</h:column>
</h:dataTable>
<h:commandButton value="Add New" actionListener="#{kycBeanJSF.kycWebCoreBean.addNew()}">
<f:ajax execute="bankAccountDataTable" render="bankAccountDataTable msg"/>
</h:commandButton>

PrimeFaces page Redirecting when checkbox is clicked

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
}
}
}

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;
}

SelectItems of SelectOneMenu always null

When I print the selected item in the console , it is always returned as null
here is the method that create the SelectItem in my ManagedBean:
public List<String> getlisteMatricule() throws HibernateException
{
List<String> matricules = new ArrayList<String>();
for (Vehicule v : vehiculedao.getAll())
{
matricules.add(v.getMatricule());
System.out.println(v.getMatricule());
}
return matricules ;
}
public List<SelectItem> getAllMatricules()
{
List<SelectItem> options = new ArrayList<SelectItem>();
List<String> listMatricules = getlisteMatricule();
for (String mat : listMatricules)
{
options.add(new SelectItem(mat));
System.out.println("items = " + new SelectItem(mat));
}
return options ;
}
And here is my variables in my model which contain the getter and the setters and the constructor:
public class Program
{
private int id_progf;
private int nbrHeure;
private float montantGlobal;
private String commentaire;
private int cin_mon;
private String matricule;
private int cin_cand;
///gettersand setters
.... }
The methode that bring the variables from the database (List)
#Override
public Vehicule getMatricule(String matricule) {
Session session = HibernateUtil.currentSession();
Vehicule v=(Vehicule)session.get(Vehicule.class, matricule);
return v;
}
And finally my xhtml file, it contains the form:
<h:panelGrid columns="2" >
<h:outputText value="Moniteur :" />
<h:selectOneMenu id="listeNomPrenom" title="Nom et Prenom" value="{#programMB.np}">
<f:selectItems value="#{moniteurMB.allNomPrenom}" />
</h:selectOneMenu>
<h:outputText value="Vehicule :" />
<h:selectOneMenu id="ListeMatricules" title="Matricules" value="{#programMB.program.matricule}">
<f:selectItems value="#{vehiculeMB.allMatricules}" />
</h:selectOneMenu>
<h:outputText value="Nombre heures:" />
<p:inputText value="#{programMB.program.nbrHeure}" />
</h:panelGrid>
<p:commandButton value="Save" action="#{programMB.ajouterProg}" />
In the first look, I saw the problem is in the value attribute of both of your selectOneMenu bellow:
<h:selectOneMenu id="listeNomPrenom" title="Nom et Prenom" value="{#programMB.np}">
<f:selectItems value="#{moniteurMB.allNomPrenom}" />
</h:selectOneMenu>
and:
<h:selectOneMenu id="ListeMatricules" title="Matricules" value="{#programMB.program.matricule}">
<f:selectItems value="#{vehiculeMB.allMatricules}" />
</h:selectOneMenu>
In both of them you just putted # in the wrong place. change value="{#programMB.np}" to value="#{programMB.np}" and value="{#programMB.program.matricule}" to value="#{programMB.program.matricule}" and it should work for you!

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