开发者

Primefaces Change menu entry via ajax an rerender content on full layout

开发者 https://www.devze.com 2023-03-20 09:06 出处:网络
I am trying to get a simple full layout 开发者_运维百科to work with a navigation on the left side.

I am trying to get a simple full layout 开发者_运维百科to work with a navigation on the left side. That works but I want to reload the center (content) via ajax on menu item selection.

The reason is, that I have a MP3 player on the right side and if the whole page reloads the mp3 player start the playback again.

On Richfaces I did that with a session bean which holds the actual filename that needs to be rendered in the center and on menu click the action method analyses the menu entry ID and sets the filename to its corresponding.

Actually that works a little bit for primefaces as well, but the content doesn't render correctly. After punshing F5 it is perfect. Does anybody can give me a real simple example how I can do that?

Many greetings, Hauke


I have never use menuitem but with commandButton I just use 'update' notation to refresh the form located in the center content via ajax.

On navigation layoutUnit

<p:commandButton
 value="Enter"
 image="ui-icon ui-icon-comment"
 update="form_input_console form_output_console:tabbed_contents"
     actionListener="#{dashboardUi.processCommand}" />

and on the center layout unit

<p:layoutUnit position="center">
    <h:form id="form_output_console">
        <p:tabView
        id="tabbed_contents"
        dynamic="true">
0

精彩评论

暂无评论...
验证码 换一张
取 消