Hello dhay,

Wednesday, July 11, 2001, 12:07:13 AM, you wrote:

dlc> Have changed the LinkTag to allow users to specify the indexId.

dlc> After doing some more investigation, don't think your first suggestion, Oleg,
dlc> would ever come up.  If the user specifies the paramName, Id and property in a
dlc> link in a particular row in the table ie in your example:

>> <html:link forward="news" paramName="sell" parampProperty="when"
>> paramId="whenSell" includeIndex="yes"></html:index>

dlc> I believe the user will expect to simply see the sell.when value for that
dlc> iteration, which is what the current tag will do!  Thus the includeIndex (or
dlc> index=true), if this is their intention, is not necessary at all.

dlc> So...suggest that the only usage required will be:

dlc> <logic:iterate id="parameter" name="ParametersForm" property="parameterList">
dlc>    ...
dlc>    <html:link href="x" paramId="value" paramName="parameter"
dlc> paramProperty="value" indexed="true" indexId="recordNo">a</html:link>
dlc>    ...
dlc> </logic:iterate>

Ok, I agree with you.

dlc> which would produce (for the first iteration) the following link:

dlc> <a href="x?recordNo=0&value=Mac">a</a>

dlc> One question for you all - do we want to default the indexId to something (eg
dlc> "index=") or do I throw an exception if index="true" is specified without
dlc> indexId?

Default parameter name is good idea, for my mind.

dlc> Should then be ready to submit code...

dlc> Cheers,

dlc> Dave

dlc> "Martin Cooper" <[EMAIL PROTECTED]> on
dlc> 07/10/2001 12:28:40 AM

dlc> Please respond to [EMAIL PROTECTED]

dlc> To:   [EMAIL PROTECTED]
dlc> cc:    (bcc: David Hay/Lex/Lexmark)
dlc> Subject:  Re: Re[2]: Indexed tags - proposal to add changes



dlc> +1 for 'indexed="true"'

dlc> +1 for 'indexId'

dlc> --
dlc> Martin Cooper


dlc> ----- Original Message -----
dlc> From: <[EMAIL PROTECTED]>
dlc> To: <[EMAIL PROTECTED]>; "Oleg V Alexeev" <[EMAIL PROTECTED]>
dlc> Sent: Monday, July 09, 2001 9:35 AM
dlc> Subject: Re: Re[2]: Indexed tags - proposal to add changes


>>
>>
>> Hi.  Does anyone have any comments on this?  Personally I would opt for
dlc> leaving
>> includeIndex="yes" as indexed="true" to match other syntax.
>>
>> But, do we want to provide both types of indexed links?
>>
>> Cheers,
>>
>> Dave
>>
>>
>>
>>
>>
>> Oleg V Alexeev <[EMAIL PROTECTED]> on 07/07/2001
dlc> 02:03:25 AM
>>
>> Please respond to [EMAIL PROTECTED];
dlc> Please
>>       respond to Oleg V Alexeev <[EMAIL PROTECTED]>
>>
>> To:   [EMAIL PROTECTED]
>> cc:    (bcc: David Hay/Lex/Lexmark)
>> Subject:  Re[2]: Indexed tags - proposal to add changes
>>
>>
>>
>> Hello dhay,
>>
>> Link tag must build name of some parameter on base of index value or
>> use it as separate parameter (I agree with you... 8) )
>>
>> <html:link forward="news" paramName="sell" parampProperty="when"
>> paramId="whenSell" includeIndex="yes"></html:index>
>>
>> with result as - http://.../news.do?whenSell=today[30]
>>
>> Or
>>
>> <html:link forward="news" name="bean" property="linkMap"
>> includeIndex="yes" indexId="myIndex"></html:link>
>>
>> with result as - http://.../news.do?id=2&myIndex=30
>>
>> Friday, July 06, 2001, 10:10:33 PM, you wrote:
>>
>>
>>
>> dlc> Oleg,
>>
>> dlc> Hi.  Agree that the link tag is different, but think that it is due
dlc> to its
>> dlc> nature!  Unlike the other tags, adding index as a query param seems
dlc> to me
>> the
>> dlc> only reasonable way to provide access to the index in the link.  Not
dlc> sure
>> how
>> dlc> else to do it (if you try and use name, obviously you change the link
dlc> into
>> an
>> dlc> anchor!).
>>
>> dlc> If you (or anyone else) has any suggestions to handle it in a better
dlc> way
>> would
>> dlc> like to hear them - maybe I missed something!
>>
>> dlc> Cheers,
>>
>> dlc> Dave
>>
>>
>>
>>
>>
>> dlc> Oleg V Alexeev <[EMAIL PROTECTED]> on 07/06/2001
>> 01:47:47 PM
>>
>> dlc> Please respond to
dlc> [EMAIL PROTECTED];
>> Please
>> dlc>       respond to Oleg V Alexeev
dlc> <[EMAIL PROTECTED]>
>>
>> dlc> To:   [EMAIL PROTECTED]
>> dlc> cc:    (bcc: David Hay/Lex/Lexmark)
>> dlc> Subject:  Re: Indexed tags - proposal to add changes
>>
>>
>>
>> dlc> Hello dhay,
>>
>> dlc> I think it useful addition with minimal changes of existing code -
>> dlc> good solution. But there is one problem for my mind - html:link with
>> dlc> index=x. All another tag proposals are simple and transparent.
>>
>> dlc> Friday, July 06, 2001, 9:31:21 PM, you wrote:
>>
>>
>>
>> dlc>> Hi everyone.
>>
>> dlc>> I have been posting to the user list for some time now regarding
dlc> creating
>> dlc>> indexed names within an iterate tag.   From feedback from that list,
dlc> this
>> dlc> seems
>> dlc>> to be an important addition to the current tags.
>>
>> dlc>> While looking to write my own additional tags which would do this
dlc> (eg
>> dlc>> html:indexedText etc), I discovered that this functionality could
dlc> easily
>> be
>> dlc>> added to the current tags, now that the getIndex() method is
dlc> available, by
>> dlc>> creating an extra parameter 'indexed' which when set to true would
dlc> create
>> dlc> the
>> dlc>> indexed names.  The necessary additions to current code were small
dlc> and
>> dlc> quite
>> dlc>> clean, as follows:
>>
>> dlc>> - added 'indexed' as a parameter in BaseHandlerTag, with appropriate
>> dlc>> setter/getter
>> dlc>> - added if statement which checks for 'indexed=true', and if so,
dlc> appends
>> dlc> "[x]"
>> dlc>> to the name, before appending property eg myProperty[x].value.
>> dlc>>   This was added to BaseFieldTag (to cover tags which extend this)
dlc> and
>> dlc>> CheckBoxTag, & SelectTag
>> dlc>>  as follows:
>> dlc>>    //if "indexed=true" parameter, create indexed name for this tag
dlc> eg
>> dlc>> name="myCollection[x].myproperty"
>> dlc>>    if ("true".equals(indexed))
>> dlc>>    {
>> dlc>>       // look for outer iterate tag
>> dlc>>       IterateTag iterateTag = (IterateTag)
dlc> findAncestorWithClass(this,
>> dlc>> IterateTag.class);
>> dlc>>       if (iterateTag == null)
>> dlc>>       {
>> dlc>>          // this tag should only be nested in iteratetag, if it's
dlc> not,
>> dlc> don't do
>> dlc>> anything
>> dlc>>          return EVAL_PAGE;
>> dlc>>       }
>>
>> dlc>>       results.append(getName());
>> dlc>>       results.append("[");
>> dlc>>       results.append(iterateTag.getIndex());
>> dlc>>       results.append("].");
>> dlc>>    }
>>
>> dlc>> - Slight variations were added to SubmitTag and ButtonTag to simply
dlc> add
>> dlc> index to
>> dlc>> it's name ie mySubmit[x].
>> dlc>> - linkTag was somewhat different due to its nature.  I added if
dlc> statement
>> dlc> to add
>> dlc>> "index=x" as a parameter to the link's querystring  ie
dlc> myAction.do?index=1
>> dlc> or
>> dlc>> myAction.do?param1=37&index=1, as follows:
>> dlc>>         //if "indexed=true", add "index=x" parameter to query string
>> dlc>>         if ("true".equals(indexed))
>> dlc>>         {
>> dlc>>            // look for outer iterate tag
>> dlc>>            IterateTag iterateTag = (IterateTag)
>> findAncestorWithClass(this,
>> dlc>> IterateTag.class);
>> dlc>>            if (iterateTag == null)
>> dlc>>            {
>> dlc>>                // this tag should only be nested in iteratetag, if
dlc> it's
>> dlc> not,
>> dlc>> don't do anything
>> dlc>>               System.out.println("couldn't find enclosing iterate
dlc> tag");
>> dlc>>               return EVAL_PAGE;
>> dlc>>            }
>>
>> dlc>>            //calculate index, and add as a parameter
>> dlc>>            if (params == null)
>> dlc>>            {
>> dlc>>                params = new HashMap();             //create new
dlc> HashMap if
>> dlc> no
>> dlc>> other params
>> dlc>>            }
>> dlc>>            params.put("index", "" + iterateTag.getIndex());
>> dlc>>         }
>> dlc>> - minimal changes to struts-html.tld to add 'indexed' as param.
>>
>> dlc>> All of this code has been available at Ted's site for a while, and I
dlc> would
>> dlc> like
>> dlc>> to suggest it is added to the Struts source.  Numerous people are
dlc> already
>> dlc> using
>> dlc>> it, and I believe many more would if it was part of the build.
>>
>> dlc>> Would appreciate your feedback, and not sure what happens next (just
>> joined
>> dlc> this
>> dlc>> list)!
>>
>> dlc>> Cheers,
>>
>> dlc>> Dave
>>
>> dlc>> PS  code attached(See attached file: struts indexed files.ZIP)
>>
>>
>>
>>
>>
>>
>> dlc> --
>> dlc> Best regards,
>> dlc>  Oleg                            mailto:[EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Best regards,
>>  Oleg                            mailto:[EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>>
>>
>>











-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to