0

ListBox CEll Rendrer ?

asked 2009-03-26 06:20:22 +0800

waliahimanshu gravatar image waliahimanshu
36 2

i have created table as
try
{
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
pstmt.setInt(1, m_C_Order_ID);
pstmt.setInt(2, m_Ad_Client_ID);

ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
Vector<Object> line = new Vector<Object>();
line.add(new Boolean(false)); // 0-Selection
int C_orderLine_id = rs.getInt(1);
Integer lineno = rs.getInt(2);
KeyNamePair pp = new KeyNamePair(C_orderLine_id, lineno.toString());
line.add(pp); // 1-line (ID+lineno)
line.add(rs.getBigDecimal(3)); // 2-QtyEntered
line.add(rs.getString(4)); // 3-UOM
line.add(rs.getBigDecimal(5)); // 4-PriceEntered
line.add(rs.getString(6)); // 5-VendorProductNo
line.add(rs.getBigDecimal(7)); // 6- taxrate
line.add(rs.getBigDecimal(8)); // 7-LineNetAmt
data.add(line);
}
rs.close();
pstmt.close();
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql.toString(), e);
}

// Remove previous listeners
orderLineTable.getModel().removeTableModelListener(this);
// Header Info

columnNames = new Vector<String>();
columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
columnNames.add(Msg.translate(Env.getCtx(), "Line"));
columnNames.add(Util.cleanAmp(Msg.translate(Env.getCtx(), "QtyEntered")));
columnNames.add(Msg.getMsg(Env.getCtx(), "C_UOM_ID"));
columnNames.add(Msg.translate(Env.getCtx(), "PriceEntered"));

columnNames.add(Msg.getMsg(Env.getCtx(), "VendorProductNo"));
columnNames.add(Msg.getMsg(Env.getCtx(), "C_Tax_ID"));
columnNames.add(Msg.getMsg(Env.getCtx(), "LineNetAmt"));
columnNames.add(Msg.getMsg(Env.getCtx(), "Save"));
columnNames.add(Msg.getMsg(Env.getCtx(), "Delete"));
//columnNames.setSize(20);
// Set Model
ListModelTable modelI = new ListModelTable(data);
modelI.addTableModelListener(this);
orderLineTable.setData(modelI, columnNames);
//


how to add componenmt at a sepecified Cell

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-04-01 03:06:34 +0800

hideokidd gravatar image hideokidd
750 1 2

updated 2009-04-01 03:06:53 +0800

Hi,

Maybe you need a render to make the listbox,
there is an article which talks about similar issue,
http://docs.zkoss.org/wiki/Live_Data%2C_Paging%2C_setModel_and_Implement_your_own_renderer#Two-Columns_Example_:_User_defined_renderer
in your case that would be ListitemRenderer.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-03-26 06:20:22 +0800

Seen: 313 times

Last updated: Apr 01 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More