Re: javascript call with form tags

"Christopher Clarke" <cclarke-wYfHrJ5eQDBWk0Htik3J/[email protected]> Fri, 13 Oct 2006 14:19:44 -0400
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
Hi
Yea it worked!! Tags really reduce code clutter!!!
Next make my handler do Ajax!!!
Thanks
Chris

On 10/13/06, Jonathan Ellis <[email protected]> wrote:
> Ah, thanks for clarifying that.
>
> What's happening now is, the [[= ]] is confusing the active tag parser.
> You can't use those constructs inside active tags.  Instead, Spyce lets
> you write
>
> <f:select onChange="=foo" />
>
> which emits the result of evaluating "foo."
>
> So here I would write
>
> [[ onchange = "changeDates(this,'date_selector','%s','%s')" % (start,
> end) ]]
> <f:select name=calendar data=sel_cal onChange="=onchange" />
>
> On Fri, 13 Oct 2006 12:34:20 -0400, "Christopher Clarke"
> <cclarke-wYfHrJ5eQDBWk0Htik3J/[email protected]> said:
> > Hi
> > Yep it works in FireFox (maybe it won't in IE??)
> > I guess is should not have!!!
> >
> > Anyway i've tried the "dynamic" version with the quotes
> > IN:
> > <f:select name='calendar'  data="sel_cal"
> > onChange="changeDates(this,'date_selector','[[=start]]','[[=end]]')"
> > />
> > below is from  the source of the rendered page
> > OUT:
> > <f:select name='calendar'  data="sel_cal"
> > onChange="changeDates(this,'date_selector','1991-01-01','2006-03-31')"
> > Regards
> > Chris
> >
> > On 10/13/06, Jonathan Ellis <[email protected]> wrote:
> >
> > > I'm surprised it works at all...  you need quotes around your onChange
> > > attribute
> > >
> > > On Fri, 13 Oct 2006 11:22:38 -0400, "Christopher Clarke"
> > > <cclarke-wYfHrJ5eQDBWk0Htik3J/[email protected]> said:
> > > > Hi All
> > > > I've been converting all my stuff to use spyce active tags
> > > > Everything is fine so far except i have some selects which run javascript
> > > > stuff onchange events
> > > > Most of them work fine except for one (Note i have no trouble passing
> > > > data
> > > > to my  tags)
> > > > My "static" version works
> > > > <f:select name='calendar'  data="sel_cal"
> > > > onChange=changeDates(this,date_selector,2001-01-01,2005-10-01)  />
> > > > and spyce bulids the select box
> > > > however i tried
> > > > <f:select name='calendar'  data="sel_cal"
> > > > onChange=changeDates(this,date_selector,[[=start]],[[=end]]  />
> > > > It prints out the dates but the rest of the spyce does not compile the
> > > > tag
> > > > to html
> > > > I've also tried
> > > > <f:select name='calendar'  data="sel_cal"
> > > > onChange=changeDates(this,date_selector,"=start","=end"  />
> > > > but if course this does not work also
> > > > I've "solved" the problem by creating a dynamic wrapper function which
> > > > only
> > > > thakes date and date_selector which makes the call to changeDates
> > > > Is there a better way to do this ???
> > > > Regards
> > > > Chris
> > > --
> > > C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay
> > >
> > >
> --
> C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642