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

command button action doesn't work inside tabview #842

Closed
mtvweb opened this issue Aug 19, 2017 · 22 comments
Closed

command button action doesn't work inside tabview #842

mtvweb opened this issue Aug 19, 2017 · 22 comments
Assignees
Milestone

Comments

@mtvweb
Copy link

mtvweb commented Aug 19, 2017

Since commit "ab1689b" a command button inside a tabview does not call action any more.
May be the multi-colon-id isn't resolved correctly.

i.E.

	<b:tabView contentStyle="border-right: 1px solid #ddd;border-left: 1px solid #ddd;border-bottom: 1px solid #ddd;padding:10px">
			<b:tab title="Stammdaten">
                         ....
                            <b:commandButton value="Add bank account" size="xs" 
				icon-awesome="plus-circle" ajax="true" immediate="true" 
                                action="${ editVerein.addBank }" look="primary" />
                         ....
			</b:tab>
	</b:tabView>
@stephanrauh
Copy link
Collaborator

@mtvweb
That's a remarkably difficult bug. I think I've managed to improve things. But they're not perfect yet, as the showcase shows. Can you run a check whether it solves your issue?

@stephanrauh stephanrauh added this to the v1.1.3 milestone Aug 21, 2017
@mtvweb
Copy link
Author

mtvweb commented Aug 21, 2017

Still no action call. If I put the command button below the tabview everything is fine.

Find attached a screenshot of the basic page structure. Maybe it helps:

structure

@stephanrauh
Copy link
Collaborator

The HTML code is ok. The bug hides in the depth of the JSF framework itself. Somewhere the input is silently ignored instead of sending it to the nested components. The root cause is that I've derived the class from UIRepeat instead of UIOutput. UIRepeat always assumes there's an array and an array index, so it gets confused when it meets a simple tab without value and var.

@stephanrauh
Copy link
Collaborator

@mtvweb I think I've managed to solve the bug now. Would you like to test it again?

Thanks in advance,
Stephan

@mtvweb
Copy link
Author

mtvweb commented Aug 22, 2017

@stephanrauh It works, fixed! Good work, Jens

@stephanrauh
Copy link
Collaborator

Yippee!!!! Now we can publish BootsFaces 1.1.3!

@AlexanderPraegla
Copy link

AlexanderPraegla commented Apr 26, 2018

Hi,

I'm still having issues with the commandbutton inside the TabView. The action is called, but the value of the variable is always null. It seems that the setter of the variable is not called.

I'm using BootsFaces 1.1.3 on Java EE8 with JSF 2.3.

Here is an example which is not working.
HTML:

<b:form>
            <b:tabView>
                <b:tab title="Tab1">
                    <b:panel>
                        <b:form>
                            <b:inputText value="#{testTabBean.text}"/>
                            <b:commandButton action="#{testTabBean.doIt()}" value="test" look="danger"/>
                        </b:form>
                    </b:panel>
                </b:tab>
            </b:tabView>
        </b:form>

Backing Bean:

	private String text;
	@Inject
	private Logger logger;

	public String doIt() {
		logger.info(text);
		return "startpage";
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

@chongma
Copy link
Collaborator

chongma commented Apr 26, 2018

Should you be doing Ajax, like <f:ajax render="form"/> inside theb:commandButton. I usually use Ajax anyway

@stephanrauh
Copy link
Collaborator

Would you mind to send us a complete reproducer? I.e. a project including the pom.xml, so we can simply use it without having to configure anything? Because the feature does work in our tests, so it's likely that you're doing something unusual. You can upload the project as a GitHub repository or send us a zip file.

BTW, which application server to you use?

@AlexanderPraegla
Copy link

I added the test code in the index.xhtml in my project on the branch "bootsFaces-tabview-commandbutton" on https://github.com/AlexanderPraegla/Pinkie.git

Im using the new Glassfish v5 as application server.

Thanks in advance!

@chongma
Copy link
Collaborator

chongma commented Apr 28, 2018

Did you try ajax="true" inside b:commandButton?

@stephanrauh stephanrauh reopened this Apr 28, 2018
@stephanrauh
Copy link
Collaborator

@AlexanderPraegla Can I run the application without the database?

@AlexanderPraegla
Copy link

@chongma That is working, strange. I rarely use ajax and I would like better if the "normal" processing would work :)

@stephanrauh No unfortunately no, because part of the navbar comes from the database. I provide you a dump of my postgres dev database if that would help? Or I remove everything conntecting to the database.

@stephanrauh
Copy link
Collaborator

@AlexanderPraegla This has nothing to do with your bug, but I thought you might be interested in the Eclipse warnings. Maybe that's a lurking error you haven't detected yet, or that's puzzling you all the time :).

image

@stephanrauh
Copy link
Collaborator

@AlexanderPraegla I'd prefer the second option (removing everything connecting to the database in a separate Git branch). Otherwise, I'd have to install Postgres on my development machine - something I'd like to avoid.

BTW, I've tried to remove the database code myself, but it seems to be a lot of work. At least for a layman like me. I guess you're more familiar with your application, so I hope it's not too much work for you :).

@AlexanderPraegla
Copy link

@stephanrauh Thanks für warnings, didn't even know about them. My intellij idea is fine with this code, but I will have another look.

I think i removed everything connecting to the database, can you give it a try please? :)

@stephanrauh
Copy link
Collaborator

OK, I've managed to reproduced the bug. The getter is called outside the tabs, but not if the input field is put inside the tabs.

BTW, I'm impressed by your project activity. Awesome! I just hope you can still spend some time playing handball :).

@stephanrauh
Copy link
Collaborator

It seems that updating to BootsFaces 1.2.0 or 1.2.1-SNAPSHOT solves the issue. Would you mind to give it a try?

Best regards,
Stephan

@AlexanderPraegla
Copy link

Thanks, I try to handle everything between job, studies and handball :)

That's odd, because I actually tried this before I came here for help. But I will give it another try!

@stephanrauh
Copy link
Collaborator

Hope updating BootsFaces helps nonetheless :). Maybe we've added a bug-fix after 1.1.3, or we forgot to update the version number of the ticket.

Is Altenerding worth a visit? If the W-JAX or the iJS conference invites me for a talk, I could drop by.

@AlexanderPraegla
Copy link

I'm very sorry for wasting your time. It seems that updating the bootsfaces dependency did the trick :)
Thank you very much for your help. Now I can use finally tabviews with forms.

In Altenerding is not that busy. If you really come to munich it would be better to meet up in munich itself.

@stephanrauh
Copy link
Collaborator

Doesn't feel like a waste of time :). I'm always glad to help!

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

5 participants