struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Moseley <...@covalent.net>
Subject ImageBeanButton attributes not populated
Date Wed, 25 Dec 2002 03:14:12 GMT

having read the tip about ImageButtonBean, i decided to give it a go
with one of my forms. i added the relevant properties and accessor
methods to my form [actually to a superclass of my form] (shown below)
and changed the properties of each button in the associated jsp (i'm
using several <html:image> elements) to "cancel", "ok", and "reset".

when i click any of the buttons, even tho "ok.x=24" and "ok.y=15" are
being passed as request parameters, the form population is failing to
set the associated attributes on the various ImageButtonBean objects.
below i've included relevant trace data.

i certainly wasn't expecting to see "Target bean = false". i waded
through the BeanUtils source code, but i got lost in the
PropertyDescriptor mess. anyway, i'm betting i got something simple
wrong in the struts layer.

i thought there might have been an introspection problem since the form
bean that's instantiated by struts is actually a subclass of SpiderForm,
but i copied and pasted the attributes and methods into the subclass and
got the same result- no go.

any ideas where i might have flubbed? thanks!

* trace data from server log:

2002-12-24 14:32:19,404 DEBUG [org.apache.commons.beanutils.BeanUtils]
   setProperty(cancel=ImageButtonBean[null, null]
ok=ImageButtonBean[null, null] reset=ImageButtonBean[null, null] id=null
cpuCount=null cpuSpeed=null customProperties={null} description=null
dhcpServer=null dnsServer=null gateway=null ipAddress=null location=null
macAddress=null machineType=null name=null ram=null subnet=null , ok.y,
[15])
2002-12-24 14:32:19,404 DEBUG [org.apache.commons.beanutils.BeanUtils]
     Target bean = false
2002-12-24 14:32:19,405 DEBUG [org.apache.commons.beanutils.BeanUtils]
     Target name = y

* SpiderForm.java:

      //-------------------------------------instance variables

      private ImageButtonBean cancel;
      private ImageButtonBean ok;
      private ImageButtonBean reset;

      //-------------------------------------constructors

      public SpiderForm() {
          super();
          this.cancel = new ImageButtonBean();
          this.ok = new ImageButtonBean();
          this.reset = new ImageButtonBean();
      }

      //-------------------------------------public methods

      public void setCancel(ImageButtonBean cancel) {
          this.cancel = cancel;
      }

      public ImageButtonBean getCancel() {
          return this.cancel;
      }

      public void setOk(ImageButtonBean ok) {
          this.ok = ok;
      }

      public ImageButtonBean getOk() {
          return this.ok;
      }

      public void setReset(ImageButtonBean reset) {
          this.reset = reset;
      }

      public ImageButtonBean getReset() {
          return this.reset;
      }



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message