-
1. Re: toggleControl
ilya_shaikovsky Sep 24, 2011 1:39 PM (in response to tehackio)In RF 4 you can't use forms inside tabs, accordion items and so on.. Only one form around whole tab panel could be used. That's because of JSF 2 limitation of adding the form programatically. (tab controls itself requires form around and in RF 4 we can't add it if developer not added it explicitly wrapping whole panel).
So add form around tabpanel, remove from every tab and limit processing by playing with execute on your controls inside the tabs.
P.S. could be good to rename the thread
-
2. Re: toggleControl
tehackio Sep 25, 2011 7:37 AM (in response to ilya_shaikovsky)Thank you for answer. I remove the forms, but the problem persist.
The tab switch but... conversation id for each tab is different and currentID is not setted, hence, the form in editTab is not loading.
<h:form>
<rich:tabPanel id="principal" switchType="ajax">
<rich:dataTable var="reg" ...
...
<rich:column>
<h:outputText value="#{userHome.conversation.id}" />
<a4j:commandLink execute="@this">
<h:graphicImage value="resources/img/telescope.gif"/>
<f:param name="cid" value="#{userHome.conversation.id}"/>
<a4j:param value="#{reg.id}" assignTo="#{userHome.dao.currentId}"/>
<rich:toggleControl event="click" targetItem="editTab"/>
</a4j:commandLink>
</rich:column>
...
<rich:tab id="editTab">
<h:outputText value="#{userHome.conversation.id}" />
<h:outputText value="#{userHome.dao.currentId}" />
</rich:tab>
...
</rich:tabPanel>
</h:form>
-
3. Re: toggleControl
ilya_shaikovsky Sep 25, 2011 11:16 AM (in response to tehackio)<a4j:commandLink execute="@this">
<h:graphicImage value="resources/img/telescope.gif"/>
<f:param name="cid" value="#{userHome.conversation.id}"/>
<a4j:param value="#{reg.id}" assignTo="#{userHome.dao.currentId}"/>
<rich:toggleControl event="click" targetItem="editTab"/>
</a4j:commandLink>
there you trying to submit the row id for editing and switch the tab in the same time. Then I think it will be better to remove the toggleControl. Currently you using 2 requests for that. toggleControl added to onclick sends switching event first and only then link itself submits the id.
tabPanel provides activeItem binding to manage current page. So change code to make change and submission in one reqeust:
<a4j:commandLink execute="@this">
<h:graphicImage value="resources/img/telescope.gif"/>
<f:param name="cid" value="#{userHome.conversation.id}"/>
<a4j:param value="#{reg.id}" assignTo="#{userHome.dao.currentId}"/>
<a4j:param value="editTabId" assignTo="#{controller.activeTab}"/>
</a4j:commandLink>
where
<rich:tabPanel id="principal" switchType="ajax" activeItem="#{controller.activeTab}">
and
<rich:tab id="editTabId">
And change render of the link to tabPanel id.
Hope it helps.
-
4. Re: toggleControl
tehackio Sep 27, 2011 12:55 PM (in response to ilya_shaikovsky)Thank you! It solves my problem but...
When I click on tab "editTab", after I click on prior tab "searchTab" (that has dataTable), lastly I click on row reg(before all rigth), and nothing happens.
And.. can I pass parameters on tabChange?