diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 5d0a29ae95..515ac989e2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -94,7 +94,6 @@ import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; -import org.compiere.util.SecureEngine; import org.compiere.util.Util; import org.compiere.util.ValueNamePair; import org.zkoss.zk.au.out.AuFocus; @@ -351,6 +350,10 @@ public class FindWindow extends Window implements EventListener, ValueCha btnNew.setId("btnNew"); btnNew.addEventListener(Events.ON_CLICK,this); + Button btnClear = ButtonFactory.createNamedButton(ConfirmPanel.A_RESET); + btnClear.setId("btnReset"); + btnClear.addEventListener(Events.ON_CLICK,this); + Button btnOk = ButtonFactory.createNamedButton(ConfirmPanel.A_OK); btnOk.setName("btnOkSimple"); btnOk.setId("btnOk"); @@ -361,6 +364,7 @@ public class FindWindow extends Window implements EventListener, ValueCha btnCancel.addEventListener(Events.ON_CLICK,this); Panel pnlButtonRight = new Panel(); + pnlButtonRight.appendChild(btnClear); pnlButtonRight.appendChild(btnOk); pnlButtonRight.appendChild(btnCancel); pnlButtonRight.setStyle("text-align:right"); @@ -671,7 +675,7 @@ public class FindWindow extends Window implements EventListener, ValueCha mField.getVO().FieldLength = 32767; // a conservative max literal string - like oracle extended mField.getVO().DisplayLength = mField.getVO().FieldLength; } - if (mField.getVO().displayType == DisplayType.YesNo) { + if (mField.getVO().displayType == DisplayType.YesNo || mField.isEncrypted()) { // Make Yes-No searchable as list GridFieldVO vo = mField.getVO(); GridFieldVO ynvo = vo.clone(m_simpleCtx, vo.WindowNo, vo.TabNo, vo.AD_Window_ID, vo.AD_Tab_ID, vo.tabReadOnly); @@ -1136,7 +1140,8 @@ public class FindWindow extends Window implements EventListener, ValueCha editor.addValueChangeListener(this); Label label = editor.getLabel(); Component fieldEditor = editor.getComponent(); - + //Fix miss lable of checkbox + label.setValue(mField.getHeader()); // if (displayLength > 0) // set it back mField.setDisplayLength(displayLength); @@ -1359,6 +1364,21 @@ public class FindWindow extends Window implements EventListener, ValueCha m_isCancel = false; dispose(); } + else if ("btnReset".equals(btn.getName())){ + for (WEditor clearField : m_sEditors){ + clearField.setValue(null); + } + + for (WEditor clearField : m_sEditorsTo){ + if (clearField != null){ + clearField.setValue(null); + clearField.setVisible(false); + + ToolBarButton moreButtor = m_sEditorsFlag.get(m_sEditorsTo.indexOf(clearField)); + moreButtor.setChecked(false); + } + } + } } } else if (Events.ON_OK.equals(event.getName())) @@ -1789,13 +1809,22 @@ public class FindWindow extends Window implements EventListener, ValueCha // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results GridField field = getTargetMField(ColumnName); - // add encryption here if the field is encrypted. - if (field.isEncryptedColumn()) { - value = SecureEngine.encrypt(value, Env.getAD_Client_ID(Env.getCtx())); - } boolean isProductCategoryField = isProductCategoryField(field.getColumnName()); StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); + + // add encryption here if the field is encrypted. + if (field.isEncrypted()) { + String Operator = MQuery.NULL; + if ("Y".equals(value)){ + Operator = MQuery.NOT_NULL; + } + m_query.addRestriction(ColumnSQL.toString(), Operator, null, + ColumnName, wed.getDisplay()); + appendCode(code, ColumnName, Operator, "", "", "AND", "", ""); + continue; + } + // // Be more permissive for String columns if (isSearchLike(field))