Bugs in 2.2 SNAPSHOT

UI Components for JSF
martinPrime
Posts: 41
Joined: 11 Oct 2010, 18:26

05 Feb 2011, 17:26

Hi all,

I tried switching from a nightly built 2.2 SNAPSHOT of early January to the nightly built of 3 February 2011. Unfortunately, I fell over some strange behaviours / bugs:

1. I use dialogs a lot in my application, now nearly all (not all) actions involving an actionListener call and a dialog.show() lead to the following exception:

Code: Select all

javax.faces.FacesException: Unexpected error restoring state for component with id j_idt3.  Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.
        at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:273)
        at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
        at javax.faces.component.UIComponent.visitTree(UIComponent.java:1485)
        at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496)
        at com.sun.faces.component.visit.VisitUtils.doFullNonIteratingVisit(VisitUtils.java:75)
        at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:257)
        at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:181)
        at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:448)
        at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:187)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
I really have not been able to find the reason for that problem, it occurs on all pages for many actions. Strange also is that the stated component id j_idt3 does not exist on the page (when looking into the source of the rendered page with the browser).
I finally realized that if I remove the menubar from the template, everything works OK again! I know that there were changes on that component and I adusted my menubar appropriately (using the new icon tag). In the following please find the code of the menubar, in my opion everything is fine with that definition:

Code: Select all

<h:form id="toolbarMain">
        
        <p:menubar style="font-size: 12px" >

            <p:submenu label="Einkauf" icon="ui-icon cartIcon">
            </p:submenu>

            <p:submenu label="Bestandsführung" icon="ui-icon inventoryIcon">
                <p:submenu label="Artikel-Management">
                    <p:menuitem value="Artikeldaten pflegen" action="inventory_tabArticle" ajax="false" />
                    <p:menuitem value="Kategorie-Stammdaten" action="inventory_tabCategory" ajax="false" />
                    <p:menuitem value="Hersteller-Stammdaten" action="inventory_tabProducer" ajax="false" />
                    <p:menuitem value="Material-Stammdaten" action="inventory_tabMaterial" ajax="false" />
                    <p:menuitem value="Größen-Stammdaten" action="inventory_tabSizes" ajax="false" />
                    <p:menuitem value="Farben-Stammdaten" action="inventory_tabColor" ajax="false" />
                </p:submenu>
                <p:submenu label="Bestandsführung">
                    <p:menuitem value="Bestand pflegen" action="inventory_tabInventory" ajax="false" />
                    <p:menuitem value="Lagerorte definieren" action="inventory_tabInvlocation" ajax="false" />
                </p:submenu>
            </p:submenu>

            <p:submenu label="Verkauf" icon="ui-icon lorryIcon">
                <p:menuitem value="VertriebDashboard" action="sales_tabOrderdoc" ajax="false" />
                <p:menuitem value="Bestellungen verwalten" action="sales_tabOrderdoc" ajax="false" />
                <p:menuitem value="Auslieferungen verwalten" action="sales_tabDelivery" ajax="false" />
                <p:menuitem value="Reklamationen verwalten" action="sales_tabClaim" ajax="false" />
                <p:menuitem value="Rechnungen verwalten" action="sales_tabInvoice" ajax="false" />
                <p:menuitem value="Kundenstammdaten verwalten" action="sales_tabCustomer" ajax="false" />
                <p:menuitem value="Verkaufaktionen verwalten" action="sales_tabPromotion" ajax="false" />
            </p:submenu>
            
            <p:submenu label="Applikation" icon="ui-icon appIcon">
                <p:submenu label="Eigeschaftswerte">
                    <p:menuitem value="Liste Kurz-Werte" action="app_tabProps" ajax="false" />
                    <p:menuitem value="Liste Lang-Werte" action="app_tabBigProps" ajax="false" />
                </p:submenu>
            </p:submenu>

        </p:menubar>

    </h:form>
Does anyone came over the same problem?


2. Primefaces introduced a new inputText component, <p:inputText/>. In the showcase the new text field calendar and the other newly styled fields look ok, but in my app - independent of the theme I use and the browser - the fields all look like a button, i. e. with a colored background (they are not disabled or readOnly or anything else!). Anyone else with this problem or any solution for that?

Thanks!
Martin

smallya
Posts: 264
Joined: 19 Mar 2010, 19:22
Contact:

05 Feb 2011, 21:30

I get this same issue in many pages, dialogs and also in dataGrid, dataTable when I try to paginate. It does not work and logs show the same error you have put in the issue. I don't use Menubar in my application.

When I reverted back to PF2.2RC2 things are back to normal.


The <p:inputText> used to look like button in the prior builds, but the latest I think it is 259 things have been fixed and the fields look normal.
Netbeans 7.2| GlassFish 3.2 | PostgreSQL 9.1| MongoDB | Primefaces 3.4.2
_______________________________________________________________
Subraya Mallya
http://tinyhabit.com |http://twitter.com/tinyhabit

bitec
Posts: 44
Joined: 20 Jan 2011, 21:34
Location: Russia

06 Feb 2011, 09:15

About 2): the same thing in my app with p:inputMask (the background is the same as for the button). I had to apply styles directly to avoid this. May be the issue is linked with the new approach to packing themes into jars instead of zip archives, which is going to come in new release.. I still use zip files and direct unpacking.
JSF: Mojarra 2.1 | PrimeFaces 2.2.1 | Glassfish 3.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Feb 2011, 11:06

We couldnt manage the 1st issue mentioned, tried menubar, dialogs, datagrid on showcase. For 2nd issue you need to update the themes with 2.2 final release.

martinPrime
Posts: 41
Joined: 11 Oct 2010, 18:26

06 Feb 2011, 22:59

Thanks, issue #2 works fine when using the .jar theme file.

Concerning issue #1:
I tried the hole day making Primefaces 2.2 final work with my existing project - I had no luck. The project works fine with PF 2.2 RC2 (like mentioned by smallya) but throws the mentioned exception in many scenarios. It's like also described by smallya, the exception is thrown in pages, dialogs dataTable etc. I couldn't narrow the failure down to the reason. Nearly in all my pages I use dataTable, dialog, menubar, panel. I use session scoped back beans. These often call (stateless) EJBs which are the only components with direct database access.
I'm using Glassfish 3.0.1 and Mojarra 2.0.4.

Here is an example:

The following a page is working properly:

Code: Select all

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/template.xhtml">

    <ui:define name="head">

    </ui:define>

    <ui:define name="body">

        <h:form prependId="false">
            <p:growl id="growl" showDetail="true" life="5000" />

            <h:panelGrid style="margin-top: 5px; margin-bottom: 5px">
                <h:outputLabel value="Bestandsführung > Bestandsführung > Bestand pflegen" style="font-size: 12px;" />
            </h:panelGrid>

            <p:panel id="pnlSearchInv" header="Suchen" widgetVar="pnlSearch" style="width: 1000px" >
                <h:panelGrid columns="4" style="font-size: 10px">
                    <h:outputLabel value="Kategorie" for="txt_categId"></h:outputLabel>
                    <h:selectOneMenu id="txt_categId" value="#{invInventory.searchParams.categId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listCategories}" var="item" itemLabel="#{item.categId}: #{item.categName}" itemValue="#{item.categId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Hersteller" for="txt_producerId"></h:outputLabel>
                    <h:selectOneMenu id="txt_producerId" value="#{invInventory.searchParams.producerId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listProducers}" var="item" itemLabel="#{item.producerId}: #{item.producerName}" itemValue="#{item.producerId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Artikel-Nr." for="txt_aId"></h:outputLabel>
                    <h:inputText id="txt_aId" value="#{invInventory.searchParams.artId}"/>

                    <h:outputLabel value="Artikelname" for="txt_artName"></h:outputLabel>
                    <h:inputText id="txt_artName" value="#{invInventory.searchParams.artName}"/>

                    <h:outputLabel value="Aktiv?"></h:outputLabel>
                    <h:selectOneMenu value="#{invInventory.searchParams.active}" style="font-size: 10px; "  >
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItem  itemValue="True" itemLabel="Ja" />
                        <f:selectItem itemValue="False" itemLabel="Nein" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Neu?"></h:outputLabel>
                    <h:selectOneMenu value="#{invInventory.searchParams.aNew}" style="font-size: 10px; "  >
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItem  itemValue="True" itemLabel="Ja" />
                        <f:selectItem itemValue="False" itemLabel="Nein" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Bildbezeichnung" for="txt_imageDesc"></h:outputLabel>
                    <h:inputText id="txt_imageDesc" value="#{invInventory.searchParams.imageDesc}"/>

                    <h:outputLabel value="Material" for="txt_matId"></h:outputLabel>
                    <h:selectOneMenu id="txt_matId" value="#{invInventory.searchParams.matId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listMaterials}" var="item" itemLabel="#{item.matId}: #{item.matDesc}" itemValue="#{item.matId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Variante" for="txt_varId"></h:outputLabel>
                    <h:selectOneMenu id="txt_varId" value="#{invInventory.searchParams.sizeId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listSizes}" var="item" itemLabel="#{item.producerId.producerName} Id: #{item.sizeId}  |  #{item.size2}  |  #{item.size3}" itemValue="#{item.sizeId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Angebot?"></h:outputLabel>
                    <h:selectOneMenu value="#{invInventory.searchParams.specialOffer}" style="font-size: 10px; "  >
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItem  itemValue="True" itemLabel="Ja" />
                        <f:selectItem itemValue="False" itemLabel="Nein" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Farbe" for="txt_colorId"></h:outputLabel>
                    <h:selectOneMenu id="txt_colorId" value="#{invInventory.searchParams.colorId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listColors}" var="item" itemLabel="#{item.colorId}: #{item.colordescList[0].colorName}" itemValue="#{item.colorId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="Barcode" ></h:outputLabel>
                    <h:inputText value="#{invInventory.searchParams.barcode}"/>

                    <h:outputLabel value="Lagerort" for="txt_locId"></h:outputLabel>
                    <h:selectOneMenu id="txt_locId" value="#{invInventory.searchParams.locId}">
                        <f:selectItem noSelectionOption="true" itemValue="" itemLabel=""/>
                        <f:selectItems value="#{applicationBean.listInvlocations}" var="item" itemLabel="#{item.locId}: #{item.locName}" itemValue="#{item.locId}" />
                    </h:selectOneMenu>

                    <h:outputLabel value="nur Bestand ungleich 0" for="txt_chkNonZero"></h:outputLabel>
                    <h:selectBooleanCheckbox id="txt_chkNonZero" value="#{invInventory.searchParams.invNonZero}" />

                </h:panelGrid>
                <p:commandButton id="btnSearch" ajax="false" action="#{invInventory.searchInventory}" value="Suchen" image="findIcon" style="font-size: 10px" />

            </p:panel>

            <h:panelGrid>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="resources/images/sysImg/ajaxloading.gif" />
                    </f:facet>

                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>

                <p:dataTable id="invTab" var="inv" value="#{invInventory.invList}" selection="#{invInventory.selectedInvs}"
                             selectionMode="multiple" emptyMessage="Es wurden keine Bestandspositionen gefunden." paginator="true"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="10,20,50"  paginatorAlwaysVisible="false" rows="10" style="font-size: 10px; width: 100%;"  >

                    <f:facet name="header">
                        Stammdaten: Bestandspositionen
                    </f:facet>

                    <p:column headerText="Hersteller" styleClass="tabColumnStd" >
                        <h:outputText value="#{inv.variantcolor.variant.articlemat.article.producerId.producerName}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="ArtNr." styleClass="tabColumnStd" >
                        <h:outputText binding="#{invInventory.selectedAIdComp}" value="#{inv.inventoryPK.AId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="ArtName" styleClass="tabColumnStd" >
                        <h:outputText value="#{inv.variantcolor.variant.articlemat.article.AName}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="Mat.Id" styleClass="tabColumnStd">
                        <h:outputText binding="#{invInventory.selectedMatIdComp}" value="#{inv.inventoryPK.matId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="GrößeId" styleClass="tabColumnStd">
                        <h:outputText binding="#{invInventory.selectedVarIdComp}" value="#{inv.inventoryPK.varId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="FarbeId" styleClass="tabColumnStd">
                        <h:outputText binding="#{invInventory.selectedColorIdComp}" value="#{inv.inventoryPK.colorId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="FarbeName" styleClass="tabColumnStd">
                        <h:outputText value="#{inv.variantcolor.color.colordescList[0].colorName}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="LagerortId" styleClass="tabColumnStd">
                        <h:outputText binding="#{invInventory.selectedLocIdComp}" value="#{inv.inventoryPK.locId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="Bestand" styleClass="tabColumnStd" >
                        <h:inputText value="#{inv.nbOnStock}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="nächste Lieferung" styleClass="tabColumnStd" >
                        <p:calendar inputStyle="width: 60px" value="#{inv.nextReplDate}" locale="DE" showOtherMonths="true" navigator="true"  pattern="dd.MM.yyyy" style="font-size: 10px; width: 40px" />
                    </p:column>

                    <f:facet name="footer">
                        <p:toolbar style="font-size: 10px;" >
                            <p:toolbarGroup align="center">
                                <p:commandButton image="tickIcon" actionListener="#{invInventory.applyAllInventory}" update="invTab,growl" title="Änderungen übernehmen" style="font-size: 8px" />
                                <p:divider/>
                                <p:commandButton value="markierte löschen" image="deleteIcon" onclick="delInvConf.show();" title="markierte Datensätze löschen" />
                                <p:divider/>
                                <p:commandButton image="addIcon" update="pnlAssignInv" oncomplete="dlgAssignInv.show()" title="hinzufügen" />
                            </p:toolbarGroup>
                        </p:toolbar>
                    </f:facet>

                </p:dataTable>

                <p:confirmDialog message="Sollen wirklich alle markierten Bestandspositionen entfernt werden?" hideEffect="explode"
                                 header="Bestandspositionen entfernen" severity="alert" widgetVar="delInvConf" >
                    <p:commandButton value="Ja" update="invTab,growl" oncomplete="delInvConf.hide()"
                                     actionListener="#{invInventory.deleteInvAll}" />
                    <p:commandButton value="Nein" onclick="delInvConf.hide()" type="button" />
                </p:confirmDialog>

                

                <p:dialog header="Neue Bestandsposition(en) definieren" widgetVar="dlgAssignInv" closeListener="#{invInventory.handleNewDlgClose}" position="center" resizable="true" minWidth="700" height="700" >
                    <p:panel id="pnlNewInv" header="Farbe(n) wählen" >
                        <h:panelGrid columns="2" styleClass="dlgCommon" style="margin-bottom: 10px">
                            <h:outputLabel value="Artikel-Nr."></h:outputLabel>
                            <h:inputText value="#{invInventory.tmpNewInvForArtId}"/>
                            <h:outputLabel value="Mat.Id" ></h:outputLabel>
                            <h:selectOneMenu value="#{invInventory.tmpNewInvForMatId}" >
                                <f:selectItems value="#{applicationBean.listMaterials}" var="item" itemLabel="#{item.matId}: #{item.matDesc}" itemValue="#{item.matId}" />
                            </h:selectOneMenu>
                            <h:outputLabel value="GrößeId" ></h:outputLabel>
                            <h:selectOneMenu value="#{invInventory.tmpNewInvForVarId}" >
                                <f:selectItems value="#{applicationBean.listSizes}" var="item" itemLabel="#{item.producerId.producerName} Id: #{item.sizeId}  |  #{item.size2}  |  #{item.size3}" itemValue="#{item.sizeId}" />
                            </h:selectOneMenu>
                            <p:commandButton value="zugeordnete Farben anzeigen" actionListener="#{invInventory.setNewVariantcolorList}" update="pnlVariantcolorTemplateTab"/>
                        </h:panelGrid>
                        <h:panelGrid id="pnlVariantcolorTemplateTab">
                            <p:dataTable id="variantcolorTemplateTab" var="variantcolor" value="#{invInventory.tmpNewInvForVcs}" selection="#{invInventory.tmpNewSelectedVcs}"
                                         selectionMode="multiple" emptyMessage="Es wurden keine Farben gefunden." style="font-size: 10px; width: 100%;"  >

                                <f:facet name="header">
                                    Farben-Zuordnung
                                </f:facet>
                                <p:column headerText="ArtNr." styleClass="tabColumnStd" >
                                    <h:outputText value="#{variantcolor.variantcolorPK.AId}" styleClass="tabColumnVal" />
                                </p:column>
                                <p:column headerText="ArtName" styleClass="tabColumnStd" >
                                    <h:outputText value="#{variantcolor.variant.articlemat.article.AName}" styleClass="tabColumnVal" />
                                </p:column>

                                <p:column headerText="Mat.Id" styleClass="tabColumnStd">
                                    <h:outputText value="#{variantcolor.variantcolorPK.matId}" styleClass="tabColumnVal" />
                                </p:column>
                                <p:column headerText="GrößeId" styleClass="tabColumnStd">
                                    <h:outputText value="#{variantcolor.variantcolorPK.varId}" styleClass="tabColumnVal" />
                                </p:column>
                                <p:column headerText="FarbeId" styleClass="tabColumnStd">
                                    <h:outputText value="#{variantcolor.variantcolorPK.colorId}" styleClass="tabColumnVal" />
                                </p:column>
                                <p:column headerText="FarbeName" styleClass="tabColumnStd">
                                    <h:outputText value="#{variantcolor.color.colordescList[0].colorName}" styleClass="tabColumnVal" />
                                </p:column>

                            </p:dataTable>
                        </h:panelGrid>

                        <h:panelGrid columns="2">
                            <h:outputLabel value="Lagerort" ></h:outputLabel>
                            <h:selectOneMenu value="#{invInventory.tmpNewInvForLocId}">
                                <f:selectItems value="#{applicationBean.listInvlocations}" var="item" itemLabel="#{item.locId}: #{item.locName}" itemValue="#{item.locId}" />
                            </h:selectOneMenu>

                            <h:outputLabel value="Bestand"></h:outputLabel>
                            <h:inputText value="#{invInventory.tmpNewInvNb}"/>
                        </h:panelGrid>

                        <p:commandButton value="neue Bestandspositionen für ausgewählte Farben erstellen" title="neue Betandspositionen erstellen" actionListener="#{invInventory.setNewInv}" update="invTab,growl" oncomplete="dlgAssignInv.hide()" />

                    </p:panel>
                </p:dialog>

            </h:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>

