Ajax-Reload Problem

UI Components for JSF
Post Reply
da.dom
Posts: 15
Joined: 07 Jun 2010, 16:21

07 Jun 2010, 16:35

Hi together,

have an issue here, that can't be the correct way ;) .

I have a page (a little bit complex, so no example for now. maybe i will produce a short one later), where i use a p:panel to output a various number of panels.
On the first visit of the pages, the user have to select an date range, so no p:panel - Components whould be rendered at first time.
After the user submittet the dates, i have an ajax - partielle rerendering of the Grid where the p:panels are shown.

In general that worked, but primeFaces seems not including the (default) style-informationens for the panels, if at first rendering-time no p:panels are present. If i place a dummy p:panel component outside of the re-Rendering-Grid (so that at the first visit we have immediatly one p:panel present) the styles work fine.

In a not complete coding looks like:

Code: Select all

<h:form>
  <!-- Some input -->
	<h:commandButton action="#{fakturHandler.aktualisiereAufgaben()}" value="Refresh">
				<f:ajax ... render=":panel" />
	</h:commandButton>
</h:form>


<h:panelGroup id="panel">
	<c:forEach items="..." var="item">
		<p:panel ...>
		</p:panel>
	</c:forEach>
</h:panelGroup>


<!-- UnComment this, will do the right styling for this panel and the ReloadedPanels above too! -->
<!--			<p:panel ...>-->
<!--				<h:form>-->
<!--					<h:outputText value="Demo" />-->
<!--				</h:form>-->
<!--			</p:panel>-->
A bug of a feature (or even my misunderstaning) that is here the question :)
thanks a lot
Dom

System:
primefaces 2.0.2
jsf 2.0
on Glassfish v3

da.dom
Posts: 15
Joined: 07 Jun 2010, 16:21

08 Jun 2010, 12:32

(i changed the topic name because:)
the problem with reloading a specified area with a "new" (not used before on the page) component type seems to make trouble not even for the styling.

I implement a dirty workaround for the styling issue with having always one panel:

Code: Select all

<p:panel rendered="false"/>
The style is loaded probably, but try something like invoke an action Method on a Panel-Options-Menu like:

Code: Select all

<h:form>
  <p:panel...>
   <f:facet name="options">
  		<p:menu>
  			<p:submenu label="Do...">
  				<p:menuitem onclick="#{component.parent.clientId}.close()" value=" doSome" icon="#{resource['images:apply.png']}" action="#{handler.soSome}" />
  			</p:submenu>
  		</p:menu>
  	</f:facet>
  </p:panel>
</h:form>
whould result in a ajax Callback to the Server (firebug display) but the registered Method isn't invoke!

And here again: Removing the Ajax-ReRendering (and display full functional panels immediatly, or make a full render after the user makes the selection) makes no problems = styling fine, action-method get calls.

So far from me
Dom

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests