Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't have multiple Choice tags with both required and perRegion attributes set to true #6562

Open
lxtadhamnawito opened this issue Oct 27, 2024 · 1 comment

Comments

@lxtadhamnawito
Copy link

Describe the bug
On creating an xml, with multiple Choice tags (I tried it with TextArea as well and it made the same behavior) where both tags have required=true and perRegion=true, only one of them is set to be required while the other one is get by-passed.

This is an example of XML I'm using
`





<View>
<RectangleLabels name="group" toName="image" showInline="true">
	<Label value="Bicycle" background="Black"/>
	<Label value="Box-Truck" background="Gold"/>
</RectangleLabels>
</View>

<View style="width: 100%;">
    <Image name="image" value="$image" zoom="true" zoomControl="true" />

    <View>
        <Choices name="test_name" toName="image" showInline="true" choice="single-radio" required="true" perRegion="true">
            <Choice alias="0" value="Vehicle 0" />
            <Choice alias="1" value="Vehicle 1" />
            <Choice alias="2" value="Vehicle 2" />
            <Choice alias="3" value="Vehicle 3" />
        </Choices>

        <!-- Additional License Plate Choices -->
        <Choices name="test_name_2" toName="image" showInline="true" choice="single-radio" required="true" perRegion="true">
            <Choice alias="4" value="Vehicle 4" />
            <Choice alias="5" value="Vehicle 5" />
            <Choice alias="6" value="Vehicle 6" />
            <Choice alias="7" value="Vehicle 7" />
        </Choices>
    </View>
</View>

`

Expected behavior
While choosing only one choice and neglecting the other one and trying to submit, it should block me as both are required.

@heidi-humansignal
Copy link
Collaborator

heidi-humansignal commented Oct 30, 2024

Hello,

You can try these suggestions to see if it works for your use case, while we are investigating

Combine Choices into a Single Control:
If possible, combine your Choices into a single Choices tag. This way, all your options are within one control, and the required validation will apply to the combined choices.

   <Choices name="test_name_combined" toName="image" showInline="true" choice="single-radio" required="true" perRegion="true">
       <Choice alias="0" value="Vehicle 0" />
       <Choice alias="1" value="Vehicle 1" />
       <Choice alias="2" value="Vehicle 2" />
       <Choice alias="3" value="Vehicle 3" />
       <Choice alias="4" value="Vehicle 4" />
       <Choice alias="5" value="Vehicle 5" />
       <Choice alias="6" value="Vehicle 6" />
       <Choice alias="7" value="Vehicle 7" />
   </Choices>

Use Nested Choices or Taxonomy:
If you need to group choices, consider using the Taxonomy tag, which allows for hierarchical options and better organization.

   <Taxonomy name="vehicle_choices" toName="image" showFullPath="false" perRegion="true" required="true">
       <Choice value="Group 1">
           <Choice alias="0" value="Vehicle 0" />
           <Choice alias="1" value="Vehicle 1" />
           <Choice alias="2" value="Vehicle 2" />
           <Choice alias="3" value="Vehicle 3" />
       </Choice>
       <Choice value="Group 2">
           <Choice alias="4" value="Vehicle 4" />
           <Choice alias="5" value="Vehicle 5" />
           <Choice alias="6" value="Vehicle 6" />
           <Choice alias="7" value="Vehicle 7" />
       </Choice>
   </Taxonomy>

Thank you,
Abu

Comment by Abubakar Saad
Workflow Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants