Re: [Xsltforms-support] Reenviar: XForms trigger on svg elements
Brought to you by:
alain-couthures
From: Tim T. <tim...@gm...> - 2019-09-24 01:42:15
|
Sorry--this is not a feature I use as often as I should! The SVG "g" element can be the observer, but the event phase needs to be declared as "capture." <dispatch ev:observer="my-g" ev:event="DOMActivate" ev:phase="capture" targetid="m" name="svg-g-trigger"/> -- Tim A. Thompson Discovery Metadata Librarian Yale University Library tim...@ya... On Mon, Sep 23, 2019 at 9:34 PM Tim Thompson <tim...@gm...> wrote: > Hi, Jorge, > > I may be missing something, but I think this should be possible just by > declaring an SVG element to be an observer of the DOMActivate event. For > example: > > <dispatch ev:observer="my-circle" ev:event="DOMActivate" targetid="m" name > ="svg-circle-trigger"/> > > See this page for a working example: https://www.tat2.io/basex/svg-test > > Here, I have an SVG "circle" and "text" element within a "g" element. I > had to make each of the child elements observers. I tried making the > containing "g" element the observer, but that didn't seem to work. Any > ideas why not? > > Is this close to what you were looking for? > > Best regards, > Tim > > > -- > Tim A. Thompson > Discovery Metadata Librarian > Yale University Library > tim...@ya... > > > On Mon, Sep 23, 2019 at 3:25 PM Jorge sr <xu...@gm...> wrote: > >> >> >> Hi, >> >> I want to add a trigger to an svg on a form based on Xsltforms. For now I >> managed to launch the submissions with the following call from an onclick. >> >> >> XsltForms_xmlevents.dispatch(document.getElementById("actual-trigger-id"),"DOMActivate") >> >> This has two obvious disadvantages. First, it is not a proper XForms >> solution and is coupled to the framework. The second one is that at any >> time an update in the xsltforms may break the solution. >> >> Is there a "good way" to add a trigger to an svg element in XForms? >> >> Kind Regards, >> >> Jorge Sánchez >> >> @Alain thanks in advance, amazing work ;) >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> > |