开发者

How do I avoid using nested forms in Richfaces 4 + How do I use a4j:push in Richfaces 4?

开发者 https://www.devze.com 2023-02-16 15:04 出处:网络
I\'m using Richfaces 4 CR1 + JSF 2.0. And I have got two questions : 1) I know nesting is not allowed in JSF. It just isn\'t.

I'm using Richfaces 4 CR1 + JSF 2.0. And I have got two questions :

1) I know nesting is not allowed in JSF. It just isn't. Here's a use case - I have a master page which includes header.xhtml and footer.xhtml with

    <ui:include src="header.xhtml"/> 
    <h:form>
      <rich:tabPanel switchType="ajax"..>
        <rich:tab ..>
          <ui:include src="/includes/page1.xhtml" .../>
        </rich:tab>
        <rich:tab ..>
          <ui:include src="/includes/page2.xhtml" .../>
        </rich:tab>
     </rich:tabPanel>
  </h:form>
  开发者_JAVA技巧<ui:include src="footer.xhtml" .../>

The <rich:tabPanel ../> needs to wrapped with a <h:form.../>. And since each of my tab is actually another xhtml page, some of them have controls like <rich:togglePanel ../> which also requires a <h:form ../> tag around it...! So how do I handle this in the best possible way?

PS : I have referred to this question and may be even my question's answer lies in <a4j:region ../>

2) How do I use a4j:push in Richfaces 4? The documentation is still in progress. The sample code is here but I couldn't understand the following line -

<a4j:push address="#{channelName}@chat" .. />

Any help with these two is greatly appreciated! :)


Answers to above questions given by Max Katz in an email chain were

1) Use a global form. When you submit, only the current active tab components will be processed

2) Max Katz, Ilya Shaikovsky and guys at Exadel/Richfaces were kind enough to publish a how-to on ajax:push here

Can't thank them enough! :)

0

精彩评论

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