You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pls <ab...@hotmail.com> on 2004/06/02 09:06:51 UTC

multibox mayhem

I have one multibox per page on a few pages.
Each page name is represented by the 'key' property of a HashMap.
Each selected checkbox number is stored in Integer[]'s in the 'value'
property of a HashMap.

After selecting all of the checks, the user is forwarded to a
confirmation.jsp which displays the selections.
the code: (i removed table formatting for clarity)

<logic:iterate id="bean1" name="multiBoxForm" property="allofem">
           <bean:write name="bean1" property="key"/>
           <logic:iterate id="bean2" name="bean1" property="value">
                  <bean:write name="bean2" />
           </logic:iterate>
</logic:iterate>

this works fine to display the selections when they are read from the
original ActionForm.
i can update the db and then read them back which works fine too.
i have confirmed that i have a HashMap with the correct Integer[]'s from the
db inside,

however the same code as the previous
is located in profile.jsp and it returns the following JasperException:
"Cannot find bean bean2 in any scope"

Any ideas?  Thanks.




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


Re: multibox mayhem

Posted by Irfandhy Franciscus <en...@yahoo.com.sg>.
from this code : <bean:write name="bean1" property="key"/>

I guess that bean1 must be an object inside 'allofem'

So why are you trying to iterate an object :
<logic:iterate id="bean2" name="bean1" property="value">


pls wrote:
> i had to add <logic:empty> tags around the <bean:write name="bean2"/>
> because there were some trailing 'null' values in the Integer[] after
> reading from DB.
> 
> "pls" <ab...@hotmail.com> wrote in message
> news:c9ju9d$5l0$1@sea.gmane.org...
> 
>>I have one multibox per page on a few pages.
>>Each page name is represented by the 'key' property of a HashMap.
>>Each selected checkbox number is stored in Integer[]'s in the 'value'
>>property of a HashMap.
>>
>>After selecting all of the checks, the user is forwarded to a
>>confirmation.jsp which displays the selections.
>>the code: (i removed table formatting for clarity)
>>
>><logic:iterate id="bean1" name="multiBoxForm" property="allofem">
>>           <bean:write name="bean1" property="key"/>
>>           <logic:iterate id="bean2" name="bean1" property="value">
>>                  <bean:write name="bean2" />
>>           </logic:iterate>
>></logic:iterate>
>>
>>this works fine to display the selections when they are read from the
>>original ActionForm.
>>i can update the db and then read them back which works fine too.
>>i have confirmed that i have a HashMap with the correct Integer[]'s from
> 
> the
> 
>>db inside,
>>
>>however the same code as the previous
>>is located in profile.jsp and it returns the following JasperException:
>>"Cannot find bean bean2 in any scope"
>>
>>Any ideas?  Thanks.


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


Re: multibox mayhem

Posted by pls <ab...@hotmail.com>.
i had to add <logic:empty> tags around the <bean:write name="bean2"/>
because there were some trailing 'null' values in the Integer[] after
reading from DB.

"pls" <ab...@hotmail.com> wrote in message
news:c9ju9d$5l0$1@sea.gmane.org...
> I have one multibox per page on a few pages.
> Each page name is represented by the 'key' property of a HashMap.
> Each selected checkbox number is stored in Integer[]'s in the 'value'
> property of a HashMap.
>
> After selecting all of the checks, the user is forwarded to a
> confirmation.jsp which displays the selections.
> the code: (i removed table formatting for clarity)
>
> <logic:iterate id="bean1" name="multiBoxForm" property="allofem">
>            <bean:write name="bean1" property="key"/>
>            <logic:iterate id="bean2" name="bean1" property="value">
>                   <bean:write name="bean2" />
>            </logic:iterate>
> </logic:iterate>
>
> this works fine to display the selections when they are read from the
> original ActionForm.
> i can update the db and then read them back which works fine too.
> i have confirmed that i have a HashMap with the correct Integer[]'s from
the
> db inside,
>
> however the same code as the previous
> is located in profile.jsp and it returns the following JasperException:
> "Cannot find bean bean2 in any scope"
>
> Any ideas?  Thanks.




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