You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andreas Hartmann <an...@freenet.de> on 2006/05/05 21:50:02 UTC

How do I insert a value from an id-iterate-bean into the value-tag of multibox?

Hello!

I've got in a jsp the following code:

<logic:iterate name="Portal" property="deaktserver" id="srv">
<html:multibox property="inaktmachines" value='<%= srv %>' />
</logic:iterate>

-> This does not work.


srv contains a string which I want to have as value of html:multibox. How
should it be written?


I would be glad to get a hint!
Kind regards,
Andreas Hartmann

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


Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

Posted by Andreas Hartmann <an...@freenet.de>.
Hello Rick,

Rick Reumann wrote:
> Andreas Hartmann wrote:
>> Hello Tarun,
>> 
>> Tarun Reddy wrote:
>>> Hi,
>>> You can do this way,
>>> <logic:iterate name="Portal" property="deaktserver" id="srv">
>>>     <html:multibox property="inaktmachines">
>>>           <bean:write name="srv" />
>>>     </html:multibox>
>>> </logic:iterate>
>>>
>>> This should work.
>> 
>> This produces an Unterminated &lt;html:multibox tag.
> 
> You sure you aren't missing the </html:multibox> ? Double check your typing.

My fault :-(. I didn't recognize the closing ">" after the property-value.
Now, it's working fine. Thank you to both, Tarun and Rick, for your great
help!

Is the component <bean:write name="srv" /> above used as nested body
content of the html:multibox tag?

>> Btw: the property deaktserver resolves to a
>> get/setDeaktserver() which gets or sets an ArrayList <String>.
> 
> I'm fairly certain your backing form bean property needs to be an array 
> (String[] typically) and not a List for a multibox. (I might be wrong, 
> though, but try changing it to String[] just to see.)

The get-/setDeaktserver backing form is used in the iterate-tag. The
backing form for the multibox is inaktmachines, which is an Array <String>.


Kind regards,
Andreas Hartmann


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


Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

Posted by Rick Reumann <ri...@gmail.com>.
Andreas Hartmann wrote:
> Hello Tarun,
> 
> Tarun Reddy wrote:
>> Hi,
>> You can do this way,
>> <logic:iterate name="Portal" property="deaktserver" id="srv">
>>     <html:multibox property="inaktmachines">
>>           <bean:write name="srv" />
>>     </html:multibox>
>> </logic:iterate>
>>
>> This should work.
> 
> This produces an Unterminated &lt;html:multibox tag.

You sure you aren't missing the </html:multibox> ? Double check your typing.

> 
> Btw: the property deaktserver resolves to a
> get/setDeaktserver() which gets or sets an ArrayList <String>.

I'm fairly certain your backing form bean property needs to be an array 
(String[] typically) and not a List for a multibox. (I might be wrong, 
though, but try changing it to String[] just to see.)

-- 
Rick
http://www.learntechnology.net

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


Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

Posted by Andreas Hartmann <an...@freenet.de>.
Hello Tarun,

Tarun Reddy wrote:
> Hi,
> You can do this way,
> <logic:iterate name="Portal" property="deaktserver" id="srv">
>     <html:multibox property="inaktmachines">
>           <bean:write name="srv" />
>     </html:multibox>
> </logic:iterate>
> 
> This should work.

This produces an Unterminated &lt;html:multibox tag.

Btw: the property deaktserver resolves to a
get/setDeaktserver() which gets or sets an ArrayList <String>.

Is there another way to do it?


Kind regards,
Andreas Hartmann


> 
> On 5/5/06, Andreas Hartmann <an...@freenet.de> wrote:
>>
>> Hello!
>>
>> I've got in a jsp the following code:
>>
>> <logic:iterate name="Portal" property="deaktserver" id="srv">
>> <html:multibox property="inaktmachines" value='<%= srv %>' />
>> </logic:iterate>
>>
>> -> This does not work.
>>
>>
>> srv contains a string which I want to have as value of html:multibox. How
>> should it be written?
>>
>>
>> I would be glad to get a hint!
>> Kind regards,
>> Andreas Hartmann




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


Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

Posted by Tarun Reddy <bt...@gmail.com>.
Hi,
You can do this way,
<logic:iterate name="Portal" property="deaktserver" id="srv">
    <html:multibox property="inaktmachines">
          <bean:write name="srv" />
    </html:multibox>
</logic:iterate>

This should work.

On 5/5/06, Andreas Hartmann <an...@freenet.de> wrote:
>
> Hello!
>
> I've got in a jsp the following code:
>
> <logic:iterate name="Portal" property="deaktserver" id="srv">
> <html:multibox property="inaktmachines" value='<%= srv %>' />
> </logic:iterate>
>
> -> This does not work.
>
>
> srv contains a string which I want to have as value of html:multibox. How
> should it be written?
>
>
> I would be glad to get a hint!
> Kind regards,
> Andreas Hartmann
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>