use of org.adempiere.webui.component.Rows in project adempiere by adempiere.
the class WStocktake method zkInit.
// init
/**
* Static Init
* @throws Exception
*/
void zkInit() throws Exception {
form.appendChild(mainPanel);
mainPanel.setStyle("width: 99%; height: 100%; border: none; padding: 0; margin: 0");
mainPanel.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
parameterPanel.appendChild(parameterLayout);
//
inventoryLabel.setText(Msg.translate(Env.getCtx(), "M_Inventory_ID"));
locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
productLabel.setText(Msg.translate(Env.getCtx(), "M_Product_ID"));
lineFLabel.setText(Msg.translate(Env.getCtx(), "Line") + " " + Msg.translate(Env.getCtx(), "From"));
lineTLabel.setText(Msg.translate(Env.getCtx(), "Line") + " " + Msg.translate(Env.getCtx(), "To"));
aislexLabel.setText(Msg.translate(Env.getCtx(), "X"));
//
North north = new North();
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
Rows rows = parameterLayout.newRows();
Row row = rows.newRow();
row.appendChild(inventoryLabel.rightAlign());
row.appendChild(inventoryField.getComponent());
row.appendChild(lineFLabel.rightAlign());
row.appendChild(lineFField.getComponent());
row.appendChild(lineTLabel.rightAlign());
row.appendChild(lineTField.getComponent());
row.appendChild(secondCount);
row = rows.newRow();
row.appendChild(aislexLabel.rightAlign());
row.appendChild(aislexField.getComponent());
row.appendChild(productLabel.rightAlign());
row.appendChild(productField.getComponent());
row.appendChild(locatorLabel.rightAlign());
row.appendChild(locatorField.getComponent());
//
secondCount.setText(Msg.getMsg(Env.getCtx(), "Second Count"));
secondCount.addActionListener(this);
confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setLabel(Msg.translate(Env.getCtx(), "CountEntered"));
southPanel.appendChild(confirmPanel);
southPanel.appendChild(new Separator());
southPanel.appendChild(statusBar);
South south = new South();
south.setStyle("border: none");
mainLayout.appendChild(south);
south.appendChild(southPanel);
LayoutUtils.addSclass("status-border", statusBar);
}
use of org.adempiere.webui.component.Rows in project adempiere by adempiere.
the class WTrxMaterial method zkInit.
// init
/**
* Static Init
* @throws Exception
*/
void zkInit() throws Exception {
form.appendChild(mainPanel);
mainPanel.setStyle("width: 99%; height: 100%; border: none; padding: 0; margin: 0");
mainPanel.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
parameterPanel.appendChild(parameterLayout);
//
orgLabel.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
productLabel.setText(Msg.translate(Env.getCtx(), "Product"));
dateFLabel.setText(Msg.translate(Env.getCtx(), "DateFrom"));
dateTLabel.setText(Msg.translate(Env.getCtx(), "DateTo"));
mtypeLabel.setText(Msg.translate(Env.getCtx(), "MovementType"));
//
North north = new North();
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
Rows rows = parameterLayout.newRows();
Row row = rows.newRow();
row.appendChild(orgLabel.rightAlign());
row.appendChild(orgField.getComponent());
row.appendChild(mtypeLabel.rightAlign());
row.appendChild(mtypeField.getComponent());
row.appendChild(dateFLabel.rightAlign());
row.appendChild(dateFField.getComponent());
row = rows.newRow();
row.appendChild(locatorLabel.rightAlign());
row.appendChild(locatorField.getComponent());
row.appendChild(productLabel.rightAlign());
row.appendChild(productField.getComponent());
row.appendChild(dateTLabel.rightAlign());
row.appendChild(dateTField.getComponent());
//
southPanel.appendChild(confirmPanel);
southPanel.appendChild(new Separator());
southPanel.appendChild(statusBar);
South south = new South();
south.setStyle("border: none");
mainLayout.appendChild(south);
south.appendChild(southPanel);
LayoutUtils.addSclass("status-border", statusBar);
}
use of org.adempiere.webui.component.Rows in project adempiere by adempiere.
the class WWFActivity method init.
private void init() {
Grid grid = new Grid();
grid.setWidth("100%");
grid.setHeight("100%");
grid.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center;");
grid.makeNoStrip();
grid.setOddRowSclass("even");
Rows rows = new Rows();
grid.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
Div div = new Div();
div.setAlign("right");
div.appendChild(lNode);
row.appendChild(div);
row.appendChild(fNode);
fNode.setWidth("100%");
fNode.setReadonly(true);
row = new Row();
rows.appendChild(row);
row.setValign("top");
div = new Div();
div.setAlign("right");
div.appendChild(lDesctiption);
row.appendChild(div);
row.appendChild(fDescription);
fDescription.setMultiline(true);
fDescription.setWidth("100%");
fDescription.setReadonly(true);
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lHelp);
row.appendChild(div);
row.appendChild(fHelp);
fHelp.setMultiline(true);
fHelp.setWidth("100%");
fHelp.setReadonly(true);
fHelp.setRows(3);
row.appendChild(new Label());
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lHistory);
row.appendChild(div);
row.appendChild(fHistory);
row.appendChild(new Label());
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lAnswer);
row.appendChild(div);
Hbox hbox = new Hbox();
hbox.appendChild(fAnswerText);
hbox.appendChild(fAnswerList);
hbox.appendChild(fAnswerButton);
fAnswerButton.addEventListener(Events.ON_CLICK, this);
row.appendChild(hbox);
row.appendChild(bZoom);
bZoom.addEventListener(Events.ON_CLICK, this);
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lTextMsg);
row.appendChild(div);
row.appendChild(fTextMsg);
fTextMsg.setMultiline(true);
fTextMsg.setWidth("100%");
row.appendChild(new Label());
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lForward);
row.appendChild(div);
hbox = new Hbox();
hbox.appendChild(fForward.getComponent());
hbox.appendChild(lOptional);
row.appendChild(hbox);
row.appendChild(bOK);
bOK.addEventListener(Events.ON_CLICK, this);
Borderlayout layout = new Borderlayout();
layout.setWidth("100%");
layout.setHeight("100%");
layout.setStyle("background-color: transparent; position: absolute;");
North north = new North();
north.appendChild(listbox);
north.setSplittable(true);
north.setHflex("true");
//north.setVflex("true");
north.setHeight("50%");
layout.appendChild(north);
north.setStyle("background-color: transparent");
listbox.addEventListener(Events.ON_SELECT, this);
Center center = new Center();
center.appendChild(grid);
layout.appendChild(center);
center.setStyle("background-color: transparent");
center.setHflex("true");
center.setVflex("true");
South south = new South();
south.appendChild(statusBar);
layout.appendChild(south);
south.setStyle("background-color: transparent");
this.appendChild(layout);
this.setStyle("height: 100%; width: 100%; position: absolute;");
}
use of org.adempiere.webui.component.Rows in project adempiere by adempiere.
the class WPAttributeDialog method initAttributes.
// init
/**
* Dyanmic Init.
* @return true if initialized
*/
private boolean initAttributes() {
Rows rows = new Rows();
rows.setParent(centerLayout);
if (m_M_Product_ID == 0 && !m_productWindow)
return false;
MAttributeSet as = null;
if (m_M_Product_ID != 0) {
// Get Model
m_product = MProduct.get(Env.getCtx(), m_M_Product_ID);
if (m_product.getM_AttributeSetInstance_ID() > 0) {
m_productASI = true;
// The product has an instance associated with it.
if (m_M_AttributeSetInstance_ID != m_product.getM_AttributeSetInstance_ID()) {
log.fine("Different ASI than what is specified on Product!");
}
} else {
// Only show product attributes when in the product window.
m_productASI = m_productWindow;
}
m_masi = MAttributeSetInstance.get(Env.getCtx(), m_M_AttributeSetInstance_ID, m_M_Product_ID);
if (m_masi == null) {
log.severe("No Model for M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + ", M_Product_ID=" + m_M_Product_ID);
return false;
}
Env.setContext(Env.getCtx(), m_WindowNo, "M_AttributeSet_ID", m_masi.getM_AttributeSet_ID());
// Get Attribute Set
as = m_masi.getMAttributeSet();
} else {
int M_AttributeSet_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, "M_AttributeSet_ID");
m_masi = new MAttributeSetInstance(Env.getCtx(), 0, M_AttributeSet_ID, null);
as = m_masi.getMAttributeSet();
}
// Product has no Attribute Set
if (as == null) {
FDialog.error(m_WindowNo, this, "PAttributeNoAttributeSet");
return false;
}
// always read/write. The two are exclusive and can't co-exists.
if (// Set Instance Attributes and dialog controls
!m_productWindow || !m_productASI) {
if (// Instance attributes possible. Set up controls.
!m_productASI) {
Row row = new Row();
// New/Edit - Selection
if (// new
m_M_AttributeSetInstance_ID == 0)
cbNewEdit.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "NewRecord")));
else
cbNewEdit.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "EditRecord")));
cbNewEdit.addEventListener(Events.ON_CHECK, this);
row.appendChild(cbNewEdit);
bSelect.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "SelectExisting")));
bSelect.setImage(ServletFns.resolveThemeURL("~./images/PAttribute16.png"));
bSelect.addEventListener(Events.ON_CLICK, this);
row.appendChild(bSelect);
rows.appendChild(row);
}
// Add the Instance Attributes if any. If its a product attribute set
// this will do nothing.
// True = Instances
MAttribute[] attributes = as.getMAttributes(true);
log.fine("Instance Attributes=" + attributes.length);
for (int i = 0; i < attributes.length; i++) addAttributeLine(rows, attributes[i], false, false);
}
// Product attributes can be shown in any window but are read/write in the Product window only.
// This will do nothing if it is an instance attribute set.
// False = products
MAttribute[] attributes = as.getMAttributes(false);
log.fine("Product Attributes=" + attributes.length);
for (int i = 0; i < attributes.length; i++) addAttributeLine(rows, attributes[i], true, !m_productWindow);
// Lot
if ((!m_productWindow || !m_productASI) && as.isLot()) {
Row row = new Row();
row.setParent(rows);
m_row++;
Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "Lot")));
row.appendChild(label);
row.appendChild(fieldLotString);
fieldLotString.setText(m_masi.getLot());
// M_Lot_ID
// int AD_Column_ID = 9771; // M_AttributeSetInstance.M_Lot_ID
// fieldLot = new VLookup ("M_Lot_ID", false,false, true,
// MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir));
String sql = "SELECT M_Lot_ID, Name " + "FROM M_Lot l " + "WHERE EXISTS (SELECT M_Product_ID FROM M_Product p " + "WHERE p.M_AttributeSet_ID=" + m_masi.getM_AttributeSet_ID() + " AND p.M_Product_ID=l.M_Product_ID)";
fieldLot = new Listbox();
fieldLot.setMold("select");
KeyNamePair[] keyNamePairs = DB.getKeyNamePairs(sql, true);
for (KeyNamePair pair : keyNamePairs) {
fieldLot.appendItem(pair.getName(), pair.getKey());
}
label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "M_Lot_ID")));
row = new Row();
row.setParent(rows);
m_row++;
row.appendChild(label);
row.appendChild(fieldLot);
if (m_masi.getM_Lot_ID() != 0) {
for (int i = 1; i < fieldLot.getItemCount(); i++) {
ListItem pp = fieldLot.getItemAtIndex(i);
if ((Integer) pp.getValue() == m_masi.getM_Lot_ID()) {
fieldLot.setSelectedIndex(i);
fieldLotString.setReadonly(true);
break;
}
}
}
fieldLot.addEventListener(Events.ON_SELECT, this);
// New Lot Button
if (m_masi.getMAttributeSet().getM_LotCtl_ID() != 0) {
if (MRole.getDefault().isTableAccess(MLot.Table_ID, false) && MRole.getDefault().isTableAccess(MLotCtl.Table_ID, false) && !m_masi.isExcludeLot(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) {
row = new Row();
row.setParent(rows);
m_row++;
row.appendChild(bLot);
bLot.addEventListener(Events.ON_CLICK, this);
}
}
// Popup
// fieldLot.addMouseListener(new VPAttributeDialog_mouseAdapter(this)); // popup
mZoom = new Menuitem(Msg.getMsg(Env.getCtx(), "Zoom"), ServletFns.resolveThemeURL("~./images/Zoom16.png"));
mZoom.addEventListener(Events.ON_CLICK, this);
popupMenu.appendChild(mZoom);
this.appendChild(popupMenu);
}
// SerNo
if ((!m_productWindow || !m_productASI) && as.isSerNo()) {
Row row = new Row();
row.setParent(rows);
m_row++;
Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "SerNo")));
row.appendChild(label);
row.appendChild(fieldSerNo);
fieldSerNo.setText(m_masi.getSerNo());
// New SerNo Button
if (m_masi.getMAttributeSet().getM_SerNoCtl_ID() != 0) {
if (MRole.getDefault().isTableAccess(MSerNoCtl.Table_ID, false) && !m_masi.isExcludeSerNo(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) {
row = new Row();
row.setParent(rows);
m_row++;
row.appendChild(bSerNo);
bSerNo.addEventListener(Events.ON_CLICK, this);
}
}
}
// GuaranteeDate
if ((!m_productWindow || !m_productASI) && as.isGuaranteeDate()) {
Row row = new Row();
row.setParent(rows);
m_row++;
Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "GuaranteeDate")));
if (m_M_AttributeSetInstance_ID == 0)
fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate(true));
else
fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate());
row.appendChild(label);
row.appendChild(fieldGuaranteeDate);
}
if (m_row == 0) {
FDialog.error(m_WindowNo, this, "PAttributeNoInfo");
return false;
}
// New/Edit Window
if (!m_productWindow) {
cbNewEdit.setChecked(m_M_AttributeSetInstance_ID == 0);
cmd_newEdit();
}
// Attrribute Set Instance Description
Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "Description")));
// label.setLabelFor(fieldDescription);
fieldDescription.setText(m_masi.getDescription());
fieldDescription.setReadonly(true);
Row row = new Row();
row.setParent(rows);
row.appendChild(label);
row.appendChild(fieldDescription);
return true;
}
use of org.adempiere.webui.component.Rows in project adempiere by adempiere.
the class WAssignmentDialog method init.
/**
* Static Init
* @throws Exception
*/
private void init() throws Exception {
fResource.setMold("select");
fResource.addEventListener(Events.ON_SELECT, this);
delete.addEventListener(Events.ON_CLICK, this);
confirmPanel.addComponentsLeft(delete);
confirmPanel.addActionListener(Events.ON_CLICK, this);
//
this.appendChild(mainPanel);
mainPanel.makeNoStrip();
mainPanel.setStyle("background-color: transparent");
Rows rows = new Rows();
mainPanel.appendChild(rows);
Row row = new Row();
row.appendChild(ThemeUtils.makeRightAlign(lResource));
row.appendChild(fResource);
row.appendChild(new Label(" "));
rows.appendChild(row);
row = new Row();
row.setSpans("1, 2");
row.appendChild(ThemeUtils.makeRightAlign(lDate));
Div div = new Div();
div.appendChild(fDateFrom);
div.appendChild(fTimeFrom);
fTimeFrom.setStyle("margin-left: 1px");
row.appendChild(div);
rows.appendChild(row);
row = new Row();
row.appendChild(ThemeUtils.makeRightAlign(lQty));
row.appendChild(fQty);
row.appendChild(lUOM);
rows.appendChild(row);
row = new Row();
row.setSpans("1, 2");
row.appendChild(ThemeUtils.makeRightAlign(lName));
row.appendChild(fName);
fName.setStyle("width: 100%");
rows.appendChild(row);
row = new Row();
row.setSpans("1, 2");
row.appendChild(ThemeUtils.makeRightAlign(lDescription));
row.appendChild(fDescription);
fDescription.setMultiline(true);
fDescription.setRows(3);
fDescription.setStyle("width: 100%");
rows.appendChild(row);
row = new Row();
row.setSpans("3");
row.appendChild(new Label(" "));
rows.appendChild(row);
row = new Row();
row.setSpans("3");
row.appendChild(confirmPanel);
rows.appendChild(row);
//
}
Aggregations