* merge revision 6488-6489 from branches/adempiere341

This commit is contained in:
Heng Sin Low 2008-09-21 01:04:27 +00:00
parent ea02e06671
commit 2605bb1a79
3 changed files with 15 additions and 13 deletions

View File

@ -184,7 +184,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
{ {
getComponent().setText(vad.getM_AttributeSetInstanceName()); getComponent().setText(vad.getM_AttributeSetInstanceName());
M_AttributeSetInstance_ID = vad.getM_AttributeSetInstance_ID(); M_AttributeSetInstance_ID = vad.getM_AttributeSetInstance_ID();
if (m_GridTab != null && !productWindow) if (m_GridTab != null && !productWindow && vad.getM_Locator_ID() > 0)
m_GridTab.setValue("M_Locator_ID", vad.getM_Locator_ID()); m_GridTab.setValue("M_Locator_ID", vad.getM_Locator_ID());
changed = true; changed = true;
} }

View File

@ -581,8 +581,7 @@ DataStatusListener, ValueChangeListener, IADTabpanel
public void query (boolean onlyCurrentRows, int onlyCurrentDays, int maxRows) public void query (boolean onlyCurrentRows, int onlyCurrentDays, int maxRows)
{ {
// gridTab.query(onlyCurrentRows, onlyCurrentDays, maxRows); gridTab.query(onlyCurrentRows, onlyCurrentDays, maxRows);
gridTab.query(false);
} }
public GridTab getGridTab() public GridTab getGridTab()

View File

@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
@ -63,7 +64,6 @@ import org.zkoss.zk.ui.event.Events;
import org.zkoss.zkex.zul.Borderlayout; import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center; import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.South; import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Menupopup; import org.zkoss.zul.Menupopup;
import org.zkoss.zul.impl.InputElement; import org.zkoss.zul.impl.InputElement;
@ -432,12 +432,8 @@ public class WPAttributeDialog extends Window implements EventListener
if (attribute.getDescription() != null) if (attribute.getDescription() != null)
label.setTooltiptext(attribute.getDescription()); label.setTooltiptext(attribute.getDescription());
Row row = new Row(); Row row = rows.newRow();
row.setParent(rows); row.appendChild(label.rightAlign());
Div div = new Div();
div.setStyle("text-align: right");
div.appendChild(label);
row.appendChild(div);
// //
MAttributeInstance instance = attribute.getMAttributeInstance (m_M_AttributeSetInstance_ID); MAttributeInstance instance = attribute.getMAttributeInstance (m_M_AttributeSetInstance_ID);
if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attribute.getAttributeValueType())) if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attribute.getAttributeValueType()))
@ -479,7 +475,7 @@ public class WPAttributeDialog extends Window implements EventListener
{ {
// VNumber editor = new VNumber(attribute.getName(), attribute.isMandatory(), // VNumber editor = new VNumber(attribute.getName(), attribute.isMandatory(),
// false, true, DisplayType.Number, attribute.getName()); // false, true, DisplayType.Number, attribute.getName());
NumberBox editor = new NumberBox(true); NumberBox editor = new NumberBox(false);
if (instance != null) if (instance != null)
editor.setValue(instance.getValueNumber()); editor.setValue(instance.getValueNumber());
else else
@ -677,6 +673,8 @@ public class WPAttributeDialog extends Window implements EventListener
((InputElement)editor).setReadonly(!rw); ((InputElement)editor).setReadonly(!rw);
else if (editor instanceof Listbox) else if (editor instanceof Listbox)
((Listbox)editor).setEnabled(rw); ((Listbox)editor).setEnabled(rw);
else if (editor instanceof NumberBox)
((NumberBox)editor).setEnabled(rw);
} }
} // cmd_newEdit } // cmd_newEdit
@ -741,7 +739,8 @@ public class WPAttributeDialog extends Window implements EventListener
if (!m_productWindow && as.isGuaranteeDate()) if (!m_productWindow && as.isGuaranteeDate())
{ {
log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue());
Timestamp ts = (Timestamp)fieldGuaranteeDate.getValue(); Date gDate = fieldGuaranteeDate.getValue();
Timestamp ts = gDate != null ? new Timestamp(gDate.getTime()) : null;
m_masi.setGuaranteeDate(ts); m_masi.setGuaranteeDate(ts);
if (as.isGuaranteeDateMandatory() && ts == null) if (as.isGuaranteeDateMandatory() && ts == null)
mandatory += " - " + Msg.translate(Env.getCtx(), "GuaranteeDate"); mandatory += " - " + Msg.translate(Env.getCtx(), "GuaranteeDate");
@ -764,7 +763,8 @@ public class WPAttributeDialog extends Window implements EventListener
if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributes[i].getAttributeValueType())) if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributes[i].getAttributeValueType()))
{ {
Listbox editor = (Listbox)m_editors.get(i); Listbox editor = (Listbox)m_editors.get(i);
MAttributeValue value = (MAttributeValue)editor.getSelectedItem().getValue(); ListItem item = editor.getSelectedItem();
MAttributeValue value = item != null ? (MAttributeValue)item.getValue() : null;
log.fine(attributes[i].getName() + "=" + value); log.fine(attributes[i].getName() + "=" + value);
if (attributes[i].isMandatory() && value == null) if (attributes[i].isMandatory() && value == null)
mandatory += " - " + attributes[i].getName(); mandatory += " - " + attributes[i].getName();
@ -777,6 +777,9 @@ public class WPAttributeDialog extends Window implements EventListener
log.fine(attributes[i].getName() + "=" + value); log.fine(attributes[i].getName() + "=" + value);
if (attributes[i].isMandatory() && value == null) if (attributes[i].isMandatory() && value == null)
mandatory += " - " + attributes[i].getName(); mandatory += " - " + attributes[i].getName();
//setMAttributeInstance doesn't work without decimal point
if (value != null && value.scale() == 0)
value = value.setScale(1);
attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value);
} }
else else