开发者

Blackberry hide fields

I have a dropdown list in which I select how many people are going to a party. When the user changes the value of the dropdown list, I want as many field开发者_如何学Gos as the number selected to appear and hide the rest.

But I don't know how can I hide or delete fields because I don't know their index.


Yes you will need to have the fields you want to hide as a global variables.

You will also need to get the value the user has selected and use that to work out what fields should be removed or added.

One way would be to add all the fields in order to a vector or an array when the screen is initialised. Once the user has selected a value you could iterate through the fields and use the current index of the list and the user selected value to work out if the field should be removed or added.


If you have the field objects, then use Field.getIndex() to find the index of each field within its manager.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