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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to