Dragon Naturally Speaking

67 views
Skip to first unread message

Tim M

unread,
May 23, 2013, 12:07:52 PM5/23/13
to intersys...@googlegroups.com
We are doing some research on integrating Dragon Naturally Speaking into our Zen application.  One 
thing the Dragon JavaScript library needs is some custom property for the controls, for 
example:
 
<input type="text" class="tdInput" data-nusa-concept-name="procedure"/>
 
On the Zen page, we use our 
zen components which extents %ZEN.Component.text; but we can't add these new custom properties to it 
since the name contains "-" which seems to be invalid in Zen.  
 
Do you have any suggestion on how 
to get around this?

Lexi Hayden

unread,
May 23, 2013, 12:23:01 PM5/23/13
to InterSystems: Zen Community
I'm not extremely familiar with Zen, but did you know that more recent
Cache releases support delimited property names?

I.e., you can do this:
Property "data-nusa-concept-name";

And the compiler is OK with this.

APWZ

unread,
May 28, 2013, 12:31:28 PM5/28/13
to intersys...@googlegroups.com
And the XMLNAME datatype-parameter allows you to set a name for the XML attribute that is different from the name of the Property itself:
 
   Property DataNusaConceptName(XMLPROJECTION = "attribute", XMLNAME = "data-nusa-concept-name");
 
See
  and
 
XMLNAME is available since Cache 5.0, I believe.
 
Ariela

Brandon Horst

unread,
May 29, 2013, 10:09:51 AM5/29/13
to intersys...@googlegroups.com
You cannot add attributes to HTML tags just by adding Properties to Zen Components. It is a bit
more complicated than that.
 
There are really two options for this:
1. Use Javascript to add the attribute after the page has already been rendered. Something like
document.getElementById('myControlId').setAttribute("data-nusa-concept-name","procedure")

Of course, any other way of getting access to the DOM element would be fine (besides document.getElementById()
 
2. Override the %DrawHTML() method in your Zen Control, to output the attribute. You can go into
%Zen.Component.text, copy the %DrawHTML method, and override it in your subclass. If the base class
looks like this:
Method %DrawHTML()
{
        //...
        &html<<input type="text" class="#(..controlClass)#" ...>
}
You could override it with:
Method %DrawHTML()
{
        //...
        &html<<input type="text" class="#(..controlClass)#" data-nusa-concept-name="procedure"
...>
Reply all
Reply to author
Forward
0 new messages