You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ulrich Winter <ul...@gmx.de> on 2002/12/16 16:59:02 UTC

idName seems to affect current form bean

Hi,

I'm iterating to create some <html:radio> inputs.
The form bean has one property searchType which is to receive the
radio selection.
In addition to that it contains a property searchTypes which is a Map which
holds the allowed values and the corresponding labels.

Now, the following works fine:

<html:form action="/searchUsers" >
  <logic:iterate id="radioID"
    name="searchUsersForm" property="searchTypes" type="java.util.Map.Entry"
>

    <html:radio property="searchType" value="<%=(String)radioID.getKey()%>">
      <bean:write name="radioID" property="value"/>
    </html:radio>
...

But I want to avoid the scriptlet and therefore used the idName attribute of
<html:radio>:
<html:form action="/searchUsers" >
  <logic:iterate id="radioID"
    name="searchUsersForm" property="searchTypes" type="java.util.Map.Entry"
>

    <html:radio property="searchType" idName="radioID" value="<key>">
      <bean:write name="radioID" property="value"/>
    </html:radio>
...

But that results in the following error:
[ServletException in:/UserAdmin/SearchUsers.jsp] No getter method available
for property searchType for bean under name
org.apache.struts.taglib.html.BEAN'

As I understand the documentation, the idName attribute should only affect
the handling of the
"value" attribute. Correct?
But in this case, the form bean seems to be hidden by the current iteration
element.

Is this behavior as intended?
If yes, what am I doing wrong?

BTW: I'm using struts 1.1-b2

Thanks,
Uli

--
ulrich.winter@gmx.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: idName seems to affect current form bean

Posted by Ulrich Winter <ul...@gmx.de>.
Oops, there's a typo in the second example:
It correctly reads "key" instead of "<key>", but nevertheless the error
occurs.
(Thanks to juraj for this hint.)

     <html:radio property="searchType" idName="radioID" value="key">


----- Original Message -----
From: "Ulrich Winter" <ul...@gmx.de>
To: <st...@jakarta.apache.org>
Sent: Monday, December 16, 2002 4:59 PM
Subject: idName seems to affect current form bean


> Hi,
>
> I'm iterating to create some <html:radio> inputs.
> The form bean has one property searchType which is to receive the
> radio selection.
> In addition to that it contains a property searchTypes which is a Map
which
> holds the allowed values and the corresponding labels.
>
> Now, the following works fine:
>
> <html:form action="/searchUsers" >
>   <logic:iterate id="radioID"
>     name="searchUsersForm" property="searchTypes"
type="java.util.Map.Entry"
> >
>
>     <html:radio property="searchType"
value="<%=(String)radioID.getKey()%>">
>       <bean:write name="radioID" property="value"/>
>     </html:radio>
> ...
>
> But I want to avoid the scriptlet and therefore used the idName attribute
of
> <html:radio>:
> <html:form action="/searchUsers" >
>   <logic:iterate id="radioID"
>     name="searchUsersForm" property="searchTypes"
type="java.util.Map.Entry"
> >
>
>     <html:radio property="searchType" idName="radioID" value="<key>">
>       <bean:write name="radioID" property="value"/>
>     </html:radio>
> ...
>
> But that results in the following error:
> [ServletException in:/UserAdmin/SearchUsers.jsp] No getter method
available
> for property searchType for bean under name
> org.apache.struts.taglib.html.BEAN'
>
> As I understand the documentation, the idName attribute should only affect
> the handling of the
> "value" attribute. Correct?
> But in this case, the form bean seems to be hidden by the current
iteration
> element.
>
> Is this behavior as intended?
> If yes, what am I doing wrong?
>
> BTW: I'm using struts 1.1-b2
>
> Thanks,
> Uli
>
> --
> ulrich.winter@gmx.de
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>