thanks again arnaud.. still no joy

property="<%= coverDetailsForm.getSequence() %>"

picks up the dynamic value I set on the form, but it checks for the
evaluated value
on the form and complains that it can't find it..

e.g. (just using the scriptlet here for ease of use)

<% String dynamicValue = "lookup#"+idx;
     coverDetailsForm.setSequence(dynamicValue);
%>
<html:select property="<%= coverDetailsForm.getSequence() %>" />

results in a

No getter method available for property lookup#3 for bean under name
coverDetailsForm


have a good holiday!
anyone else help??

James



------------------------------

Date: Thu, 9 Aug 2001 14:28:42 +0200
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
From: =?us-ascii?Q?Heritier_Arnaud?= <[EMAIL PROTECTED]>
Subject: RE: RE: dynamically setting the html:select property
Message-Id: <[EMAIL PROTECTED]>

Hello !

      1st problem :

You shouln't write :
<html:select property="<%= "lookup#" +idx %>" />" >
but
<html:select property="<%= \"lookup#\" +idx %>" />" >
because the Tag interpretor shouldn't see double quotes on both sides of
the "lookup#" String.

Another solution that I didn't test is to use simple quotes like this.
<html:select property='<%= "lookup#" +idx %>' />" >

2nd problem :

      The attribute "property" oh the html:select tag represents the "name
of the request parameter that will be included with this submission".
      So this value is used as a name of parameter of the request sent to
the server.

     If you want to dynamically generate the name of this parameter from
the value of your Form Bean you should write something like that:

     <jsp:useBean name="coverDetailsForm" scope="request">
      <html:form .......

     <html:select property="<%=coverDetailsForm.getSequence()%>" />

     </html:form>
     </jsp:useBean>

In 1H30 I'm on holiday, so I wish it will help you.

good luck

      arnaud

-----Message d'origine-----
De:  [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Date:     jeudi 9 aout 2001 12:26
A:   [EMAIL PROTECTED]
Objet:    RE: RE: dynamically setting the html:select property

thanks arnaud,

still having problems with the property attribute of the select tag.

I tried
<html:select property="<%= "lookup#" +idx %>" />" >

but it seems to need to be pointing at an attribute of a bean otherwise it
complains;

Attribute lookup# has no value

It appears as though the property has to match an attribute on an object
somewhere..

so I set an attribute on my form to "sequence" and then try to access that
in an
expression. If I do

<html:select property="sequence" />
it just prints the name of the select as "sequence", it doesn't evaluate
it.

If I try
<html:select property="<%= coverDetailsForm.getSequence() %>" />" >
it complains

Undefined variable or class name: coverDetailsForm

how do I get the property to be set to a value from the form, not just the
name?

thanks..

James

------------------------------------------------------------------------
-------

Date: Wed, 8 Aug 2001 15:11:03 +0200
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
From: =?us-ascii?Q?Heritier_Arnaud?= <[EMAIL PROTECTED]>
Subject: RE: dynamically setting the html:select property
Message-Id: <[EMAIL PROTECTED]>

When you use a parameter of a tag, it should be a text or a regexp.
if you write <html:select property="lookup#<%= idx %>" > the tag
interpretor will see the string "lookup#" and suppose that the parameter
shouldn't be evaluated.
To do this you should write this : <html:select
property="<%=\"lookup#+idx\"%>" >

arnaud

-----Message d'origine-----
De:  [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Date:     mercredi 8 aout 2001 14:31
A:   [EMAIL PROTECTED]
Objet:    dynamically setting the html:select property

Hi there,

inside an iterate tag I'm creating multiple textboxes and selects.

to unqiuely identify each item I am appending the index from the iteration
(idx) to the name; e.g.

<input type="text" name="rate#<bean:write name="idx"/>" maxlength="10"
value="<bean:write name="limitBean" property="rate" />">

I also need to do this for drop down selections. However I'm having some
problems with naming the selects dynamically.

<html:select property="lookup#<%= idx %>" >

didn't work, the result was <select name="lookup#<%= idx %>" >

I also tried setting an attribute on my form

<jsp:setProperty name="coverDetailsForm" property="lookupIdx" value="<%=
idx %>" />
                <html:select property="coverDetailsForm.lookupIdx" value="
<%= limitBean.getLimit().getLookupDataId().toString() %>" >
                     <html:options name="limitBean" property="values"
labelName="limitBean" labelProperty="labels"/>
               </html:select>

the result was <select name="coverDetailsForm.lookupIdx" >

I've had to resort to scriptlets, please help..

thanks James

Reply via email to