TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
247 stars 102 forks source link

<b:selectOneMenu> select2="true" ignores contentDisabled #1143

Closed flo-png closed 1 month ago

flo-png commented 4 years ago

Hello together,

it seems that b:selectOneMenu ignores contentDisabled when select2="true" is set. I prepared the sample down below so you can verify it.

Thanks in advance. Regards flo-png

Version: BootsFaces-OSP-default-1.4.2 Server: tomcat-9.0.36

Sample:

<b:container fluid="true">
        <b:row>
            <b:column id="content">
                <!--  Start -->

                <h3>Select MenuIssue Example</h3>

                <h4>Disable Issue</h4>

                <h:form>
                    <b:row>
                        <b:commandButton value="toggle contentDisabled" ajax="true" update="output"
                            action="#{selectMenuIssueExample.toggleContentDisabled}" />

                        <b:commandButton value="toggle selectOneMenu" ajax="true" update="output"
                            action="#{selectMenuIssueExample.toggleSelectOneMenu}" />
                    </b:row>

                    <b:row contentDisabled="#{selectMenuIssueExample.contentDisabled}"
                        id="output">

                        <b:column medium-screen="3">
                            <b:selectOneMenu value="Cannot be disabled"
                                label="Child selection:" ajax="true" contentDisabled="#{selectMenuIssueExample.selectOneMenuContentDisabled}"
                                select2="true" update="@form">
                                <f:selectItems value="#{selectMenuIssueExample.selectedParent.childs}" var="c"
                                    itemValue="#{c}" itemLabel="#{c.name}" />
                            </b:selectOneMenu>
                        </b:column>

                        <b:column medium-screen="3">
                            <b:selectOneMenu value="Can be disabled"
                                label="Child selection:" ajax="true" contentDisabled="#{selectMenuIssueExample.selectOneMenuContentDisabled}"
                                update="@form">
                                <f:selectItems value="#{selectMenuIssueExample.selectedParent.childs}" var="c"
                                    itemValue="#{c}" itemLabel="#{c.name}" />
                            </b:selectOneMenu>
                        </b:column>
                    </b:row>

                </h:form>

                <!--  END -->
            </b:column>
        </b:row>
    </b:container>

Java Bean:

    private boolean contentDisabled = false;
    private boolean selectOneMenuContentDisabled = false;

    public void toggleContentDisabled() {
        contentDisabled = !contentDisabled;
    }

    public void toggleSelectOneMenu() {
        selectOneMenuContentDisabled = !selectOneMenuContentDisabled;
    }
geopossachs commented 4 years ago

Hallo, the selectOneMenu do no has an attribute contentDisabled, so it do not support it

flo-png commented 4 years ago

Hello geopossachs ,

thanks for your reply. Iam confused about the tag "couldnt reproduce" and the add to v1.6.0 milestone at the same time. Will this be adressed in v1.6.0 or must i change the usage of contentDisabled to disable the content of with select2="true" ?

Would the attribute disabled work for with select2="true" ?

Looking forward to you reply. Regards

geopossachs commented 4 years ago

hallo @flo-png,

i would like to label each new issue with a version to handle each issue in the project via the version tags. regardless of whether we solve it or not.

the component selectOneMenu do not support contentDisabled, this is not the same like ignore https://showcase.bootsfaces.pecer.de/BootsFacesWeb//forms/selectOneMenu.jsf#reference_section

if a component ignores something, then it sounds like a bug, for example if you enable option A the functionality B do not work like expected.

what exactly is your wish? what do you expect from the component?

flo-png commented 4 years ago

what exactly is your wish? what do you expect from the component?

I see the select2 attribute as an option of , i expect that the behaves in the same way like without select2="true" and all other components i worked with before. That means if the contentDisabled for one of the parent components will be set to "true", all components below that in the component tree will be disabled.

At the moment this works for components like InputText, Button and even for the SelectOneMenu when select2="false". When i understand contentDisabled correctly, it allows to disable complete component trees if needed. with attribute select2="true" does not support this behaviour.

My workaround is to do not render the if i want to lock its content for user manipulation on it. To see the difference behaviour i provided the sample in the first post.

the component selectOneMenu do not support contentDisabled, I know that, but i talk about parent components which sould reflect the disabling to the child components. See my sample: <b:row contentDisabled="#{selectMenuIssueExample.contentDisabled}"

Hope the issue got clear now.

Regards

stephanrauh commented 1 month ago

I'm afraid development of BootsFaces has slowed down considerably. We'll never manage to address this issue. Let's close it.