Here is a - even less complex - page is not working and throws the above mentioned exception:

Code: Select all

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/template.xhtml">

    <ui:define name="head">

    </ui:define>

    <ui:define name="body">

        <h:form prependId="false">
            
            <p:growl id="growl" showDetail="true" life="5000" />

            <h:panelGrid style="margin-top: 5px; margin-bottom: 5px">
                <h:outputLabel value="Bestandsführung > Bestandsführung > Lagerorte definieren" style="font-size: 12px;" />
            </h:panelGrid>

            <h:panelGrid>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="resources/images/sysImg/ajaxloading.gif" />
                    </f:facet>

                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>

                <p:dataTable id="invlocTab" var="invloc" value="#{invInvlocation.invlocList}" selection="#{invInvlocation.selectedInvlocs}"
                             selectionMode="multiple" emptyMessage="Es wurden keine Lagerorte gefunden." paginator="true"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="10,20,50"  paginatorAlwaysVisible="false" rows="10" style="font-size: 10px; width: 100%;"  >

                    <f:facet name="header">
                        Stammdaten: Lagerorte
                    </f:facet>

                    <p:column headerText="LagerortId" styleClass="tabColumnStd">
                        <h:outputText binding="#{invInvlocation.selectedInvlocIdComp}" value="#{invloc.locId}" styleClass="tabColumnVal" />
                    </p:column>
                    <p:column headerText="Lagerort Name" >
                        <h:inputText size="30" value="#{invloc.locName}" styleClass="tabColumnVal" />
                    </p:column>

                    <p:column>
                        <p:commandButton id="btnApplyInvloc" image="tickIcon" actionListener="#{invInvlocation.applyInvlocation}" update="invlocTab,growl" title="Änderungen übernehmen" style="font-size: 8px" />
                    </p:column>


                    <f:facet name="footer">
                        <p:toolbar style="font-size: 10px;" >
                            <p:toolbarGroup align="center">
                                <p:commandButton value="markierte löschen" image="deleteIcon" onclick="delInvlocConf.show();" title="markierte Datensätze löschen" />
                                <p:divider/>
                                <p:commandButton image="addIcon" actionListener="#{invInvlocation.prepareNewInvloc}" update="pnlAssignInvloc" oncomplete="dlgAssignInvloc.show()" title="hinzufügen" />
                            </p:toolbarGroup>
                        </p:toolbar>
                    </f:facet>

                </p:dataTable>

                <p:confirmDialog message="Sollen wirklich alle markierten Lagerorte entfernt werden?" hideEffect="explode"
                                 header="Lagerorte entfernen" severity="alert" widgetVar="delInvlocConf" >
                    <p:commandButton value="Ja" update="invlocTab,growl" oncomplete="delInvlocConf.hide()"
                                     actionListener="#{invInvlocation.deleteInvlocAll}" />
                    <p:commandButton value="Nein" onclick="delInvlocConf.hide()" type="button" />
                </p:confirmDialog>

                <p:dialog header="Neuen Lagerort definieren" widgetVar="dlgAssignInvloc" closeListener="#{invInvlocation.handleNewDlgClose}" position="center" resizable="true" minWidth="700" height="500" >
                    <p:panel id="pnlAssignInvloc">
                        <h:panelGrid id="pnlNewInvloc" rendered="#{invInvlocation.renderPnlNewInvloc}" columns="2" style="width: 400px">
                            <h:outputText value="LagerortId"  />
                            <h:outputText value="#{invInvlocation.newInvloc.locId}"  />
                            <h:outputText value="Lagerort Name *" />
                            <h:inputText size="30" value="#{invInvlocation.newInvloc.locName}"  />
                        </h:panelGrid>
                        <p:commandButton value="speichern" actionListener="#{invInvlocation.setNewInvloc}"  update="invlocTab,growl" oncomplete="dlgAssignInvloc.hide()"/>
                    </p:panel>
                </p:dialog>

            </h:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>
