Package org.adempiere.webui.window
Class FindWindow
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
org.adempiere.webui.component.Window
org.adempiere.webui.window.FindWindow
- All Implemented Interfaces:
Serializable,Cloneable,DialogEvents,ValueChangeListener,ISupportMask,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.IdSpace,org.zkoss.zk.ui.sys.ComponentCtrl,org.zkoss.zul.ext.Framable
public class FindWindow
extends Window
implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, ValueChangeListener, DialogEvents
Find/Search Records dialog.
- Author:
- Sendy Yagambrum
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classSimple tree node class for product category tree search.Nested classes/interfaces inherited from class org.zkoss.zul.Window
org.zkoss.zul.Window.ModeNested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ListboxCenter ofwinAdvanced.protected ToolBarToolbar for advance search tab.protected ToolBarButtonElements to show advanced options for saved queriesprotected ToolBarButtonButton to save current user queryprotected Checkboxprotected Checkboxprotected static final StringColumn name attribute set instanceprotected GridCenter ofwinLookupRecord.protected RowsRows ofcontentSimpleprotected static final intm_totalis set to this constant if get record count hit query timeout exceptionprotected static final Stringstatic final intMax display length of Fields on simple search tabprotected static final Stringprotected static final Stringprotected ComboboxDrop down for user query namesprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected ComboboxList of history scope options (all, year, month, etc)protected ValueNamePair[]static final intIndex AndOr = 4static final intIndex ColumnName = 0static final intIndex Historystatic final intIndex LeftBracket = 5static final intIndex Operator = 1static final intIndex RightBracket = 6static final intIndex Tablestatic final intIndex Value = 2static final intIndex Value2 = 3protected booleanSet to true if query timeout to get record countprotected booleanprotected booleanprotected static final CLoggerLoggerprotected intAD_Tab_ID of calling tabprotected StringAD_Tab_UU of calling tabprotected intTable IDprotected intIDEMPIERE-4085protected PropertiesContext for advance search tabprotected booleantrue if user click the new record button at simple search tabprotected GridField[]Search fields of calling tab (m_AD_Tab_ID)protected GridTabGrid tab for current row ofadvancedPanelprotected booleanIs cancel ?protected intprotected MQueryResulting queryList of WEditors for simple search tabprotected ArrayList<ToolBarButton>List of button to toggle visibility of to editor.List of to editor.protected PropertiesContext for simple search tabprotected StringSearch messages using translationprotected StringTable Nameprotected MTab[]target tab (m_AD_Tab_ID) and its child tabsprotected intTarget Tab Noprotected intTarget Window Noprotected Stringprotected intNumber of recordsprotected StringWhereprotected StringIDEMPIERE-2836 User Query Whereprotected AbstractADWindowContentADWindow Content part that own this find window instanceprotected static final Stringprotected org.zkoss.zul.Popupprotected intRow count ofadvancedPanelprotected static final Stringprotected static final longgenerated serial idprotected StatusBarPanelStatus bar.static final intTab number for lookup and contextprotected MUserQuery[]User queries for target tab (m_AD_Tab_ID)protected WindowAdvanced search Tabprotected WindowSimple search Tabprotected MultiTabPartTabbox for window.Fields inherited from class org.adempiere.webui.component.Window
DECORATE_INFO, INSERT_END, INSERT_NEXT, INSERT_POSITION_KEY, MODE_EMBEDDED, MODE_HIGHLIGHTED, MODE_KEY, MODE_MODAL, MODE_OVERLAPPED, MODE_POPUP, REPLACE, showMaskWrapperFields inherited from class org.zkoss.zul.Window
EMBEDDED, HIGHLIGHTED, MODAL, OVERLAPPED, POPUPFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNOREFields inherited from interface org.adempiere.webui.event.DialogEvents
ON_BEFORE_RUN_PROCESS, ON_WINDOW_CLOSEFields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG -
Constructor Summary
ConstructorsConstructorDescriptionFindWindow(int targetWindowNo, int targetTabNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId) FindWindow ConstructorFindWindow(int targetWindowNo, int targetTabNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId, AbstractADWindowContent windowPanel) FindWindow Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHistoryRestriction(org.zkoss.zul.Comboitem selectedHistoryItem) Adding where clause from history dataprotected voidaddOperators(ValueNamePair[] op, Combobox listOperator) add op to listOperatorprotected voidaddOperators(org.zkoss.zul.Comboitem column, Combobox listOperator) Retrieve operators depending on the item selected in the 'Column' field and add them to the selectionprotected voidaddOperatorsAttribute(org.zkoss.zul.Comboitem column, Combobox listOperator) add operators to listOperator depends on the type of attributeprotected voidaddRowEditor(org.zkoss.zk.ui.Component component, ListCell listcell) add component to listcellbooleanaddSelectionColumn(GridField mField) Create editor for mField and add to simple search tabbooleanaddSelectionColumn(GridField mField, Group group) Create editor for mField and add to simple search tabvoidSimulate the user query selection and click okprotected voidappendCode(StringBuilder code, String columnName, String operator, String value1, String value2, String andOr, String lBrackets, String rBrackets, String tableUID) Append values to codeprotected voidAdvanced OK Button pressedprotected voidSimple OK Button pressedprotected voidcmd_saveAdvanced(boolean saveQuery) Create advance search queryprotected voidcmd_saveSimple(boolean saveQuery) Create simple search queryprotected org.zkoss.zul.DivcreateDateRangeWrapper(WEditor editorFrom, WEditor editorTo) protected voidadd new row toadvancedPanelprotected voidcreateFields(String[] fields, int row) add new row(ListItem) toadvancedPanelvoiddispose()hide window and fireDialogEvents.ON_WINDOW_CLOSEeventprotected voiddynamicDisplay(WEditor editor, ListCell listcell) Dynamic display of editorprotected voidSet focus to last row ofadvancedPanelintprotected StringgetAttributeSQL(Integer M_Attribute_ID) org.zkoss.zk.ui.ComponentgetAttributeValuesListComponent(ListItem row, boolean isValueTo) Create editor for attribute valueprotected StringgetColumnName(ListItem row) retrieve the columnName of the Column item selectedCreate editor foradvancedPanelroworg.zkoss.zk.ui.ComponentgetEditorComponent(ListItem row, boolean to) Get editor component foradvancedPanelrowprotected intgetHistoryDays(String selectedItem) Get days from selected values of history comboprotected intgetHistoryIndex(String value) protected StringReturns the value selected for the left bracket list item in the current rowprotected intgetNoOfRecords(MQuery query, boolean alertRecords) Get the number of records of querygetQuery()Get Query - Retrieve resultprotected StringReturns the value selected for the right bracket list item in the current rowprotected StringgetSubCategoriesString(int productCategoryId, Vector<FindWindow.SimpleTreeNode> categories, int loopIndicatorId) Recursive search for subcategories with loop detection.protected StringgetSubCategoryWhereClause(GridField field, int productCategoryId) Returns a sql where clause with the given category id and all of its subcategory ids.getTargetMField(String columnName) Find grid field from column nameintGet Total Recordsprotected booleanhasAccessSpecialFields(GridField field) protected voidHide advance searchprotected voidLayout advance search tab (winAdvanced).protected voidinitFind()Initialize simple search tabprotected voidInitialise advance search tabbooleanInitialize find windowprotected voidLayout windowprotected voidLayout simple search tab (winLookupRecord).protected voidinitTabs()Get target tab (m_AD_Tab_ID) and its child tabs intom_tabsprotected booleanbooleanisCancel()booleanprotected booleanprotected booleanisProductCategoryField(String columnName) Checks the given column.protected booleanisSearchLike(GridField field) booleanisValid()protected voidOn switch to advance search tabprotected voidonCancel()user cancellation, close dialogvoidonEvent(org.zkoss.zk.ui.event.Event event) voidPost visible event.voidOn selection of user queryprotected voidOn switch to simple search tabprotected org.zkoss.zk.ui.ComponentparseAttributeString(int M_Attribute_ID, String value, ListItem listItem, boolean isValueTo) Create editor and set editor value to pass in value parameterprotected ObjectparseAttributeValue(int M_Attribute_ID, Object value) Convert value to type appropriate for M_Attribute_ID (if needed)protected WEditorparseString(GridField field, String in, ListItem listItem, boolean to) Create editor and set value to in (foradvancedPanelrow).protected voidparseUserQuery(MUserQuery userQuery) Parse user queryprotected ObjectparseValue(GridField field, Object in) Parse and convert type (if needed)protected voidPrepare combo of history scope optionsprotected voidreload user queriesprotected voidsaveQuery(boolean saveQuery, StringBuilder code) voidsetAD_UserQuery_ID(int AD_UserQuery_ID) Set selected user query to AD_UserQuery_IDprotected voidsetAttributes(Combobox listColumn, Combobox listOperator, String[] fields) Populate listColumn and listOperatorprotected voidsetLengthStringField(GridField field, org.zkoss.zk.ui.Component fieldEditor) protected voidsetStatusDB(int currentCount) Display current countprotected voidsetValues(GridField[] findFields, Combobox listTable, Combobox listColumn, Combobox listOperator, String[] fields) Populate listTable, listColumn and listOperator values foradvancedPanelrow.booleansetVisible(boolean visible) protected voidShow advance searchprotected voidupdateColumnListModel(Combobox listColumn, ValueNamePair[] cols) Create list model from cols for listColumnbooleanvalidate(int targetWindowNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId) voidOn value change eventMethods inherited from class org.adempiere.webui.component.Window
getMaskComponent, getMaskObj, getModeAttribute, hideMask, isFireWindowCloseEventOnDetach, onPageDetached, setFireWindowCloseEventOnDetach, showMaskMethods inherited from class org.zkoss.zul.Window
beforeChildAdded, clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getMinheight, getMinwidth, getMode, getModeType, getPosition, getTitle, getZclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isCollapsible, isMaximizable, isMaximized, isMinimizable, isMinimized, isShadow, isSizable, onChildRemoved, onClose, onModal, renderProperties, service, setBorder, setBorder, setClosable, setContentSclass, setContentStyle, setDraggable, setMaximizable, setMaximized, setMinheight, setMinimizable, setMinimized, setMinwidth, setMode, setMode, setMode, setPosition, setShadow, setSizable, setTitle, setTopmostMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellowMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
-
Field Details
-
serialVersionUID
protected static final long serialVersionUIDgenerated serial id- See Also:
-
FIND_ROW_EDITOR
- See Also:
-
FIND_ROW_EDITOR_TO
- See Also:
-
HISTORY_DAY_ALL
- See Also:
-
HISTORY_DAY_YEAR
- See Also:
-
HISTORY_DAY_MONTH
- See Also:
-
HISTORY_DAY_WEEK
- See Also:
-
HISTORY_DAY_DAY
- See Also:
-
historyItems
-
HISTORY_LABEL
- See Also:
-
winMain
Tabbox for window. Center of find window. -
winLookupRecord
Simple search Tab -
winAdvanced
Advanced search Tab -
fQueryName
Drop down for user query names -
advancedPanel
Center ofwinAdvanced. List of search criterias. -
contentSimple
Center ofwinLookupRecord. Grid layout of search fields. -
m_targetWindowNo
protected int m_targetWindowNoTarget Window No -
m_targetTabNo
protected int m_targetTabNoTarget Tab No -
m_AD_Table_ID
protected int m_AD_Table_IDTable ID -
m_tableName
Table Name -
m_whereExtended
Where -
m_findFields
Search fields of calling tab (m_AD_Tab_ID) -
m_gridTab
Grid tab for current row ofadvancedPanel -
m_query
Resulting query -
m_isCancel
protected boolean m_isCancelIs cancel ? -
log
Logger -
m_total
protected int m_totalNumber of records -
initialSlowQuery
protected boolean initialSlowQuerySet to true if query timeout to get record count -
m_tabs
target tab (m_AD_Tab_ID) and its child tabs -
m_sEditors
List of WEditors for simple search tab -
m_sEditorsFlag
List of button to toggle visibility of to editor. For date and numeric field in simple search tab. -
m_sEditorsTo
List of to editor. For date and numeric field in simple search tab. -
TABNO
public static final int TABNOTab number for lookup and context- See Also:
-
FIELDLENGTH
public static final int FIELDLENGTHMax display length of Fields on simple search tab- See Also:
-
m_AD_Tab_ID
protected int m_AD_Tab_IDAD_Tab_ID of calling tab -
m_AD_Tab_UU
AD_Tab_UU of calling tab -
userQueries
User queries for target tab (m_AD_Tab_ID) -
contentSimpleRows
Rows ofcontentSimple -
m_createNew
protected boolean m_createNewtrue if user click the new record button at simple search tab -
isvalid
protected boolean isvalid -
m_minRecords
protected int m_minRecords -
m_title
-
btnSave
Button to save current user query -
btnMoreOptions
Elements to show advanced options for saved queries -
popupOptions
protected org.zkoss.zul.Popup popupOptions -
chkSaveDefault
-
INDEX_COLUMNNAME
public static final int INDEX_COLUMNNAMEIndex ColumnName = 0- See Also:
-
INDEX_OPERATOR
public static final int INDEX_OPERATORIndex Operator = 1- See Also:
-
INDEX_VALUE
public static final int INDEX_VALUEIndex Value = 2- See Also:
-
INDEX_VALUE2
public static final int INDEX_VALUE2Index Value2 = 3- See Also:
-
INDEX_ANDOR
public static final int INDEX_ANDORIndex AndOr = 4- See Also:
-
INDEX_LEFTBRACKET
public static final int INDEX_LEFTBRACKETIndex LeftBracket = 5- See Also:
-
INDEX_RIGHTBRACKET
public static final int INDEX_RIGHTBRACKETIndex RightBracket = 6- See Also:
-
INDEX_HISTORY
public static final int INDEX_HISTORYIndex History- See Also:
-
INDEX_TABLE
public static final int INDEX_TABLEIndex Table- See Also:
-
m_sNew
Search messages using translation -
FIELD_SEPARATOR
- See Also:
-
SEGMENT_SEPARATOR
- See Also:
-
HISTORY_SEPARATOR
- See Also:
-
historyCombo
List of history scope options (all, year, month, etc) -
m_simpleCtx
Context for simple search tab -
m_advanceCtx
Context for advance search tab -
rowCount
protected int rowCountRow count ofadvancedPanel -
ON_POST_VISIBLE_ATTR
- See Also:
-
COUNTING_RECORDS_TIMED_OUT
protected static final int COUNTING_RECORDS_TIMED_OUTm_totalis set to this constant if get record count hit query timeout exception- See Also:
-
statusBar
Status bar. Bottom of find window -
m_whereUserQuery
IDEMPIERE-2836 User Query Where -
advancedPanelToolBar
Toolbar for advance search tab. North ofwinAdvanced. -
m_AD_UserQuery_ID
protected int m_AD_UserQuery_IDIDEMPIERE-4085 -
m_windowPanel
ADWindow Content part that own this find window instance -
COLUMNNAME_M_AttributeSetInstance_ID
Column name attribute set instance- See Also:
-
isUseEscForTabClosing
protected boolean isUseEscForTabClosing
-
-
Constructor Details
-
FindWindow
public FindWindow(int targetWindowNo, int targetTabNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId) FindWindow Constructor- Parameters:
targetWindowNo- targetWindowNotargetTabNo-title- titleAD_Table_ID- AD_Table_IDtableName- tableNamewhereExtended- whereExtendedfindFields- findFieldsminRecords- minRecordsadTabId-
-
FindWindow
public FindWindow(int targetWindowNo, int targetTabNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId, AbstractADWindowContent windowPanel) FindWindow Constructor- Parameters:
targetWindowNo- targetWindowNotargetTabNo-title- titleAD_Table_ID- AD_Table_IDtableName- tableNamewhereExtended- whereExtendedfindFields- findFieldsminRecords- minRecordsadTabId-windowPanel- AbstractADWindowContent
-
-
Method Details
-
initialize
public boolean initialize()Initialize find window- Returns:
- true if init ok
-
validate
public boolean validate(int targetWindowNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId) - Parameters:
targetWindowNo-title-AD_Table_ID-tableName-whereExtended-findFields-minRecords-adTabId-- Returns:
- false if this find window instance doesn't match one of the input parameters
-
initSimple
protected void initSimple()Layout simple search tab (winLookupRecord). -
initAdvanced
protected void initAdvanced()Layout advance search tab (winAdvanced). -
initPanel
protected void initPanel()Layout window -
prepareHistoryCombo
protected void prepareHistoryCombo()Prepare combo of history scope options -
initFind
protected void initFind()Initialize simple search tab -
hasAccessSpecialFields
- Parameters:
field-- Returns:
- true if log in role has access to window for special field (account combination, resource, chat, image, location, locator and attribute set instance)
-
initFindAdvanced
protected void initFindAdvanced()Initialise advance search tab -
createFields
protected void createFields()add new row toadvancedPanel -
createFields
add new row(ListItem) toadvancedPanel- Parameters:
fields-row- current last row index
-
createDateRangeWrapper
- Parameters:
editorFrom-editorTo-- Returns:
- Div wrapper with
DateRangeButton
-
setValues
protected void setValues(GridField[] findFields, Combobox listTable, Combobox listColumn, Combobox listOperator, String[] fields) Populate listTable, listColumn and listOperator values foradvancedPanelrow.- Parameters:
findFields-listTable- tables combo boxlistColumn- columns combo boxlistOperator- operators combo boxfields- values foradvancedPanelcolumn
-
updateColumnListModel
Create list model from cols for listColumn- Parameters:
listColumn-cols- columns
-
isFilterColumnList
protected boolean isFilterColumnList()- Returns:
- true if columns combo in advance search should filter by user enter text
-
addSelectionColumn
Create editor for mField and add to simple search tab- Parameters:
mField- field- Returns:
- true if editor created and added
-
addSelectionColumn
Create editor for mField and add to simple search tab- Parameters:
mField- fieldgroup-- Returns:
- true if editor created and added
-
setLengthStringField
-
onEvent
- Specified by:
onEventin interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>- Throws:
Exception
-
onCancel
protected void onCancel()user cancellation, close dialog -
onSelectedQueryChanged
public void onSelectedQueryChanged()On selection of user query -
onSimpleTabSelected
protected void onSimpleTabSelected()On switch to simple search tab -
onAdvanceTabSelected
protected void onAdvanceTabSelected()On switch to advance search tab -
focusToLastAdvanceRow
protected void focusToLastAdvanceRow()Set focus to last row ofadvancedPanel -
parseUserQuery
Parse user query- Parameters:
userQuery-
-
getHistoryIndex
-
parseString
Create editor and set value to in (foradvancedPanelrow).- Parameters:
field- columnin- valuelistItem- row ofadvancedPanelto-- Returns:
- WEditor
-
cmd_saveAdvanced
protected void cmd_saveAdvanced(boolean saveQuery) Create advance search query- Parameters:
saveQuery- true to save as user query
-
getLeftBracketValue
Returns the value selected for the left bracket list item in the current row- Parameters:
row-- Returns:
- empty, (, (( or (((
-
getRightBracketValue
Returns the value selected for the right bracket list item in the current row- Parameters:
row-- Returns:
- empty, ), )) or )))
-
appendCode
protected void appendCode(StringBuilder code, String columnName, String operator, String value1, String value2, String andOr, String lBrackets, String rBrackets, String tableUID) Append values to code- Parameters:
code-columnName-operator-value1-value2-andOr-lBrackets-rBrackets-tableUID-
-
saveQuery
- Parameters:
saveQuery- false to save code as user query, false to do nothingcode-
-
cmd_saveSimple
protected void cmd_saveSimple(boolean saveQuery) Create simple search query- Parameters:
saveQuery- true to save as user query
-
refreshUserQueries
protected void refreshUserQueries()reload user queries -
getColumnName
retrieve the columnName of the Column item selected- Parameters:
row-- Returns:
- column name
-
addRowEditor
add component to listcell- Parameters:
component- editor componentlistcell-
-
addOperators
Retrieve operators depending on the item selected in the 'Column' field and add them to the selection- Parameters:
column- Column field selectedlistOperator-
-
addOperators
add op to listOperator- Parameters:
op- array of operatorslistOperator-
-
getEditor
Create editor foradvancedPanelrow- Parameters:
row- rowto-- Returns:
- WEditor
-
getEditorComponent
Get editor component foradvancedPanelrow- Parameters:
row- rowto-- Returns:
- Editor component
-
getTargetMField
Find grid field from column name- Parameters:
columnName- column name- Returns:
- GridField
-
cmd_ok_Simple
protected void cmd_ok_Simple()Simple OK Button pressed -
getHistoryDays
Get days from selected values of history combo- Parameters:
selectedItem-- Returns:
- number of days
-
addHistoryRestriction
protected void addHistoryRestriction(org.zkoss.zul.Comboitem selectedHistoryItem) Adding where clause from history data- Parameters:
selectedHistoryItem-
-
dispose
public void dispose()hide window and fireDialogEvents.ON_WINDOW_CLOSEevent -
cmd_ok_Advanced
protected void cmd_ok_Advanced()Advanced OK Button pressed -
advancedOkClick
public void advancedOkClick()Simulate the user query selection and click ok -
getNoOfRecords
Get the number of records of query- Parameters:
query- where clause for target tabalertRecords- show dialog if there are no records or there are more records than allowed for role/tab- Returns:
- record count; if the results are more then allowed this method will return 0
-
isProductCategoryField
Checks the given column.- Parameters:
columnName-- Returns:
- true if the column is a product category column
-
getSubCategoryWhereClause
Returns a sql where clause with the given category id and all of its subcategory ids. It is used as restriction in MQuery.- Parameters:
field-productCategoryId-- Returns:
- sql where clause
-
getSubCategoriesString
protected String getSubCategoriesString(int productCategoryId, Vector<FindWindow.SimpleTreeNode> categories, int loopIndicatorId) throws AdempiereSystemError Recursive search for subcategories with loop detection.- Parameters:
productCategoryId-categories-loopIndicatorId-- Returns:
- comma separated list of category ids
- Throws:
AdempiereSystemError- if a loop is detected
-
parseValue
Parse and convert type (if needed)- Parameters:
field-GridFieldin- input value- Returns:
- in converted to appropriate type for field
-
getQuery
Get Query - Retrieve result- Returns:
- String representation of query
-
getTotalRecords
public int getTotalRecords()Get Total Records- Returns:
- no of records
-
valueChange
Description copied from interface:ValueChangeListenerOn value change event- Specified by:
valueChangein interfaceValueChangeListener
-
dynamicDisplay
Dynamic display of editor- Parameters:
editor-listcell-
-
OnPostVisible
public void OnPostVisible()Post visible event. Echo fromsetVisible(boolean). -
isCancel
public boolean isCancel()- Returns:
- true if dialog cancel by user, false otherwise
-
isCreateNew
public boolean isCreateNew()- Returns:
- true if user press the new button
-
setVisible
public boolean setVisible(boolean visible) - Specified by:
setVisiblein interfaceorg.zkoss.zk.ui.Component- Overrides:
setVisiblein classorg.zkoss.zul.Window
-
isSearchLike
- Parameters:
field-- Returns:
- true to use Like, false otherwise
-
isValid
public boolean isValid()- Returns:
- true if dialog is visible and not cancel
-
setStatusDB
protected void setStatusDB(int currentCount) Display current count- Parameters:
currentCount- String representation of current/total
-
hideAdvanced
protected void hideAdvanced()Hide advance search -
showAdvanced
protected void showAdvanced()Show advance search -
getAD_UserQuery_ID
public int getAD_UserQuery_ID()- Returns:
- AD_UserQuery_ID of selected user query (
fQueryName)
-
setAD_UserQuery_ID
public void setAD_UserQuery_ID(int AD_UserQuery_ID) Set selected user query to AD_UserQuery_ID- Parameters:
AD_UserQuery_ID-
-
getAttributeSQL
- Parameters:
M_Attribute_ID-- Returns:
- sql clause for attribute value
-
parseAttributeString
protected org.zkoss.zk.ui.Component parseAttributeString(int M_Attribute_ID, String value, ListItem listItem, boolean isValueTo) Create editor and set editor value to pass in value parameter- Parameters:
M_Attribute_ID-value- valuelistItem-isValueTo-- Returns:
- Component of created editor
-
setAttributes
Populate listColumn and listOperator- Parameters:
listColumn-listOperator-fields- value foradvancedPanelcolumns
-
addOperatorsAttribute
add operators to listOperator depends on the type of attribute- Parameters:
column-listOperator-
-
getAttributeValuesListComponent
public org.zkoss.zk.ui.Component getAttributeValuesListComponent(ListItem row, boolean isValueTo) throws Exception Create editor for attribute value- Parameters:
row-isValueTo-- Returns:
- Component of created editor
- Throws:
Exception
-
parseAttributeValue
Convert value to type appropriate for M_Attribute_ID (if needed)- Parameters:
M_Attribute_ID-value-- Returns:
- converted value to desire type
-
initTabs
protected void initTabs()Get target tab (m_AD_Tab_ID) and its child tabs intom_tabs -
isAttributeTable
protected boolean isAttributeTable()- Returns:
- true if target tab/table contains column M_AttributeSetInstance_ID
-