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
Modifier and TypeClassDescriptionprotected static class
Simple tree node class for product category tree search.Nested classes/interfaces inherited from class org.zkoss.zul.Window
org.zkoss.zul.Window.Mode
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
Nested 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
Modifier and TypeFieldDescriptionprotected Listbox
Center ofwinAdvanced
.protected ToolBar
Toolbar for advance search tab.protected ToolBarButton
Button to save current user queryprotected ToolBarButton
Button to share current user queryprotected static final String
Column name attribute set instanceprotected Grid
Center ofwinLookupRecord
.protected Rows
Rows ofcontentSimple
protected static final int
m_total
is set to this constant if get record count hit query timeout exceptionprotected static final String
static final int
Max display length of Fields on simple search tabprotected static final String
protected static final String
protected Combobox
Drop down for user query namesprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected Combobox
List of history scope options (all, year, month, etc)protected ValueNamePair[]
static final int
Index AndOr = 4static final int
Index ColumnName = 0static final int
Index Historystatic final int
Index LeftBracket = 5static final int
Index Operator = 1static final int
Index RightBracket = 6static final int
Index Tablestatic final int
Index Value = 2static final int
Index Value2 = 3protected boolean
Set to true if query timeout to get record countprotected boolean
protected boolean
protected static final CLogger
Loggerprotected int
AD_Tab_ID of calling tabprotected String
AD_Tab_UU of calling tabprotected int
Table IDprotected int
IDEMPIERE-4085protected Properties
Context for advance search tabprotected boolean
true if user click the new record button at simple search tabprotected GridField[]
Search fields of calling tab (m_AD_Tab_ID
)protected GridTab
Grid tab for current row ofadvancedPanel
protected boolean
Is cancel ?protected int
protected MQuery
Resulting queryList of WEditors for simple search tabprotected ArrayList<ToolBarButton>
List of button to toggle visibility of to editor.List of to editor.protected Properties
Context for simple search tabprotected String
Search messages using translationprotected String
Table Nameprotected MTab[]
target tab (m_AD_Tab_ID
) and its child tabsprotected int
Target Tab Noprotected int
Target Window Noprotected String
protected int
Number of recordsprotected String
Whereprotected String
IDEMPIERE-2836 User Query Whereprotected AbstractADWindowContent
ADWindow Content part that own this find window instanceprotected Label
Message for user query operationsprotected static final String
protected int
Row count ofadvancedPanel
protected static final String
protected static final long
generated serial idprotected StatusBarPanel
Status bar.static final int
Tab number for lookup and contextprotected MUserQuery[]
User queries for target tab (m_AD_Tab_ID
)protected Window
Advanced search Tabprotected Window
Simple search Tabprotected MultiTabPart
Tabbox for window.Fields inherited from class org.adempiere.webui.component.Window
INSERT_END, INSERT_NEXT, INSERT_POSITION_KEY, MODE_EMBEDDED, MODE_HIGHLIGHTED, MODE_KEY, MODE_MODAL, MODE_OVERLAPPED, MODE_POPUP, REPLACE, showMaskWrapper
Fields inherited from class org.zkoss.zul.Window
EMBEDDED, HIGHLIGHTED, MODAL, OVERLAPPED, POPUP
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
Fields 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_IGNORE
Fields inherited from interface org.adempiere.webui.event.DialogEvents
ON_BEFORE_RUN_PROCESS, ON_WINDOW_CLOSE
Fields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG
-
Constructor Summary
ConstructorDescriptionFindWindow
(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 void
addHistoryRestriction
(org.zkoss.zul.Comboitem selectedHistoryItem) Adding where clause from history dataprotected void
addOperators
(ValueNamePair[] op, Combobox listOperator) add op to listOperatorprotected void
addOperators
(org.zkoss.zul.Comboitem column, Combobox listOperator) Retrieve operators depending on the item selected in the 'Column' field and add them to the selectionprotected void
addOperatorsAttribute
(org.zkoss.zul.Comboitem column, Combobox listOperator) add operators to listOperator depends on the type of attributeprotected void
addRowEditor
(org.zkoss.zk.ui.Component component, ListCell listcell) add component to listcellboolean
addSelectionColumn
(GridField mField) Create editor for mField and add to simple search tabboolean
addSelectionColumn
(GridField mField, Group group) Create editor for mField and add to simple search tabvoid
Simulate the user query selection and click okprotected void
appendCode
(StringBuilder code, String columnName, String operator, String value1, String value2, String andOr, String lBrackets, String rBrackets, String tableUID) Append values to codeprotected void
Advanced OK Button pressedprotected void
Simple OK Button pressedprotected void
cmd_saveAdvanced
(boolean saveQuery, boolean shareAllUsers) Create advance search queryprotected void
cmd_saveSimple
(boolean saveQuery, boolean shareAllUsers) Create simple search queryprotected org.zkoss.zul.Div
createDateRangeWrapper
(WEditor editorFrom, WEditor editorTo) protected void
add new row toadvancedPanel
protected void
createFields
(String[] fields, int row) add new row(ListItem
) toadvancedPanel
void
dispose()
hide window and fireDialogEvents.ON_WINDOW_CLOSE
eventprotected void
dynamicDisplay
(WEditor editor, ListCell listcell) Dynamic display of editorprotected void
Set focus to last row ofadvancedPanel
int
protected String
getAttributeSQL
(Integer M_Attribute_ID) org.zkoss.zk.ui.Component
getAttributeValuesListComponent
(ListItem row, boolean isValueTo) Create editor for attribute valueprotected String
getColumnName
(ListItem row) retrieve the columnName of the Column item selectedCreate editor foradvancedPanel
roworg.zkoss.zk.ui.Component
getEditorComponent
(ListItem row, boolean to) Get editor component foradvancedPanel
rowprotected int
getHistoryDays
(String selectedItem) Get days from selected values of history comboprotected int
getHistoryIndex
(String value) protected String
Returns the value selected for the left bracket list item in the current rowprotected int
getNoOfRecords
(MQuery query, boolean alertRecords) Get the number of records of querygetQuery()
Get Query - Retrieve resultprotected String
Returns the value selected for the right bracket list item in the current rowprotected String
getSubCategoriesString
(int productCategoryId, Vector<FindWindow.SimpleTreeNode> categories, int loopIndicatorId) Recursive search for subcategories with loop detection.protected String
getSubCategoryWhereClause
(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 nameint
Get Total Recordsprotected boolean
hasAccessSpecialFields
(GridField field) protected void
Hide advance searchprotected void
Layout advance search tab (winAdvanced
).protected void
initFind()
Initialize simple search tabprotected void
Initialise advance search tabboolean
Initialize find windowprotected void
Layout windowprotected void
Layout simple search tab (winLookupRecord
).protected void
initTabs()
Get target tab (m_AD_Tab_ID
) and its child tabs intom_tabs
protected boolean
boolean
isCancel()
boolean
protected boolean
protected boolean
isProductCategoryField
(String columnName) Checks the given column.protected boolean
isSearchLike
(GridField field) boolean
isValid()
protected void
On switch to advance search tabprotected void
onCancel()
user cancellation, close dialogvoid
onEvent
(org.zkoss.zk.ui.event.Event event) void
Post visible event.void
On selection of user queryprotected void
On switch to simple search tabprotected 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 parameterprotected Object
parseAttributeValue
(int M_Attribute_ID, Object value) Convert value to type appropriate for M_Attribute_ID (if needed)protected WEditor
parseString
(GridField field, String in, ListItem listItem, boolean to) Create editor and set value to in (foradvancedPanel
row).protected void
parseUserQuery
(MUserQuery userQuery) Parse user queryprotected Object
parseValue
(GridField field, Object in) Parse and convert type (if needed)protected void
Prepare combo of history scope optionsprotected void
reload user queriesprotected void
saveQuery
(boolean saveQuery, StringBuilder code, boolean shareAllUsers) void
setAD_UserQuery_ID
(int AD_UserQuery_ID) Set selected user query to AD_UserQuery_IDprotected void
setAttributes
(Combobox listColumn, Combobox listOperator, String[] fields) Populate listColumn and listOperatorprotected void
setLengthStringField
(GridField field, org.zkoss.zk.ui.Component fieldEditor) protected void
setStatusDB
(int currentCount) Display current countprotected void
setValues
(GridField[] findFields, Combobox listTable, Combobox listColumn, Combobox listOperator, String[] fields) Populate listTable, listColumn and listOperator values foradvancedPanel
row.boolean
setVisible
(boolean visible) protected void
Show advance searchprotected void
updateColumnListModel
(Combobox listColumn, ValueNamePair[] cols) Create list model from cols for listColumnboolean
validate
(int targetWindowNo, String title, int AD_Table_ID, String tableName, String whereExtended, GridField[] findFields, int minRecords, int adTabId) void
On value change eventMethods inherited from class org.adempiere.webui.component.Window
getMaskComponent, getMaskObj, getModeAttribute, hideMask, isFireWindowCloseEventOnDetach, onPageDetached, setFireWindowCloseEventOnDetach, showMask
Methods 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, setTopmost
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
Methods 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, setZIndexDirectly
Methods 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, willSerialize
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow
Methods 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 -
msgLabel
Message for user query operations -
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_total
is 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 foradvancedPanel
row.- Parameters:
findFields
-listTable
- tables combo boxlistColumn
- columns combo boxlistOperator
- operators combo boxfields
- values foradvancedPanel
column
-
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:
onEvent
in 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 (foradvancedPanel
row).- Parameters:
field
- columnin
- valuelistItem
- row ofadvancedPanel
to
-- Returns:
- WEditor
-
cmd_saveAdvanced
protected void cmd_saveAdvanced(boolean saveQuery, boolean shareAllUsers) Create advance search query- Parameters:
saveQuery
- true to save as user queryshareAllUsers
-
-
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
-shareAllUsers
-
-
cmd_saveSimple
protected void cmd_saveSimple(boolean saveQuery, boolean shareAllUsers) Create simple search query- Parameters:
saveQuery
- true to save as user queryshareAllUsers
-
-
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 foradvancedPanel
row- Parameters:
row
- rowto
-- Returns:
- WEditor
-
getEditorComponent
Get editor component foradvancedPanel
row- 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_CLOSE
event -
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
-GridField
in
- 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:ValueChangeListener
On value change event- Specified by:
valueChange
in 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:
setVisible
in interfaceorg.zkoss.zk.ui.Component
- Overrides:
setVisible
in 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 foradvancedPanel
columns
-
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
-