You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Norr, Peter" <pn...@lehman.com> on 2003/07/21 21:06:58 UTC

Question on how to remove a detail row?

Hi,

I have the following code.. It prints out a "remove"  button on each row..

How do I determine on which row the remove button was pressed?

<c:forEach items="${OptimizerInputFormBean.constraints}" var="constraint"
varStatus="iter">
		    <tr>
		      <td><c:out value="${constraint.type}"/></td>
		      <td><c:out value="${constraint.shares}"/></td>
			<td><c:out value="${constraint.lowerBound}"/></td>
			  <td><c:out value="${constraint.upperBound}"/></td>
			    <td><c:out value="${iter.count}"/></td>
			    <td><html:submit property="submit"
value="removeConstraint"></html:submit></td>
			  </tr>
	      </c:forEach>

------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Question on how to remove a detail row?

Posted by Alex Shneyderman <al...@law.columbia.edu>.
I was just thinking, never tried this, but 
You could change your form a bit to have an extra 
Property like String [] submit

Now in JSP you can say 
<html:submit property="submit[$iter.count]"
value="removeConstraint"></html:submit>

When you submit this request you will have submit [array] 
That will have all the submit[i] empty except the i that was
Actually clicked.


> -----Original Message-----
> From: Norr, Peter [mailto:pnorr@lehman.com]
> Sent: Monday, July 21, 2003 3:07 PM
> To: 'Struts Users Mailing List'
> Subject: Question on how to remove a detail row?
> 
> Hi,
> 
> I have the following code.. It prints out a "remove"  button on each
row..
> 
> How do I determine on which row the remove button was pressed?
> 
> <c:forEach items="${OptimizerInputFormBean.constraints}"
var="constraint"
> varStatus="iter">
> 		    <tr>
> 		      <td><c:out value="${constraint.type}"/></td>
> 		      <td><c:out value="${constraint.shares}"/></td>
> 			<td><c:out
value="${constraint.lowerBound}"/></td>
> 			  <td><c:out
value="${constraint.upperBound}"/></td>
> 			    <td><c:out value="${iter.count}"/></td>
> 			    <td><html:submit property="submit"
> value="removeConstraint"></html:submit></td>
> 			  </tr>
> 	      </c:forEach>
> 
>
------------------------------------------------------------------------
--
> ----
> This message is intended only for the personal and confidential use of
the
> designated recipient(s) named above.  If you are not the intended
> recipient of
> this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be
regarded
> as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an
official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed
to
> be
> secure or error-free.  Therefore, we do not represent that this
> information is
> complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Question on how to remove a detail row?

Posted by Mike Jasnowski <mj...@bea.com>.
You could generate an onclick eventhandler for each button, parameterized
with the record ID, or some other data. Then when the button is clicked, it
can set a parameter (or hidden form field) that identifies the row.

-----Original Message-----
From: Norr, Peter [mailto:pnorr@lehman.com]
Sent: Monday, July 21, 2003 3:07 PM
To: 'Struts Users Mailing List'
Subject: Question on how to remove a detail row?


Hi,

I have the following code.. It prints out a "remove"  button on each row..

How do I determine on which row the remove button was pressed?

<c:forEach items="${OptimizerInputFormBean.constraints}" var="constraint"
varStatus="iter">
		    <tr>
		      <td><c:out value="${constraint.type}"/></td>
		      <td><c:out value="${constraint.shares}"/></td>
			<td><c:out value="${constraint.lowerBound}"/></td>
			  <td><c:out value="${constraint.upperBound}"/></td>
			    <td><c:out value="${iter.count}"/></td>
			    <td><html:submit property="submit"
value="removeConstraint"></html:submit></td>
			  </tr>
	      </c:forEach>

----------------------------------------------------------------------------
--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org