0

I have a page which uses a <ui:param> defined via parameters in the URL of the page. The page url looks something like mypage.xhtml?course-id=123&semester=456.

When I click on a button, I want to update detailSection form based on a bean action call. However, after clicking on the button, the URL parameters which I put into the myBean.getGrade(String courseId, String semester) when defining the grade <ui:param> are empty Strings.

How can I prevent this from happening? The grade param should be the same actually, so the question could also be: How do I keep the <ui:param> while updating a form?

<ui:component ...>
    <h:body>
        <ui:decorate template="myTeplate.xhtml">
            <!-- the param['course-id'] and param['semester'] are both empty strings after update -->
            <ui:param name="grade"
                      value="#{myBean.getGrade(param['course-id'], param['semester'])}"/>
             ...
             <ui:define name="content">
                 <p:commandLink action="#{myBean.action()}"
                                update="detailSection"/>
                 <h:form id="detailSection">
                     <h:outputText value="#{grade.points}"/>
                 </h:form>
             </ui:define>
        </ui:decorate>
    </h:body>
</ui:component>       
tomashauser
  • 455
  • 3
  • 14
  • Adding and resolved my problem as the values get immediately set into the bean when the page loads and then instead of calling param['course-id'] I call #{myBean.courseIdHolder}. – tomashauser Jul 12 '21 at 08:32

0 Answers0