简体   繁体   English

我如何修复代号一中的简单逻辑错误?

[英]how do i fix simple logic error in codename one?

I am new to codename one.我是代号一的新手。 I am trying to build an app in which I am stuck at a point.我正在尝试构建一个应用程序,但我遇到了问题。 In attached first screenshot as you can see, there is an accordion named as Environment and inside Environment there is a Picker.如您所见,在附加的第一个屏幕截图中,有一个名为 Environment 的手风琴,在 Environment 中有一个 Picker。 Same thing is there for the other accordions.其他手风琴也是如此。 What I want to do is when user selects one of the task from picker, other accordions should be non editable.我想要做的是当用户从选择器中选择一项任务时,其他手风琴应该是不可编辑的。 for instance, user selected picking up a trash from Environment accordion, he shouldn't be able to select any other accordions.例如,用户选择从 Environment 手风琴中捡垃圾,他不应该选择任何其他手风琴。

in second picture I don't want the user to select more than one type.在第二张图片中,我不希望用户选择一种以上的类型。 can someone help me with that?有人可以帮我吗?

https://imgur.com/EYzDLP1 https://imgur.com/EYzDLP1

https://imgur.com/SAcu0UN https://imgur.com/SAcu0UN

I tried doing it by if else loop, but its getting worse.我尝试通过 if else 循环来做到这一点,但它变得更糟。

Expected Result: User should be able to select only one deed type as shown in image.预期结果:用户应该只能选择一种契约类型,如图所示。

Actual Result: N/A实际结果:不适用

I'm guessing that you have an issue with the picker arrows as mentioned here: https://github.com/codenameone/CodenameOne/issues/2775我猜你对这里提到的选择器箭头有问题: https : //github.com/codenameone/CodenameOne/issues/2775

That issue also explains the process of disabling them.该问题还解释了禁用它们的过程。

You can also set the other components to be enabled/disabled based on the selection of the accordion.您还可以根据手风琴的选择来设置其他组件的启用/禁用。

It might also make more sense to have toggle buttons ( RadioButton to pick the right category) and then use one Picker for all entries.使用切换按钮( RadioButton选择正确的类别)然后对所有条目使用一个Picker也可能更有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM