You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by noah <ia...@gmail.com> on 2007/03/22 22:43:24 UTC

tr:table detailStamp containing tr:table - ClassCastException showing details

Same song, different verse. This time I'm trying to have a tr:table
inside the detailStamp.

This one is a class cast exception because a Facelets something was
passed to restoreRowState. I have a workaround patch, but since I'm
not familiar with the full body of the code, it's probably not
something that should be applied.

details:
https://issues.apache.org/jira/browse/ADFFACES-425

I can get different Facelets classes with slight modifications, but
the error is always in restoreRowState.  I believe nesting tr:iterator
will also produce a similar error.

Error on DemoNavigationItem.

Posted by "Correa, Luis Henrique" <lu...@eds.com>.
 Hi everybody , I'm having a trouble to create a navigationPane which changes the color of commandNavigationMenuItem when I select the item.
Here is my css .
.af_navigationPane_list-inactive-enabled{
    width:150px;
    list-style-type: none;
    float: none;
    vertical-align: top;
    background: #F7F5ED;
    border-top: 1px solid #fff;
    text-decoration: none;
    color: #000;
    text-align: center;
}

.af_navigationPane_list-inactive-enabled a:hover{
    background:#E0DDD5;
    border-right: 4px solid #9D102D;
    border-left: 4px solid #9D102D;
    border-bottom: 1px solid #C1BBAB;
    border-top: none;
    display: block;
    width:150px;
    text-align: center;
}

.af_navigationPane_list-active-enabled a{
    width:150px;
    background:  #9D102D;
    border-top: 1px solid #fff;
    text-decoration: none;
    color: #fff;
    text-align: center;
}

My class of MenuNavigationItem 

package com.eds.bprm.view.action.action;

import java.util.List;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.component.UIXCommand;
import org.apache.myfaces.trinidad.component.UIXNavigationHierarchy;
import org.apache.myfaces.trinidad.context.RequestContext;

public class MenuNavigationItem
{
public void navigationItemAction(ActionEvent event)
{
    UIComponent actionItem = event.getComponent();
    UIComponent parent = actionItem.getParent();
    while(!(parent instanceof UIXNavigationHierarchy))
    {
        parent = parent.getParent();
        if(parent == null)
        {
            System.err.println("Unexpected component hierarchy, no UIXNavigationHierarchy found.");
            return;
        }
    }

    List<UIXCommand> children = parent.getChildren();
    for(UIXCommand child: children)
    {
        FacesBean childFacesBean = child.getFacesBean();
        FacesBean.Type type = childFacesBean.getType();
        PropertyKey selectedKey = type.findKey("selected");
        if(selectedKey != null)
        {
            childFacesBean.setProperty(selectedKey, Boolean.valueOf((child == actionItem)));
        }
    }
    RequestContext adfContext = RequestContext.getCurrentInstance();
    adfContext.addPartialTarget(parent);
}
}

And my jsp menu.

<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<tr:form>
  <tr:navigationPane hint="list">
    <tr:commandNavigationItem text="#{bundle[\'menuRegister.menuParametersItem\']}"
                              action="parameter"
                              actionListener="#{navigationItem.navigationItemAction}"
                              partialSubmit="true"/>
    <tr:commandNavigationItem text="#{bundle[\'menuRegister.menuIOFRegistry\']}"
                              action="iofRegister"
                              actionListener="#{navigationItem.navigationItemAction}"
                              partialSubmit="true"/>
    <tr:commandNavigationItem text="#{bundle[\'menuRegister.menuUserProfile\']}"
                              action="userProfile"
                              actionListener="#{navigationItem.navigationItemAction}"
                              partialSubmit="true"/>
    <tr:commandNavigationItem text="#{bundle[\'menuRegister.menuAlcadaProfile\']}"
                              action="alcadaProfile"
                              actionListener="#{navigationItem.navigationItemAction}"
                              partialSubmit="true"/>
  </tr:navigationPane>
</tr:form>

So when I choose one item in menu , the color doesn't change , I don't know what I'm doing wrong because this example 
is similar with the DemoNavigationItem , anyone can help me ?
Thanks



Luís Henrique Zerba Corrêa
EDS - Brazil - SP Java CoE 
* 55 11 43931063
* luishenrique.correa@eds.com


Re: tr:table detailStamp containing tr:table - ClassCastException showing details

Posted by Adam Winer <aw...@gmail.com>.
Darnit. :)

I was hoping you were doing something other than the
usual.  Anyway, time to start debugging.

-- Adam