The exception occurs on the second page if you either show the "dlgAssignInvloc" dialog (i. e. the second one in the source) or if you click the first commandButton of the confirmationDialog (this is strange because exactly the same dialog works on the first page I posted above).

Any ideas on that issue are very appriciated!
Martin

smallya
Posts: 264
Joined: 19 Mar 2010, 19:22
Contact:

07 Feb 2011, 22:19

Cagatay
I just upgraded to PF2.2 and I still get that aforementioned Array Out of Bounds issue (which does not come in PF2.2 CR)

SEVERE: javax.faces.FacesException: Unexpected error restoring state for component with id j_idt8. Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:250)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:147)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1476)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:234)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:284)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:161)
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1428)
at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:242)
... 39 more

All I am doing is Drag and Drop from a DataGrid and adding that item to a List which is displayed using DataTable. The weird thing is it works just fine with PF2.2CR. Also if you notice the error does not point to any of my code yet so it is happening in the layer below.

As for my code here it is

<p:droppable for="shoppingList" tolerance="touch" activeStyleClass="ui-state-highlight" datasource="productGrid"
dropListener="#{shoppingController.onDrop}" onDropUpdate="shoppingListPanel productGridPanel" onDrop="handleDrop"/>

that invokes dropListener

public void onDrop(DragDropEvent ddEvent){
addToShoppingList((Product) ddEvent.getData());
}

