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

b:radioButton doesn't change value in composite components (Version 1.0.2) #616

Closed
knoppt opened this issue Jan 11, 2017 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@knoppt
Copy link

knoppt commented Jan 11, 2017

Hi,

I changed Bootsfaces Version from 1.0.1 to 1.0.2!

Now b:radioButton doesn't change value when submit @Form!

I use Bootsfaces showcase http://showcase.bootsfaces.net/forms/RadioButton.jsf

<b:panel title="Survey" look="primary">
   <p>What's your favorite band?</p>
     <b:radiobutton value="#{radiobuttonBean.favoriteBand}">
         <f:selectItems value="#{radiobuttonBean.bands}" />
         <f:selectItem itemValue="" itemLabel="None of the above" />
     </b:radiobutton>
     <b:commandButton value="submit your choice" action="#{radiobuttonBean.submitBand}"
                      look="primary" update="@form" />
     <b:message for="@form:@property(radiobuttonBean.favoriteBand)" />
 </b:panel>

The setter favouriteband was not invoked!
In Version 1.0.1 it worked fine!

Thanks, best regards!

knoppT

@knoppt knoppt changed the title b:radioButton don't change value in Version 1.0.2 b:radioButton doesn't change value in Version 1.0.2 Jan 11, 2017
@stephanrauh
Copy link
Collaborator

I've just tried to reproduce the bug. I don't see any error. So probably I've tested the wrong thing. do we talk about this part of the demo? When I tested it, the method setFavorityBand(String x) was called, and the message was shown:
image

@knoppt
Copy link
Author

knoppt commented Jan 13, 2017

Hi,

I tested it again and assert, that the bug only occurs when I put the b:radiobutton into a composite component!

Then the radioButton doesn't change the value in Version 1.0.2!
In Version 1.0.1 everythings works fine!

Outside a composite component it also works in Version 1.0.2!

Here my code (radioButtonBean identical like showcase)!

example.xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:stala="http://xmlns.jcp.org/jsf/composite/component">
<body>
	<h:form id="form">
		<stala:editPanel />
	</h:form>
</body>
</html>

editPanel.xhtml:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:composite="http://xmlns.jcp.org/jsf/composite"
	xmlns:b="http://bootsfaces.net/ui"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
	<composite:interface>
	</composite:interface>
	<composite:implementation>
	       <b:panel title="Survey" look="primary">
                   <p>What's your favorite band?</p>
                   <b:radiobutton value="#{benutzerController.favoriteBand}">
                         <f:selectItems value="#{benutzerController.bands}" />
                         <f:selectItem itemValue="" itemLabel="None of the above" />
                   </b:radiobutton>
                   <b:commandButton value="submit your choice"
                            action="#{benutzerController.submitBand}" look="primary"
                            update="@form" />
                    <b:message for="@form:@property(benutzerController.favoriteBand)" />
                </b:panel>
	</composite:implementation>
</ui:composition>

Thanks in advance,
knoppT

@knoppt
Copy link
Author

knoppt commented Jan 13, 2017

The h:form is the party pooper!

When I put the h:form into the composite component it works!
But this is no solution!

Best regards,

knoppT

@stephanrauh
Copy link
Collaborator

Might be an id resolution problem. Just a wild shot: try to add an id to <stala:editPanel />.

@knoppt
Copy link
Author

knoppt commented Jan 13, 2017

I added id to stala:editPanel, but same result!

@stephanrauh
Copy link
Collaborator

Sigh... well, it was worth a try. I'll debug your code later.

stephanrauh added a commit that referenced this issue Jan 13, 2017
…ent and if the form is outside the custom component
@stephanrauh
Copy link
Collaborator

Oh. It was something unexpected. The child elements of a custom component are not stored in the children variable, but in the facets variable. Now it works. Please try again with the current developer snapshot BootsFaces-1.1.0-SNAPSHOT I've just uploaded. See #369 on how to get it.

@stephanrauh stephanrauh added this to the v1.1.0 milestone Jan 13, 2017
@stephanrauh stephanrauh changed the title b:radioButton doesn't change value in Version 1.0.2 b:radioButton doesn't change value in composite components (Version 1.0.2) Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants