senthil Kumar wrote:
Hi All.,
I have a following statements. Here validStatus is the String[] property. It contains the value of " a,b,c,d". I am used Stringtokenizer.
Do you mean validStatus is an array of the Strings "a", "b", "c" and
"d", or a string array with one entry "a,b,c,d"? I'll assume you mean
that you used a StringTokenizer to create the 4-element array from the
simple string "a,b,c,d".
once executing this statement
<logic:iterate name="ProjectListForm" id="abcd" property='<%=
"projectListValue["+ctr+"].validStatus" %>' >
<bean:write name="abcd" />
</logic:itwerate>
it is print like " a b c d" .
I'm not sure what the projectListValue["+ctr+"] bit is about, but I'll
assume your form bean has an indexed property 'projectListValue and that
the individual elements of that indexed property are beans with a
validStatus property, which is of type String[].
Now i want to print he same result in drop down (listbox) like one by one.
<html:select name="ProjectListForm" property='<%= "projectListValue["+ctr+"].validStatus" %>'
styleClass="projectdetaillist" disabled = "false" >
<html:options name="ProjectListForm" property='<bean:write name="abcd">' />
</html:select>
But it is giving java script error. I cant find out what is the propblem. Can
any boy help me.
There are several things wrong here. First and foremost, you can't nest
JSP tags that way (i.e. you can't use a JSP tag to set the value of an
attribute on another JSP tag).
Secondly, the bean:write tag is referencing the scripting variable
'abcd', which you're not defining in this case.
Thirdly, you've set the html:select tag's 'property' attribute to point
to a property which (based on the above) is a String array, but you
haven't included multiple="true". Unless you want a multi-select, you
should be pointing to a String property rather than a String array
property here.
I *think* what you're trying to do is something like this:
<html:select property="currentSelection">
<html:options
property='<%="projectListValue["+ctr+"].validStatus"%>'/>
</html:select>
(Note that you don't need to explicitly specify the form with the 'name'
attribute, the html:* tags will automatically use the form bean
associated with the enclosing html:form tag).
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]