BrightSide Workbench Full Report + Source Code
org.turro.financials.product.ProductCombobox Class Reference
Inheritance diagram for org.turro.financials.product.ProductCombobox:
Collaboration diagram for org.turro.financials.product.ProductCombobox:

Public Member Functions

void setProductId (long id)
 
void populateList (String value, LinkedList list, int nRows)
 
String getTextFromObject (Product value)
 
- Public Member Functions inherited from org.turro.zkoss.input.GenericCombobox< V >
 GenericCombobox ()
 
getObjectValue ()
 
void setObjectValue (V value)
 
boolean isAllowNotInModelValues ()
 
void setAllowNotInModelValues (boolean allowNotInModelValues)
 
void refreshModel ()
 
abstract String getTextFromObject (V value)
 
Object getRelatedEntity ()
 
void setRelatedEntity (Object relatedEntity)
 
void render (Comboitem item, Object data, int index) throws Exception
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 32 of file ProductCombobox.java.

Member Function Documentation

◆ getTextFromObject()

String org.turro.financials.product.ProductCombobox.getTextFromObject ( Product  value)

Definition at line 58 of file ProductCombobox.java.

58  {
59  return "#" + value.getProductCode() + " " + value.getDescription();
60  }
Here is the call graph for this function:

◆ populateList()

void org.turro.financials.product.ProductCombobox.populateList ( String  value,
LinkedList  list,
int  nRows 
)

Reimplemented from org.turro.zkoss.input.GenericCombobox< V >.

Definition at line 39 of file ProductCombobox.java.

39  {
40  Dao dao = new FinancialsPU();
41  WhereClause wc = new WhereClause();
42  wc.addClause("select product from Product as product");
43  wc.addClause("where 1=1");
44  wc.addClause("and (");
45  if(!Strings.isBlank(value)) {
46  wc.setPrefix("");
47  wc.addLikeFields(new String[] { "product.description" }, value);
48  wc.addClause("or");
49  }
50  wc.addClause(" product.productCode = :pcode");
51  wc.addClause(")");
52  wc.addClause("order by product.description");
53  wc.addNamedValue("pcode", value);
54  list.addAll(dao.getResultList(wc, nRows));
55  }
Here is the call graph for this function:

◆ setProductId()

void org.turro.financials.product.ProductCombobox.setProductId ( long  id)

Definition at line 34 of file ProductCombobox.java.

34  {
35  setObjectValue(new FinancialsPU().find(Product.class, id));
36  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: