Hi,

I have the same problem with DynaActionForm (getting NullPointerException)
with just text fields.

Can anyone help to sort it out ?

Thanks
kirusshna

-----Original Message-----
From: Jeff Born [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 11:05 AM
To: Struts Users Mailing List (E-mail)
Subject: DynaActionForm and ImageButtonBean

I've been using the ImageButtonBean described by Ted Husted and have had
great success with it.

I now am attempting to use it in a DynaActionForm with no success.  I keep
getting a NullPointerException which I've tracked down to the following
lines:

DynaActionForm form = (DynaActionForm) baseForm;

// hb gets set to a null.
ImageButtonBean hb = (ImageButtonBean) form.get("homeButton");
// hb gets set to a null so hb.isSelected() doesn't work.

if (hb.isSelected())
{
        return "tile.home";
}



my form-bean looks like the following:
    <form-bean name="headerForm"
               type="org.apache.struts.action.DynaActionForm">
      <form-property name="actionClass" type="java.lang.String"/>

      <form-property name="homeButton"
type="com.gr.struts.ImageButtonBean"/>
      <form-property name="loginButton"
type="com.gr.struts.ImageButtonBean"/>
    </form-bean>

and my action mapping looks like so:
    <action path="/header"
            type="com.gr.struts.HeaderAction"
            name="headerForm"
            input="/header.jsp"
            validate="true">
      <forward name="home" path="tile.main" />
      <forward name="login" path="tile.loginInput" />
      <forward name="error" path="tile.error" />
    </action>

Any tips or tricks would be greatly appreciated,

jb

PS I've searched through the archive and found a lot of information about
ArrayLists, but not another class all together.  If there is a previous
thread that answers my question could someone point me in the right
direction?

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to