RE: [displaytag-user] Column attributes and run time expressions
Brought to you by:
fgiust
From: vladimir l. <chi...@ya...> - 2006-04-06 23:15:51
|
Thank you, Mr.Herrick 1. if I put the anchor tag in the body of the column, the default sort will not properly work 2. paramid concept works only when you want to send only one parameter. it does not work with multiple parameters If I put anchor tag in the column body, I have to do external sorting otherwise I have to use table decirators for forming links I do not know if there are any other options Thanks again --- Rick Herrick <ri...@vi...> wrote: > Oh yeah, that won't work. This is similar to the > problem last week where > someone was including EL conditionals (<c:if>) > around the body of the table > to exclude rows where a property met a particular > condition. Basically, the > body of the <display:table> tag is NOT evaluated > iteratively, that is, the > <display:column> tags are evaluated once, when the > tag is first encountered. > That means any reference to the row item there is > lost. > > You can however put references to the row item > within the body of the > <display:column> tags themselves, since the body of > these tags is evaluated > each iteration. This means that you need to > construct the link within the > column body instead of trying to do it through the > href attribute. This > would look like this (some attributes removed for > clarity): > > <display:table name="someFormBean.someMap" > uid="myID"> > <display:column> > <a href="somethingelse.do?prop2=${myID.prop2}"> > ${myID.prop1} > </a> > </display:column> > </display:table> > > And actually, looking at it, I think another thing > you can do is just leave > the EL off of the URL. The whole point of that > paramId/paramProperty stuff > is to automatically put "property=value" on the > provided URL. So if you > want a URL like somethingelse.do?XXX=valueOfYYY, > It's something like: > > href="somethingelse.do" paramId="XXX" > paramProperty="YYY" > > So paramId gets carried over literally as whatever > that value is. I can't > remember though, I always found those param* > attributes to be kind of a > pain. I usually use the <a href> thing directly. > > Rick Herrick > ri...@vi... > > > -----Original Message----- > > From: dis...@li... > [mailto:displaytag-user- > > ad...@li...] On Behalf Of vladimir > lenin > > Sent: Wednesday, April 05, 2006 3:56 PM > > To: dis...@li... > > Subject: RE: [displaytag-user] Column attributes > and run time expressions > > > > I have a map with java beans. ${myID.prop2} is > working > > fine when it is included in the body of the > display > > column. > > > > however, column attributes like "href" in which I > > included ${myID.prop2} is getting evaluated only > once. > > > > it is keeping the values of the first row > > > > > > > > <display:table > > name="requestScope.someFormBean.someMap" > > export="false" > > id="myID" requestURI="some.do" pagesize="25" > > sort="list" > > defaultsort="2" excludedParams="*"> > > > > <display:column sortable="true" > > href="somethingelse.do?prop2=${myID.prop2}" > > paramId="prop1" paramProperty="prop2" > title="prop1"> > > > > ${myID.prop1} > > > > </display:column> > > > > > > <display:column sortable="true" title="prop2"> > > > > ${myID.prop2} > > > > </display:column> > > > > > > </display:table> > > > > > > --- Rick Herrick <ri...@vi...> wrote: > > > > > Can you please post some of the code that didn't > > > work? I'm not 100% clear > > > on what you guys are trying to do without an > > > illustration, but JSTL or > > > scriptlet expressions should re-evaluate each > > > iteration. I use this type > > > of construct in my code in just about every > > > displaytag table I've got. > > > > > > Farmer, Todd wrote: > > > > I had the same issue - requiring multiple > query > > > parameters to be > > > > dynamically added to the link for each row. I > > > started by using JSTL, > > > > and ran into the same issue that you did. My > > > eventual solution was to > > > > create table decorators. > > > > > > > > From: vladimir lenin > > > > Sent: Tuesday, April 04, 2006 5:36 PM > > > > > > > > As I can only specify one paramId for a > column, I > > > am > > > > using a run time expression for the href > value. > > > but it > > > > looks like it is evaluated only once. it it > not > > > > getting updated by the values from the current > > > object > > > > in the list. > > > > is this the intended behavior. do I have to > > > implement > > > > a table decorator for links? > > > > thank you > > > > > > -- > > > Rick Herrick > > > ri...@vi... > > > > > > I haven't got time for inner peace. > > > > > > "No reasonable definition of reality could be > > > expected to permit > > > this."--Albert Einstein, Boris Podolsky and > Nathan > > > Rosen in 1935 > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by xPML, a > > > groundbreaking scripting language > > > that extends applications into web and mobile > media. > > > Attend the live webcast > > > and join the prime developer group breaking into > > > this new coding territory! > > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > > _______________________________________________ > > > displaytag-user mailing list > > > dis...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/displaytag-user > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a > groundbreaking scripting > > language > > that extends applications into web and mobile > media. Attend the live > > webcast > > and join the prime developer group breaking into > this new coding > > territory! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |