RadiobuttonField Super 带有标签、值和组
我是 Java 和 Blackberry 的新手,由于以下原因,我被困在注册屏幕上:
我有一个注册屏幕,其中显示 2 个单选按钮,男性和女性。只有这些“标签”不是由我编写的,它是我向网络服务请求的值和标签。 我需要的是这样的:
MyRadioButton rb1=(String label, String value, Group rbg);
它是 Super(label, value, group); ---这个值更多的是一个内部标签 ID,可以说是一个 pk_id.---
这样我就可以在之后检索选择了哪个 Rbutton 及其值,这样当我单击“注册”按钮时我可以将其发送回来。
我有一个如何执行此操作的示例,但不适用于黑莓:
Gender[] gender = WebServCall.GetUserGender();
if (gender != null && gender.length == 2)
{
holder.radiob1.setText(gender[0].genderType);
holder.radiob1.setTag(gender[0].PK_ID);
holder.radiob2.setText(gender[1].genderType);
holder.radiob2.setTag(gender[1].PK_ID);
}
else
{
//alert
}
}
static class ViewHolder
{
RadioButton radiob1;
RadioButton radiob2;
}
(...)
//由用户获取插入的信息
... RadioButton register_buffer_Gender1 = (RadioButton) findViewById(R.id.radiob1); RadioButton register_buffer_Gender2 = (RadioButton) findViewById(R.id.radiob2);
... 布尔值 check1 = register_buffer_Gender1.isChecked(); 布尔值 check2 = register_buffer_Gender2.isChecked();
....
您能否举例说明如何做到这一点,但对于黑莓手机?
谢谢
I'm new to Java and Blackberry and i'm stuck with a registration screen, due to the fallowing:
I have a registration screen, where i show 2 radiobuttons, male and female. Only these 'labels' are not for me to write, it's a value and a tag that i request to a webservice.
What i needed was something like:
MyRadioButton rb1=(String label, String value, Group rbg);
and it's Super(label, value, group); ---this value more of an internal label ID, so to speak, a pk_id.---
so i could, after, retrieve which Rbutton was selected and it's value, so i could send it back when i click the Register Button.
I have an example of how to do it, but not for blackberry:
Gender[] gender = WebServCall.GetUserGender();
if (gender != null && gender.length == 2)
{
holder.radiob1.setText(gender[0].genderType);
holder.radiob1.setTag(gender[0].PK_ID);
holder.radiob2.setText(gender[1].genderType);
holder.radiob2.setTag(gender[1].PK_ID);
}
else
{
//alert
}
}
static class ViewHolder
{
RadioButton radiob1;
RadioButton radiob2;
}
(...)
//Get the inserted information, by the user
...
RadioButton register_buffer_Gender1 = (RadioButton) findViewById(R.id.radiob1);
RadioButton register_buffer_Gender2 = (RadioButton) findViewById(R.id.radiob2);
...
boolean check1 = register_buffer_Gender1.isChecked();
boolean check2 = register_buffer_Gender2.isChecked();
....
Could you give and example of how to do this, but for blackberry?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该方法实际上与 BlackBerry 开发非常相似:
我建议查看 RadioButtonField 和 RadioButtonGroup< /a>,应该可以让你上路。
The approach is actually pretty similar in BlackBerry development:
I would suggest taking a look at the documentation on RadioButtonField and RadioButtonGroup, should get you on your way.