struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Brown" <donald.br...@gmail.com>
Subject Re: [s2] Simple Tag Question <s:push> and <s:param>
Date Fri, 01 Dec 2006 17:01:24 GMT
Well, I had some free time (holding my new son to let mom get some
sleep) and figured everyone deserved at least a reply.  Yay for
GMail's search.

Anyways, cool, thanks for the update.  I don't know of a better tag,
but we are always open for a patch... :)

Don

On 12/1/06, Mark Menard <mark@mjm.net> wrote:
> On 12/1/06 3:21 AM, "Don Brown" <donald.brown@gmail.com> wrote:
> >
> > On 8/30/06, Mark Menard <mark@mjm.net> wrote:
> >> Is this following possible?
> >>
> >> <s:bean name="java.util.HashMap" id="qTableLayout">
> >> </s:bean>
> >> <s:push value="#qTableLayout">
> >>     <s:param name="tablecolspan" value="%{4}" />
> >>     <s:param name="currentColumnCount" value="%{0}" />
> >> </s:push>
> >>
> >>
> >> If it isn't how do you change the value of something on the value stack once
> >> you are either into a JSP or in a FreeMarker template?
> >
> > Why do you need to modify?  What about just pushing something else
> > that effectively overrides the existing value?
>
> Don,
>
> Wow! You went back quite a ways to find this issue.
>
> I guess I could have done that. It didn't seem obvious to me at the time,
> nor does it seem efficient, creating a Map for one invocation of a
> FreeMarker template and then just throwing it away, when just updating a
> property within the Map would do.
>
> Background. I was working on a theme that would automatically handle
> multi-column layout of forms. I used the qTableLayout Map to hold my
> configuration, tablecolspan, and the current state of the table,
> currentColumnCount. I needed to be able to modify currentColumnCount from
> within my FreeMarker templates, so the various templates would know if they
> needed to emit either an open <tr> or a close </tr>.
>
> My issue when I wrote that email was I couldn't figure out how to update the
> currentColumnCount insided the qTableLayout Map. tm_jee on the WW forum
> pointed out that I could do the following in my FreeMarker template:
>
>     ${stack.setValue('#qTableLayout.currentColumnCount', columnCount)}
>
> To a complete beginner this wasn't obvious. I was struggling with the fact
> that FreeMarker couldn't change the "model". So, I figured there would be a
> way to do that using the WW/S2 tags, which I couldn't figure out. The thread
> on the WW forum is:
>
>     http://forums.opensymphony.com/thread.jspa?messageID=83553
>
> If there is a tag equivalent of stack.setValue ("#someMap.someProperty",
> value) I'd be curious.
>
> You can see an example of what I got working at:
>
>     http://www.vitarara.org/cms/node/74
>
> Don't take the commentary in there to seriously I was very tired and cranky
> at the time. This functionality seemed so obviously needed on its face to
> me, but I just couldn't figure out how to make it work. Anyway, it works
> today, and it's a lot more sophisticated. I have support for variable label
> and input column spans. I might also work in variable row span support if I
> find I need it. I'm currently working on a tutorial covering what I did.
> I'll post the link when I get done.
>
> Thanks,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message