From: Raymond I. <xw...@ya...> - 2003-05-23 21:27:07
|
Please see below: --- Kevin <ke...@ke...> wrote: > See below. > > "Raymond Irving" <xw...@ya...> wrote: > > > I've been having fun with the template manager > (tm) so > > far. I'm now able to switch between templates > while > > still using the existing layers > > You've lost me now. I understood the previous 'two > lyrs in > a table example' and thought it was very neat. > > One idea is that once the template html is set. The > actual > template setHTML() can be overloaded to provide a > similar > expansion of variables. Yes, the version that will allow you to call setHTML() to change the template. > Useful for getImage when we don't need a DynLayer > child. > > var h='<table><tr><td>[@img1]</td<td>[@img2]</td>... > var f=dynapi.functions; > var img1=f.getImage('images/img1.jpg',10,10); > var img2=f.getImage('images/img2.jpg',10,10); > > var tp = new Template(h,100,100); > tp.setHTML(img1.getHTML(),'img1'); > tp.setHTML(img2.getHTML(),'img2'); > > or something like that. Cool. The next preview release will allow you to add images to the template one of two ways: tp.addChild(img1); or tp.setField('img1',img1.getHTML()); If the first option becomes to difficult then I'll use the latter. > > for exmaple: > > > > tp.setHTML('Your name is: [@lyr]') > > tp.addChild(new DynLayer('Mary Jones'),'lyr'); > > .... > > .... > > tp.setHTML('Click here to access [@lyr] profile') > > // displays Click here to access Mary Jones > profile > > Could you show the above as a complete example? Yes, I'll some more examples of the new features > > Users will also be able to do: > > > > tp.setField('lyr','text') > > row=tp.getFieldBlock('rows') > > row.setField('c1','2030'); > > row.setField('c2','Apple'); > > Could you show the above as a complete example? Yes, I'll some more examples of the above features > Have I missed a dynapi extention that defines > setField() > and getFieldBlock()? These will be part of the Template() object > > The attached Text2Var converter will help you > convert > > your html templates to javascript > > Yes this was a nice tool. Glad you like it. I think I will be using template manager (tm) for most of if not all my dynapi apps. -- Raymond Irving > - > Kevin > > > > > -- > > Raymond Irving > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your > application fit in a > relational database is painful, don't do it! Check > out ObjectStore. > Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |