use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WAccountDialog method initAccount.
// jbInit
/**
* Dyanmic Init.
* When a row is selected, the editor values are set
* (editors do not change grid)
* @return true if initialized
*/
private boolean initAccount() {
m_AD_Client_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "AD_Client_ID");
// Get AcctSchema Info
if (s_AcctSchema == null || s_AcctSchema.getC_AcctSchema_ID() != m_C_AcctSchema_ID)
s_AcctSchema = new MAcctSchema(Env.getCtx(), m_C_AcctSchema_ID, null);
log.config(s_AcctSchema.toString() + ", #" + s_AcctSchema.getAcctSchemaElements().length);
Env.setContext(Env.getCtx(), m_WindowNo, "C_AcctSchema_ID", m_C_AcctSchema_ID);
// Model
// Maintain Account Combinations
int AD_Window_ID = 153;
GridWindowVO wVO = AEnv.getMWindowVO(m_WindowNo, AD_Window_ID, 0);
if (wVO == null)
return false;
m_mWindow = new GridWindow(wVO);
m_mTab = m_mWindow.getTab(0);
// Make sure is the tab is loaded - teo_sarca [ 1659124 ]
if (!m_mTab.isLoadComplete())
m_mWindow.initTab(0);
// ParameterPanel restrictions
m_mTab.getField("Alias").setDisplayLength(15);
m_mTab.getField("Combination").setDisplayLength(15);
// Grid restrictions
m_mTab.getField("AD_Client_ID").setDisplayed(false);
m_mTab.getField("C_AcctSchema_ID").setDisplayed(false);
m_mTab.getField("IsActive").setDisplayed(false);
m_mTab.getField("IsFullyQualified").setDisplayed(false);
// don't show fields not being displayed in this environment
for (int i = 0; i < m_mTab.getFieldCount(); i++) {
GridField field = m_mTab.getField(i);
if (// check context
!field.isDisplayed(true))
field.setDisplayed(false);
}
// GridController
m_adTabPanel.init(null, m_WindowNo, m_mTab, null);
// Prepare Parameter
parameterLayout.makeNoStrip();
parameterLayout.setOddRowSclass("even");
parameterLayout.setParent(parameterPanel);
parameterLayout.setStyle("background-color: transparent;");
m_rows = new Rows();
m_rows.setParent(parameterLayout);
int TabNo = 0;
// Alias
if (s_AcctSchema.isHasAlias()) {
GridField alias = m_mTab.getField("Alias");
f_Alias = WebEditorFactory.getEditor(alias, false);
addLine(alias, f_Alias, false);
}
// Alias
// Combination
GridField combination = m_mTab.getField("Combination");
f_Combination = WebEditorFactory.getEditor(combination, false);
addLine(combination, f_Combination, false);
m_newRow = true;
/**
* Create Fields in Element Order
*/
MAcctSchemaElement[] elements = s_AcctSchema.getAcctSchemaElements();
for (int i = 0; i < elements.length; i++) {
MAcctSchemaElement ase = elements[i];
String type = ase.getElementType();
boolean isMandatory = ase.isMandatory();
//
if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Organization)) {
GridField field = m_mTab.getField("AD_Org_ID");
f_AD_Org_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_AD_Org_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Account)) {
GridField field = m_mTab.getField("Account_ID");
f_Account_ID = WebEditorFactory.getEditor(field, false);
// ((VLookup)f_Account_ID).setWidth(400);
addLine(field, f_Account_ID, isMandatory);
f_Account_ID.addValueChangeListener(this);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SubAccount)) {
GridField field = m_mTab.getField("C_SubAcct_ID");
f_SubAcct_ID = WebEditorFactory.getEditor(field, false);
// ((VLookup)f_SubAcct_ID).setWidth(400);
addLine(field, f_SubAcct_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Product)) {
GridField field = m_mTab.getField("M_Product_ID");
f_M_Product_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_M_Product_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_BPartner)) {
GridField field = m_mTab.getField("C_BPartner_ID");
f_C_BPartner_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_BPartner_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Campaign)) {
GridField field = m_mTab.getField("C_Campaign_ID");
f_C_Campaign_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_Campaign_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationFrom)) {
GridField field = m_mTab.getField("C_LocFrom_ID");
f_C_LocFrom_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_LocFrom_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_LocationTo)) {
GridField field = m_mTab.getField("C_LocTo_ID");
f_C_LocTo_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_LocTo_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Project)) {
GridField field = m_mTab.getField("C_Project_ID");
f_C_Project_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_Project_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_SalesRegion)) {
GridField field = m_mTab.getField("C_SalesRegion_ID");
f_C_SalesRegion_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_SalesRegion_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_OrgTrx)) {
GridField field = m_mTab.getField("AD_OrgTrx_ID");
f_AD_OrgTrx_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_AD_OrgTrx_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_Activity)) {
GridField field = m_mTab.getField("C_Activity_ID");
f_C_Activity_ID = WebEditorFactory.getEditor(field, false);
addLine(field, f_C_Activity_ID, isMandatory);
} else // User1
if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserList1)) {
GridField field = m_mTab.getField("User1_ID");
f_User1_ID = WebEditorFactory.getEditor(field, false);
// Change the label from the default to the user defined name
//f_User1_ID.setLabel(ase.getName());
addLine(field, f_User1_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserList2)) {
GridField field = m_mTab.getField("User2_ID");
f_User2_ID = WebEditorFactory.getEditor(field, false);
// Change the label from the default to the user defined name
//f_User2_ID.setLabel(ase.getName());
addLine(field, f_User2_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserList3)) {
GridField field = m_mTab.getField("User3_ID");
f_User3_ID = WebEditorFactory.getEditor(field, false);
// Change the label from the default to the user defined name
//f_User3_ID.setLabel(ase.getName());
addLine(field, f_User3_ID, isMandatory);
} else if (type.equals(MAcctSchemaElement.ELEMENTTYPE_UserList4)) {
GridField field = m_mTab.getField("User4_ID");
f_User4_ID = WebEditorFactory.getEditor(field, false);
// Change the label from the default to the user defined name
//f_User4_ID.setLabel(ase.getName());
addLine(field, f_User4_ID, isMandatory);
}
}
// Create Fields in Element Order
// Add description
m_newRow = true;
Row row = new Row();
f_Description.setStyle("font-decoration: italic;");
row.appendChild(f_Description);
row.setSpans("4");
row.setStyle("background-color: transparent;");
m_rows.appendChild(row);
// Finish
m_query = new MQuery();
m_query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID);
m_query.addRestriction("IsFullyQualified", MQuery.EQUAL, "Y");
if (m_mAccount.C_ValidCombination_ID == 0)
m_mTab.setQuery(MQuery.getEqualQuery("1", "2"));
else {
MQuery query = new MQuery();
query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID);
query.addRestriction("C_ValidCombination_ID", MQuery.EQUAL, m_mAccount.C_ValidCombination_ID);
m_mTab.setQuery(query);
}
m_mTab.query(false);
m_adTabPanel.getGridTab().addDataStatusListener(this);
m_adTabPanel.activate(true);
if (!m_adTabPanel.isGridView())
m_adTabPanel.switchRowPresentation();
statusBar.setStatusLine(s_AcctSchema.toString());
statusBar.setStatusDB("?");
// Initial value
if (m_mAccount.C_ValidCombination_ID != 0)
m_mTab.navigate(0);
log.config("fini");
return true;
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WEMailDialog method jbInit.
/**
* Static Init
*/
void jbInit() throws Exception {
lFrom.setValue(Msg.getMsg(Env.getCtx(), "From") + ":");
lTo.setValue(Msg.getMsg(Env.getCtx(), "To") + ":");
lCc.setValue(Msg.getMsg(Env.getCtx(), "Cc") + ":");
lSubject.setValue(Msg.getMsg(Env.getCtx(), "Subject") + ":");
lAttachment.setValue(Msg.getMsg(Env.getCtx(), "Attachment") + ":");
fFrom.setReadonly(true);
statusBar.setStatusDB(null);
//
Grid grid = new Grid();
grid.setWidth("480px");
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(lFrom);
row.appendChild(div);
row.appendChild(fFrom);
fFrom.setWidth("100%");
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lTo);
row.appendChild(div);
row.appendChild(fUser.getComponent());
fUser.getComponent().setWidth("100%");
row = new Row();
rows.appendChild(row);
row.appendChild(new Label(""));
row.appendChild(fTo);
fTo.setWidth("100%");
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lCc);
row.appendChild(div);
row.appendChild(fCcUser.getComponent());
fCcUser.getComponent().setWidth("100%");
row = new Row();
rows.appendChild(row);
row.appendChild(new Label(""));
row.appendChild(fCc);
fCc.setWidth("100%");
row = new Row();
rows.appendChild(row);
row.setSpans("2");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lSubject);
row.appendChild(div);
row.appendChild(fSubject);
fSubject.setWidth("100%");
row = new Row();
rows.appendChild(row);
row.setSpans("2");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(lAttachment);
row.appendChild(div);
row.appendChild(fAttachment);
fAttachment.setWidth("100%");
row = new Row();
rows.appendChild(row);
row.setSpans("2");
row.appendChild(fMessage);
fMessage.setWidth("100%");
fMessage.setRows(10);
row = new Row();
rows.appendChild(row);
row.setSpans("2");
row.appendChild(confirmPanel);
confirmPanel.addActionListener(this);
Borderlayout layout = new Borderlayout();
layout.setWidth("490px");
layout.setHeight("470px");
layout.setStyle("background-color: white; position: absolute;");
Center center = new Center();
center.appendChild(grid);
layout.appendChild(center);
center.setStyle("background-color: white");
South south = new South();
south.appendChild(statusBar);
layout.appendChild(south);
south.setStyle("background-color: white");
this.appendChild(layout);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WLocationDialog method init.
private void init() {
Row pnlAddress1 = new Row();
pnlAddress1.appendChild(lblAddress1.rightAlign());
pnlAddress1.appendChild(txtAddress1);
Row pnlAddress2 = new Row();
pnlAddress2.appendChild(lblAddress2.rightAlign());
pnlAddress2.appendChild(txtAddress2);
Row pnlAddress3 = new Row();
pnlAddress3.appendChild(lblAddress3.rightAlign());
pnlAddress3.appendChild(txtAddress3);
Row pnlAddress4 = new Row();
pnlAddress4.appendChild(lblAddress4.rightAlign());
pnlAddress4.appendChild(txtAddress4);
Row pnlCity = new Row();
pnlCity.appendChild(lblCity.rightAlign());
pnlCity.appendChild(txtCity);
Row pnlPostal = new Row();
pnlPostal.appendChild(lblPostal.rightAlign());
pnlPostal.appendChild(txtPostal);
Row pnlPostalAdd = new Row();
pnlPostalAdd.appendChild(lblPostalAdd.rightAlign());
pnlPostalAdd.appendChild(txtPostalAdd);
Row pnlRegion = new Row();
pnlRegion.appendChild(lblRegion.rightAlign());
pnlRegion.appendChild(lstRegion);
Row pnlCountry = new Row();
pnlCountry.appendChild(lblCountry.rightAlign());
pnlCountry.appendChild(lstCountry);
Panel pnlButtonLeft = new Panel();
pnlButtonLeft.appendChild(btnUrl);
pnlButtonLeft.setAlign("left");
Panel pnlButtonRight = new Panel();
pnlButtonRight.appendChild(btnCancel);
pnlButtonRight.appendChild(btnOk);
pnlButtonRight.setWidth("100%");
pnlButtonRight.setStyle("text-align:right");
Hbox hboxButton = new Hbox();
hboxButton.appendChild(pnlButtonLeft);
hboxButton.appendChild(pnlButtonRight);
hboxButton.setWidth("100%");
this.appendChild(mainPanel);
this.appendChild(hboxButton);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WCreateFromRMAUI method zkInit.
// dynInit
/**
* Init ZK
* @throws Exception
*/
protected void zkInit() throws Exception {
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
Borderlayout parameterLayout = new Borderlayout();
parameterLayout.setHeight("120px");
parameterLayout.setWidth("100%");
Panel parameterPanel = v_CreateFromPanel.getParameterPanel();
parameterPanel.appendChild(parameterLayout);
Grid parameterStdLayout = GridFactory.newGridLayout();
Panel parameterStdPanel = new Panel();
parameterStdPanel.appendChild(parameterStdLayout);
Center center = new Center();
parameterLayout.appendChild(center);
center.appendChild(parameterStdPanel);
Rows rows = (Rows) parameterStdLayout.newRows();
Row row = rows.newRow();
row.appendChild(bPartnerLabel.rightAlign());
if (bPartnerField != null)
row.appendChild(bPartnerField.getComponent());
// Add to Main
v_CreateFromPanel.setWidth("100%");
v_CreateFromPanel.setHeight("100%");
v_Container.appendChild(v_CreateFromPanel);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WCreateFromInvoiceUI method zkInit.
// dynInit
/**
* Init ZK
* @throws Exception
*/
protected void zkInit() throws Exception {
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));
shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", false));
rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
Borderlayout parameterLayout = new Borderlayout();
parameterLayout.setHeight("110px");
parameterLayout.setWidth("100%");
Panel parameterPanel = v_CreateFromPanel.getParameterPanel();
parameterPanel.appendChild(parameterLayout);
Grid parameterStdLayout = GridFactory.newGridLayout();
Panel parameterStdPanel = new Panel();
parameterStdPanel.appendChild(parameterStdLayout);
Center center = new Center();
parameterLayout.appendChild(center);
center.appendChild(parameterStdPanel);
Rows rows = (Rows) parameterStdLayout.newRows();
Row row = rows.newRow();
row.appendChild(bPartnerLabel.rightAlign());
if (bPartnerField != null)
row.appendChild(bPartnerField.getComponent());
row.appendChild(orderLabel.rightAlign());
row.appendChild(orderField);
row = rows.newRow();
row.appendChild(new Space());
row.appendChild(new Space());
row.appendChild(shipmentLabel.rightAlign());
row.appendChild(shipmentField);
// Add RMA document selection to panel
row = rows.newRow();
row.appendChild(new Space());
row.appendChild(new Space());
row.appendChild(rmaLabel.rightAlign());
row.appendChild(rmaField);
// Add to Main
v_CreateFromPanel.setWidth("100%");
v_CreateFromPanel.setHeight("100%");
v_Container.appendChild(v_CreateFromPanel);
}
Aggregations