Re: Nested Iterate Tag and indexId problem

2002-11-26 Thread Jeff_Mychasiw

On an interesting note, we had to do alot of this as well where the
variable came from another tag(s).
I stumbled across this: I found it a bit cleaner

function('1','2','')



*** Though I could not do the same thing with 

To:[EMAIL PROTECTED]
cc:

Subject:Nested Iterate Tag and indexId problem


I figured out the problem.

This will not work even though the rtexprvalue is set to true in the tld.




However, this will work...

<% String onchangeCall = "function('1','2','" + variable + "');" %>
 />

I can't use a scriptlet for just a portion of the assignment.  It has to
be all or nothing.  In the first version it just treats everything as a
string.
In the second version it evaluates the runtime expression.








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Nested Iterate Tag and indexId problem

2002-11-26 Thread david . fields
I figured out the problem.

This will not work even though the rtexprvalue is set to true in the tld.




However, this will work...

<% String onchangeCall = "function('1','2','" + variable + "');" %>
 />

I can't use a scriptlet for just a portion of the assignment.  It has to 
be all or nothing.  In the first version it just treats everything as a 
string.
In the second version it evaluates the runtime expression.



RE: Nested Iterate Tag and indexId problem

2002-11-25 Thread Sri Sankaran
I would try changing 



to 

' />

Of course if 'variable' is a property of the object in the current iteration, you'd 
change it to

' />

where 'x' is the value of the 'id' attribute of your .

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 25, 2002 3:12 PM
To: [EMAIL PROTECTED]
Subject: Nested Iterate Tag and indexId problem


Nested tags were available as a separate download prior to 1.1.  I have 
been using them quite succesfully up until now.

What I really need to do is this

I have several rows of data which are editable in individual text boxes. 
For each row I have a checkbox.

When the user makes a change in any of the rows I need to set the check 
box to selected.

The probblem is that I am unable to get the nested:text onchange event to 
evaluate a run time expression.  It just dumps my code out as it.

So this...



results in html something like this...



instead of

onchange="makeEditDirty('a','b','0');" />

I need to be able to pass in the row number to this script method.

Regards.

David

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Nested Iterate Tag and indexId problem

2002-11-25 Thread Patrice
I don't know nested tags on version 1.02 of Struts, and perhaps it's a
stupid question, but are you sure that it is possible to use scriplet values
on the onchange parameter of the tag: is  set to "true" for
this attribute, on the .tld file of the taglib ?

Patrice

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 25, 2002 9:11 PM
Subject: Nested Iterate Tag and indexId problem


> Nested tags were available as a separate download prior to 1.1.  I have
> been using them quite succesfully up until now.
>
> What I really need to do is this
>
> I have several rows of data which are editable in individual text boxes.
> For each row I have a checkbox.
>
> When the user makes a change in any of the rows I need to set the check
> box to selected.
>
> The probblem is that I am unable to get the nested:text onchange event to
> evaluate a run time expression.  It just dumps my code out as it.
>
> So this...
>
> 
>
> results in html something like this...
>
> 
>
> instead of
>
> onchange="makeEditDirty('a','b','0');" />
>
> I need to be able to pass in the row number to this script method.
>
> Regards.
>
> David
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Nested Iterate Tag and indexId problem

2002-11-25 Thread david . fields
Nested tags were available as a separate download prior to 1.1.  I have 
been using them quite succesfully up until now.

What I really need to do is this

I have several rows of data which are editable in individual text boxes. 
For each row I have a checkbox.

When the user makes a change in any of the rows I need to set the check 
box to selected.

The probblem is that I am unable to get the nested:text onchange event to 
evaluate a run time expression.  It just dumps my code out as it.

So this...



results in html something like this...



instead of

onchange="makeEditDirty('a','b','0');" />

I need to be able to pass in the row number to this script method.

Regards.

David



Re: Nested Iterate Tag and indexId problem

2002-11-25 Thread Patrice
Perhaps I made a mistake, but nested tags are available since Struts 1.1: I
think they are not available on Struts 1.02.

Best regards
  Patrice

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, November 25, 2002 6:33 PM
Subject: Nested Iterate Tag and indexId problem


> I am using the nested tags with Struts 1.02.
>
> I want to be able to dynamically set a call to a javascript function.  I
> want to pass in the row number to the function.
>
> I currently have
>
>
>  type="abbott.ai.tcgm.entities.AsrTran" indexId="idx">
> 
> 
>  size="1" styleClass="maintWidth1"
>  onchange="makeEditDirty('hideOnEdit','showOnEdit',' scope="page" />');"
> onkeyup="return autoTab(this, 1, event);"
> />
> 
> 
> 
>
> This does not work.
>
>
> I have also tried
>
>  type="abbott.ai.tcgm.entities.AsrTran" indexId="idx">
> 
> 
>  size="1" styleClass="maintWidth1"
>  onchange="makeEditDirty('hideOnEdit','showOnEdit','<%="idx"%>');"
> onkeyup="return autoTab(this, 1, event);"
> />
> 
> 
> 
>
> It does not work either.
>
> It is looking to me like a bug with the nested tags.  They sure have been
> very useful.  I would hate to change all the code back at this point.
>
> Why can I use a regular jsp <%=idx%> to get the value of the indexId from
> the iterate tag?
>
> Thanks.
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Nested Iterate Tag and indexId problem

2002-11-25 Thread edgar
The problem is an incompatiblity with javascript names and nested tags.

The nested tags create names like

property.nestedproperty

When you go to use this in javascript you do


document.forms["yourform"].property.nestedproperty.{method}.

Javascript blows up at this point.

You need to get a pointer to the form field either with 'this' or
searching through the form fields on an indexed basis till you find the
one you are interested in.

Here is my little javascript to find a field.  


// determine a field from it's name
function Struts_eval(fieldName, fieldCount) {
var objWrk = null;
if (fieldName == null)
return objWrk;
if (fieldCount == null)
fieldCount = 1;

// now try the rediculous eval
var findCount;
findCount = 0;
var len;
for ( var i = 0; i < document.forms.length; i++ ) {
for (var j = 0; j < document.forms[i].elements.length; j++) {
if (document.forms[i].elements[j].name == fieldName) {
if (++findCount == fieldCount) {
objWrk = document.forms[i].elements[j];
return objWrk;
}
}
len = document.forms[i].elements[j].name.indexOf(fieldName);
if (len < 0)
continue;
if (len + fieldName.length ==
document.forms[i].elements[j].name.length) {
if (++findCount == fieldCount) {
objWrk = document.forms[i].elements[j];
return objWrk;
}
}
}
}
return objWrk;
}

Edgar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 25, 2002 12:33 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: Nested Iterate Tag and indexId problem


I am using the nested tags with Struts 1.02.

I want to be able to dynamically set a call to a javascript function.  I

want to pass in the row number to the function.

I currently have





');"
onkeyup="return autoTab(this, 1,
event);" 
/>




This does not work.


I have also tried




');"
onkeyup="return autoTab(this, 1,
event);" 
/>




It does not work either.

It is looking to me like a bug with the nested tags.  They sure have
been 
very useful.  I would hate to change all the code back at this point.

Why can I use a regular jsp <%=idx%> to get the value of the indexId
from 
the iterate tag?

Thanks.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Nested Iterate Tag and indexId problem

2002-11-25 Thread david . fields
I am using the nested tags with Struts 1.02.

I want to be able to dynamically set a call to a javascript function.  I 
want to pass in the row number to the function.

I currently have





');"
onkeyup="return autoTab(this, 1, event);" 
/>




This does not work.


I have also tried




');"
onkeyup="return autoTab(this, 1, event);" 
/>




It does not work either.

It is looking to me like a bug with the nested tags.  They sure have been 
very useful.  I would hate to change all the code back at this point.

Why can I use a regular jsp <%=idx%> to get the value of the indexId from 
the iterate tag?

Thanks.