Blackberry ListField:如何添加列表行单击监听器
假设我有一个有 10 个 ListField 的 Screen 类:
Vector v_prj_title,v_prj_mgr
// v_prj_title contains name of projects
// v_prj_mgr contains name of the project_manager of v_prj_title sequentially.
//Vector send_vector
//ListField myList
//ListCallBack callback
//It is clear from the code that in myList, I m inserting a vector send_vector ie callback.insert(send_vector,i), which contains 2 strings collected one from v_prj_title and other from v_prj_mgr.
for(int i=0;i<10;i++)
{
myList.insert(i);
t1 = v_prj_title.elementAt(i).toString();
send_vector = new Vector(2);
send_vector.addElement(t1);
t2 = v_prj_mgr.elementAt(i).toString();
send_vector.addElement(t2);
callback.insert(send_vector,i);
}
现在我很困惑如何将 eventListener 添加到特定的 ListField,例如假设如果我单击第三个 ListField,(假设这是下面显示的数据)位图图片应该显示在第三个 ListField 和项目名称 (Project_Social_Meeting) 和项目经理 (Tom Clerk) 应插入数据库 (SQlLite)
1. a. Project_Chat_Master( project name) b. Vyom Ryan (project manager) 2. a. Project_Online_Gaming b. Vivek Roy 3. a. Project_Social_Meeting b. Tom Clerk . . etc.....
Suppose i had a Screen class that has 10 ListField:
Vector v_prj_title,v_prj_mgr
// v_prj_title contains name of projects
// v_prj_mgr contains name of the project_manager of v_prj_title sequentially.
//Vector send_vector
//ListField myList
//ListCallBack callback
//It is clear from the code that in myList, I m inserting a vector send_vector ie callback.insert(send_vector,i), which contains 2 strings collected one from v_prj_title and other from v_prj_mgr.
for(int i=0;i<10;i++)
{
myList.insert(i);
t1 = v_prj_title.elementAt(i).toString();
send_vector = new Vector(2);
send_vector.addElement(t1);
t2 = v_prj_mgr.elementAt(i).toString();
send_vector.addElement(t2);
callback.insert(send_vector,i);
}
Now I'm getting confused how to add eventListener to particular ListField, e.g. suppose if I click the 3rd ListField,(suppose this is the displayed data below) a bitmap picture should be displayed in the 3rd ListField and the name of the project (Project_Social_Meeting) and project_manager (Tom Clerk) should be inserted into database (SQlLite)
1. a. Project_Chat_Master( project name) b. Vyom Ryan (project manager) 2. a. Project_Online_Gaming b. Vivek Roy 3. a. Project_Social_Meeting b. Tom Clerk . . etc.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的要求创建一个 CustomField/Manager。(可能包含图像/字符串/...)
,然后将它们添加到回调方法中,
例如:
步骤:1
步骤 2:
//创建列表项
第3步:
create a CustomField/Manager depending on your requirement.(which may contain images/strings/...)
then add them to the callback method
Ex:
step:1
step-2:
//create list items
step-3: