Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 19493 invoked from network); 27 May 2003 18:55:27 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 27 May 2003 18:55:27 -0000 Received: (qmail 15451 invoked by uid 97); 27 May 2003 18:57:40 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@nagoya.betaversion.org Received: (qmail 15444 invoked from network); 27 May 2003 18:57:40 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 27 May 2003 18:57:40 -0000 Received: (qmail 17483 invoked by uid 500); 27 May 2003 18:55:02 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 17468 invoked from network); 27 May 2003 18:55:02 -0000 Received: from sccrmhc02.attbi.com (204.127.202.62) by daedalus.apache.org with SMTP; 27 May 2003 18:55:02 -0000 Received: from lester.the-fam.net (12-207-196-204.client.attbi.com[12.207.196.204]) by attbi.com (sccrmhc02) with SMTP id <20030527185506002008t85se>; Tue, 27 May 2003 18:55:06 +0000 Message-Id: <5.2.0.9.0.20030524152744.02ab9408@pop.gmx.net> X-Sender: X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Tue, 27 May 2003 11:54:14 -0700 To: "Struts Users Mailing List" From: Lorrin Nelson Subject: Re: html:link with dynamic javascript confirmation In-Reply-To: <86u1bkdt0v.fsf@wondark.www.rattieworldocomfort.com> References: <5.2.0.9.0.20030523210344.03f50078@foo> <5.2.0.9.0.20030523210344.03f50078@foo> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks David! That solved my problem and sounds like something I never would have figured out on my own.. -Lorrin At 12:49 PM 5/24/2003, you wrote: > >>>>> "Lorrin" == Lorrin Nelson writes: > > Lorrin> I have a table displaying a list of items, and on each row > there is a "delete" > Lorrin> link that pops up a confirmation dialog and then deletes the > item. This works: > > > Lorrin> > Lorrin> > Lorrin> escapeXml="true"/> > Lorrin> > Lorrin> Lorrin> paramId="id" paramName="template" > paramProperty="id" > Lorrin> onclick="return confirm('Really?')"> > Lorrin> key="template.list.action.delete"/> > Lorrin> > Lorrin> > Lorrin> > Lorrin> > > Lorrin> My problem is the hardcoded 'Really?' -- instead, I want to > use a message > Lorrin> resource and plug in the name of the item in the row, like so: > > Lorrin> Lorrin> value="${template.name}"/> > > Lorrin> That works fine if it's not inside the tag, but > inside the > Lorrin> it doesn't get parsed at all. In fact, if I do > 'Really <%=4+4%>?' I > Lorrin> don't even get 'Really 8', I get the unparsed text in the > confirmation dialog.. > > Lorrin> Any suggestions? I'm not married to this approach; if I've > gotta use old-skool > Lorrin> Struts tags instead of JSTL or do it as a form instead of a > html:link that's > Lorrin> alright. > >Well, the simple fix is to understand that expression scriptlets have to >be the >entire attribute value, not just a portion. Instead of: > > 'Really <%=4+4%>?' > >you would need > > '<%= "Really" + (4 + 4) + %>?' > >Alternatively, if you are using the nightly build of Struts, you could use the >"Struts-EL" contrib library, which gives you the ability to reference EL >expressions in the attributes of the Struts tags. > >-- >=================================================================== >David M. Karr ; Java/J2EE/XML/Unix/C++ >dmkarr@earthlink.net ; SCJP; SCWCD > > > > >--------------------------------------------------------------------- >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