ylnsagar
ylnsagar

Reputation: 644

jsf Command button not working in an include Jsp

I have a jsp page which has dynamic includes. each dynamic include invoke its own backing bean and works fine with dataTables and reading data from backing bean, But i am facing problems with the command button. when i click command button, the control is not being transferred to the bean and it not navigating to the next page as it is not hitting the onclick method.

any suggestion would be helpful.

Upvotes: 0

Views: 496

Answers (1)

BalusC
BalusC

Reputation: 1108692

You need to ensure that the value of the dynamic bean property behind <jsp:include page> is exactly the same during the form submit as it was during displaying the page with the form. So if it's obtained from a request scoped bean, then you need to ensure that the property is set during its (post)construction as well based on some request parameter which you could set as a managed property or obtain from ExternalContext#getRequestParameterMap(). An alternative is to put the bean in the session scope, but this won't work very well when the enduser has the same page open in multiple browser windows/tabs in the same session.

Upvotes: 1

Related Questions