How to use goog.ui v soy templates?

92 views
Skip to first unread message

Radim Daniel Pánek

unread,
Jul 4, 2013, 6:28:22 AM7/4/13
to est...@googlegroups.com
I have a component that gives me soy template. I would use goog.ui.Textarea () - what are the ways? Thx

Michal Sänger

unread,
Jul 4, 2013, 7:14:05 AM7/4/13
to est...@googlegroups.com
You want to use goog.ui.Textarea in your component?

Michal

Radim Daniel Pánek

unread,
Jul 4, 2013, 7:30:22 AM7/4/13
to est...@googlegroups.com
Yes, i have a component for rendering textarea https://gist.github.com/5926929 
Then I want to use goog.ui.datePicker

I'm interested in the proper deployment goog.ui for soy templates.

Dne čtvrtek, 4. července 2013 13:14:05 UTC+2 Michal Sänger napsal(a):

Daniel Steigerwald

unread,
Jul 4, 2013, 7:49:13 AM7/4/13
to est...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Este.js - The state of art Javascript framework and dev stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to estejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michal Sänger

unread,
Jul 4, 2013, 7:52:48 AM7/4/13
to est...@googlegroups.com
In your component after you have created it's DOM, get the element of textarea, create instance of goog.ui.Textarea and decorate the element (blind shot coffee script):

el = goog.dom.getElement 'descActivity'
ta = new goog.ui.Textarea ''
@addChild ta
ta.decorate el

Michal

Radim Daniel Pánek

unread,
Jul 4, 2013, 8:17:16 AM7/4/13
to est...@googlegroups.com
Yes, I understand this and I have already tried this option, but...

------------------

create.coffee

L21: I get the generated template
There would be applied decoration on textarea, right? 

Probably thinking about it wrong. ;-)

Dne čtvrtek, 4. července 2013 13:52:48 UTC+2 Michal Sänger napsal(a):

Michal Sänger

unread,
Jul 4, 2013, 8:28:40 AM7/4/13
to est...@googlegroups.com
Well that example is factory for creating component. You want component inside component (nested component). So in your component you probably create the DOM in method createDom() by calling your template. Template return string, you put it in DOM (I prefere the este.dom.merge) then it's time to decorate/render nested components.

Michal

Radim Daniel Pánek

unread,
Jul 4, 2013, 9:35:22 AM7/4/13
to est...@googlegroups.com
You gave me guidance and it works. Example: https://gist.github.com/Radim-Daniel-Panek/5927761  it's ok?

Thx, Dan


Dne čtvrtek, 4. července 2013 14:28:40 UTC+2 Michal Sänger napsal(a):

Michal Sänger

unread,
Jul 4, 2013, 9:42:20 AM7/4/13
to est...@googlegroups.com
Yes, that's it. 

Just don't forget to call @addChild textarea so the events from textarea can bubble up

Michal
Reply all
Reply to author
Forward
0 new messages