On 4/12/07, noah <ia...@gmail.com> wrote:
> Client.
>
> On 4/11/07, Adam Winer <aw...@gmail.com> wrote:
> > Question for you - what state saving method are you
> > using?  (Server or client)
> >
> > -- Adam
> >
> >
> >
> > On 3/23/07, noah <ia...@gmail.com> wrote:
> > > I'm finding my patches don't help when I add other components. Just
> > > more index out of bounds exceptions and class cast exceptions,
> > > probably because I didn't fix the right thing.
> > >
> > > Does anyone know where things need to actually be fixed?  It seems
> > > like it has something to do with Facelets components saving state that
> > > is not being accounted for, but that's just a guess. Any help? I'd
> > > love to track it down, but I don't have the time to get up to speed on
> > > all the relevant code on my own right now.
> > >
> > > On 3/22/07, noah <ia...@gmail.com> wrote:
> > > > Same song, different verse. This time I'm trying to have a tr:table
> > > > inside the detailStamp.
> > > >
> > > > This one is a class cast exception because a Facelets something was
> > > > passed to restoreRowState. I have a workaround patch, but since I'm
> > > > not familiar with the full body of the code, it's probably not
> > > > something that should be applied.
> > > >
> > > > details:
> > > > https://issues.apache.org/jira/browse/ADFFACES-425
> > > >
> > > > I can get different Facelets classes with slight modifications, but
> > > > the error is always in restoreRowState.  I believe nesting tr:iterator
> > > > will also produce a similar error.
> > > >
> > >
> >
>

Re: tr:table detailStamp containing tr:table - ClassCastException showing details

Posted by noah <ia...@gmail.com>.
Client.

On 4/11/07, Adam Winer <aw...@gmail.com> wrote:
> Question for you - what state saving method are you
> using?  (Server or client)
>
> -- Adam
>
>
>
> On 3/23/07, noah <ia...@gmail.com> wrote:
> > I'm finding my patches don't help when I add other components. Just
> > more index out of bounds exceptions and class cast exceptions,
> > probably because I didn't fix the right thing.
> >
> > Does anyone know where things need to actually be fixed?  It seems
> > like it has something to do with Facelets components saving state that
> > is not being accounted for, but that's just a guess. Any help? I'd
> > love to track it down, but I don't have the time to get up to speed on
> > all the relevant code on my own right now.
> >
> > On 3/22/07, noah <ia...@gmail.com> wrote:
> > > Same song, different verse. This time I'm trying to have a tr:table
> > > inside the detailStamp.
> > >
> > > This one is a class cast exception because a Facelets something was
> > > passed to restoreRowState. I have a workaround patch, but since I'm
> > > not familiar with the full body of the code, it's probably not
> > > something that should be applied.
> > >
> > > details:
> > > https://issues.apache.org/jira/browse/ADFFACES-425
> > >
> > > I can get different Facelets classes with slight modifications, but
> > > the error is always in restoreRowState.  I believe nesting tr:iterator
> > > will also produce a similar error.
> > >
> >
>

Re: tr:table detailStamp containing tr:table - ClassCastException showing details

Posted by Adam Winer <aw...@gmail.com>.
Question for you - what state saving method are you
using?  (Server or client)

-- Adam



On 3/23/07, noah <ia...@gmail.com> wrote:
> I'm finding my patches don't help when I add other components. Just
> more index out of bounds exceptions and class cast exceptions,
> probably because I didn't fix the right thing.
>
> Does anyone know where things need to actually be fixed?  It seems
> like it has something to do with Facelets components saving state that
> is not being accounted for, but that's just a guess. Any help? I'd
> love to track it down, but I don't have the time to get up to speed on
> all the relevant code on my own right now.
>
> On 3/22/07, noah <ia...@gmail.com> wrote:
> > Same song, different verse. This time I'm trying to have a tr:table
> > inside the detailStamp.
> >
> > This one is a class cast exception because a Facelets something was
> > passed to restoreRowState. I have a workaround patch, but since I'm
> > not familiar with the full body of the code, it's probably not
> > something that should be applied.
> >
> > details:
> > https://issues.apache.org/jira/browse/ADFFACES-425
> >
> > I can get different Facelets classes with slight modifications, but
> > the error is always in restoreRowState.  I believe nesting tr:iterator
> > will also produce a similar error.
> >
>

Re: tr:table detailStamp containing tr:table - ClassCastException showing details

Posted by noah <ia...@gmail.com>.
I'm finding my patches don't help when I add other components. Just
more index out of bounds exceptions and class cast exceptions,
probably because I didn't fix the right thing.

Does anyone know where things need to actually be fixed?  It seems
like it has something to do with Facelets components saving state that
is not being accounted for, but that's just a guess. Any help? I'd
love to track it down, but I don't have the time to get up to speed on
all the relevant code on my own right now.

On 3/22/07, noah <ia...@gmail.com> wrote:
> Same song, different verse. This time I'm trying to have a tr:table
> inside the detailStamp.
>
> This one is a class cast exception because a Facelets something was
> passed to restoreRowState. I have a workaround patch, but since I'm
> not familiar with the full body of the code, it's probably not
> something that should be applied.
>
> details:
> https://issues.apache.org/jira/browse/ADFFACES-425
>
> I can get different Facelets classes with slight modifications, but
> the error is always in restoreRowState.  I believe nesting tr:iterator
> will also produce a similar error.
>