myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mick Knutson" <mickknut...@gmail.com>
Subject need help editing a row of data.
Date Tue, 27 Feb 2007 00:03:25 GMT
I have a dataTable that has a list of users:

            <t:dataTable value="#{userBackingBean.users}"
                         var="user"
                         preserveDataModel="false"
                         styleClass="users"
                         headerClass="usersHeader"
                         rowClasses="evenRow, oddRow"
                         columnClasses="username,name"
                         border="0"
                    >
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{messages['label.username
']}"/>
                    </f:facet>

                    [<h:commandLink>
                        <f:actionListener type="
com.baselogic.tro.user.impl.UserActionListener"/>
                        <h:outputText value="#{user.username}"/>

</h:commandLink><bl:nbsp/>]<bl:nbsp/><bl:nbsp/><bl:nbsp/>


When I click this link, I get sent to
com.baselogic.tro.user.impl.UserActionListener.processAction:

    public void processAction(ActionEvent anEvent)
            throws AbortProcessingException {
        log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
        log.info("processAction(ActionEvent anEvent)");
        log.info("++++++++++++++++++++++++++++++++++++++++++++++++++++++");

        User tmpUserBean = null;

        UIComponent tmpComponent = anEvent.getComponent();

        while (null != tmpComponent && !(tmpComponent instanceof UIData)) {
            log.info
("---------------while----------------------------------");
            tmpComponent = tmpComponent.getParent();
        }

        if (tmpComponent != null && (tmpComponent instanceof UIData)) {
            Object tmpRowData = ((UIData) tmpComponent).getRowData();
            if (tmpRowData instanceof User) {
                tmpUserBean = (User) tmpRowData;

                //TODO Implementation of your method
                log.info
("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
                log.info("tmpUserBean.toString(): " + tmpUserBean.toString
());
                log.info
("++++++++++++++++++++++++++++++++++++++++++++++++++++++");

            }
        }

        //TODO Exception Handling if UIData not found or tmpRowBean of wrong
type


tmpUserBean prints the row I was expecting, but now I do not know how to get
tmpUserBean in the request and sent back to userDetail.xhtml


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/djmick_dot_com
http://www.thumpradio.com
---

Mime
View raw message