public void addToShoppingList(Product product){
setSelectedProduct(product);
ListContent row = new ListContent();
Timestamp sqlDate = new Timestamp(new java.util.Date().getTime());
if (shoppingList.getListId() != null && shoppingList.getListId() > 0) {
row.setUserList(shoppingList);
}
row.setProduct(selectedProduct);
row.setUom(selectedProduct.getDefaultUnitCode());
row.setBoughtFlag("N");
row.setCreatedBy(currentUser.getUserId());
row.setCreatedDate(sqlDate);
row.setModifiedBy(currentUser.getUserId());
row.setModifiedDate(sqlDate);
row.setQuantity(1);
row.setUserList(shoppingList);
if (shoppingList.getListContentList() == null){
List<ListContent> newList = new ArrayList<ListContent>();
newList.add(row);
shoppingList.setListContentList(newList);
} else {
shoppingList.getListContentList().add(row);
}
/* now that you have added the item to the list remove it from the grid */
relatedProducts.remove(selectedProduct);
if (productFilter != null){
productFilter=null;
}
}

pretty vanilla stuff just like the one in the showcase. The error occurs when I drag-and-drop or when I try to do pagination by clicking the page index of a particular page in the paginator.

Any help here is appreciated.
Netbeans 7.2| GlassFish 3.2 | PostgreSQL 9.1| MongoDB | Primefaces 3.4.2
_______________________________________________________________
Subraya Mallya
http://tinyhabit.com |http://twitter.com/tinyhabit

averabaq
Posts: 1
Joined: 02 Dec 2010, 01:23

08 Feb 2011, 09:49

I am also facing the same problem in my project. With primefaces 2.2.RC2 everything goes fine except for the issue 1534 which was solved in this release, so I am forced to upgrade my project to 2.2. Any clear on this issue would be really greatly appreciated.

Cheers

Alejandro.

User avatar
imanol
Posts: 20
Joined: 04 Nov 2010, 13:16

08 Feb 2011, 11:42

edited, sorry, my fault.
Last edited by imanol on 09 Feb 2011, 08:56, edited 1 time in total.

smallya
Posts: 264
Joined: 19 Mar 2010, 19:22
Contact:

08 Feb 2011, 18:24

imanol,
you might want to open a different ticket as your issue is different - not the ArrayOutofBounds issue we are facing.
Netbeans 7.2| GlassFish 3.2 | PostgreSQL 9.1| MongoDB | Primefaces 3.4.2
_______________________________________________________________
Subraya Mallya
http://tinyhabit.com |http://twitter.com/tinyhabit

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 Feb 2011, 00:27

Please provide a simple page for us to replicate the arrayoutofbounds issue.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests