Brian,

The typos you pointed out in app6, as well as a bug have been fixed in the
latest update.

Writing JHS apps is evolving and as better patterns emerge they are
incorporated to make things easier. The demos are early examples and also
cover less common ways to do things. For example, submit to get an entire
new page rather than the more powerful, but more complicated, ajax to get
updates. Demos show the kinds of things you can do.

The app family shows best practices and should be your guide in writing
apps.

The new jhrx is an example of the above. It's structure also makes it
easier to study each part of a response (CSS, JS, J code, ...). Rather than
look at the defn of jhr and jhrx, focus on their args.

Your later question about gd_set and gd_get can probably be resolved by
some more study and experiments. Those verbs provide simple local storage
for a browser page with the use of global nouns in the app locale. Create 2
browser pages for the same app and notice how with gd_.. they mantain their
state. When you are displaying 2 browser pages, examine the nouns in the
app locale.





On Sat, Nov 12, 2016 at 2:23 PM, Brian Schott <[email protected]>
wrote:

> To some extent I have answered my own question 2) by rewriting jdemo6.ijs
> as jdemo6a.ijs and running the following 2 lines of code in jijx.
>
>    load'~addons/ide/jhs/demo/jdemo6a.ijs'
>    'demo6'  jdemo6a ''
>
> The diff of the 2 script files is below. I noticed that gd_get was not used
> in the revision but I am not sure about whether the gd_set was used or not,
> although it explictly exists in the verb jdemo6a__ used to launch the new
> tab (above).
>
> server:~ brian$ cd /Applications/j64-805/addons/ide/jhs/app/
> server:app brian$ diff app6.ijs app6a.ijs
> 10,11c10,11
> <    jev_get_data_NEW_app6_ - jev_get or F5 refresh window ith id NEW
> <    jev_get_data_abc_app6  - arg for window with id abc
> ---
> >    jev_get_data_NEW_app6_ - jev_get or F5 refresh window with id NEW
> >    jev_get_data_abc_app6_ - arg for window with id abc
> server:app brian$ cd /Applications/j64-805/addons/ide/jhs/demo
> server:demo brian$ diff jdemo6.ijs jdemo6a.ijs
> 1c1
> < coclass'jdemo6'
> ---
> > coclass'jdemo6a'
> 5a6
> > '<div id="data" class="jcode"><TEXT></div>'
> 14a16,22
> > jev_get=: 3 : 0
> > NB. s=. gd_get''
> > s=. ''
> > (getv'jwid') jhrx (getcss''),(getjs''),gethbs'NAME TEXT';s;jhtmlfroma
> dbsm s
> > )
> >
> >
> 21c29,35
> < jev_get=: create NB. browser get request
> ---
> > CSS=: 0 : 0
> > form{margin:20px;}
> > jgridnumeditcss'g0';'80px'
> > jgridnumeditcss'g1';'40px'
> > )
> >
> > NB. jev_get=: create NB. browser get request
> 43a58,62
> > jdemo6a__=: 4 : 0
> > x gd_set_jdemo6a_ y
> > 'jdemo6a'windowopen_jhs_ x
> > )
> >
> server:demo brian$
>
>
>
> On Sat, Nov 12, 2016 at 11:45 AM, Brian Schott <[email protected]>
> wrote:
>
> > Eric (especially, but others too),
> >
> > 0) I have perused with great interest and reward Studio>app building .
> Not
> > yet have I looked at the new Studio>watch.
> >
> > 1) Below I show a diff for what I believe are 2 simple changes to correct
> > what I believe are typos in comments in app6.ijs
> >
> > server:app brian$ diff app6.ijs app6a.ijs
> > 10,11c10,11
> > <    jev_get_data_NEW_app6_ - jev_get or F5 refresh window ith id NEW
> > <    jev_get_data_abc_app6  - arg for window with id abc
> > ---
> > >    jev_get_data_NEW_app6_ - jev_get or F5 refresh window with id NEW
> > >    jev_get_data_abc_app6_ - arg for window with id abc
> >
> > 2) I have noticed that the demos differ slightly from the app building
> > scripts in that they used to use         jhr_jhs_
> > and apps now use the simpler jhrx_jhs_ .
> >
> > Would anyone care to comment on that change, please?
> >
> >    jhrx_jhs_
> > 4 : 'htmlresponse (hrxtemplate hrplc ''TITLE'';(TIPX,x)),y'
> >    jhr_jhs_
> > 4 : 0
> > if. _1=nc<'JS'  do. JS=:'' end.
> > if. _1=nc<'CSS' do. CSS=:'' end.
> > tmpl=. hrtemplate
> > if. SETCOOKIE do.
> >  SETCOOKIE_jhs_=: 0
> >  tmpl=. tmpl rplc (CRLF,CRLF);CRLF,'Set-Cookie: ',cookie,CRLF,CRLF
> > end.
> > htmlresponse tmpl hrplc 'TITLE CSS HEXTRA JS BODY';(TIPX,x);(css
> > CSS);HEXTRA;(js JS);(jhbs HBS)hrplc y
> > )
> >
> >
> >
> >
> --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to