tag:blogger.com,1999:blog-26074795.post4407630831435090518..comments2023-10-06T22:56:21.986+08:00Comments on Lotus Notes on Web 2.0: Javascript String PerformanceWilliam Behhttp://www.blogger.com/profile/07557846251742693454noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-26074795.post-20745856138054335712007-03-21T08:51:00.000+08:002007-03-21T08:51:00.000+08:00@Tommy. Ajax is definitely useful. A very simple c...@Tommy. Ajax is definitely useful. A very simple case is for categorized view. Domino default do a refresh with every expand/collapse or next/previous navigation of the view. Ajax can be used to pull and display the required html.<BR/><BR/>Dynamic input table is building a dynamic multiple row input table. For example a product group can have multiple products (id, name, etc input fields). The user can have flexibility to add or remove product entry in a form. A table may have to be generated to display existing products of the group document. Another way to do it is to store the products in a separate form. Use Ajax to save to user input into the form and pull the display table from the view.<BR/><BR/>There are cases where you want to use existing view instead of creating new view. For a very large indexed database, you may want to reduce the number of views. So using ?ReadViewEntries to retrieve data and dynamically generating the view is an option.William Behhttps://www.blogger.com/profile/07557846251742693454noreply@blogger.comtag:blogger.com,1999:blog-26074795.post-67383863610500660332007-03-21T03:54:00.000+08:002007-03-21T03:54:00.000+08:00@tommy:Ajax is the perfect use-case for the view g...@tommy:<BR/>Ajax is the perfect use-case for the view generating the HTML I mentioned in my comment.<BR/><BR/>Think of a really simple case<BR/>1: One<BR/>2: Two<BR/>3: Three<BR/><BR/>You could build a view with<BR/>1st column: "<tr><td>" + NumberNumber + "</td>"<BR/>2nd column: "<td>" + NumberName + "</td></tr>"<BR/><BR/>Then a Ajax-call to the view would get something like:<BR/>"<tr><td>1</td><td>One</td></tr><BR/><tr><td>2</td><td>Two</td></tr><BR/><tr><td>3</td><td>Three</td></tr>"<BR/><BR/>Then you would replace the content of a div with id="MyTable":<BR/>mytable = document.getElementById("MyTable");<BR/>mytable.innerHTML = "<table>" + request.responseText + "</table>";<BR/><BR/>This way you could benefit of the view caching of the Domino server.<BR/><BR/>Ciao<BR/>ThomasAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-26074795.post-88015500469705328972007-03-21T03:00:00.000+08:002007-03-21T03:00:00.000+08:00It's also useful when using Ajax (don't know if th...It's also useful when using Ajax (don't know if that was what you meant with dynamic input table).<BR/><BR/>Either convert XML, JSON or whatever to HTML. <BR/><BR/>With big forms/applications with a lot of users, it can save a lot of bandwidth/system resources on the server.Tommy Valandhttps://www.blogger.com/profile/11052104644034054473noreply@blogger.comtag:blogger.com,1999:blog-26074795.post-39625999233083251772007-03-20T22:02:00.000+08:002007-03-20T22:02:00.000+08:00@Thomas. Yes, in Domino, it would be faster to use...@Thomas. Yes, in Domino, it would be faster to use a view & $$ViewTemplate to built a html table. But there are many cases where you have to built dynamic html on the fly. For example dynamic input table. But for most cases these won't need a large set of HTML for the job. This post example is to test how to maximized our javascript codes.William Behhttps://www.blogger.com/profile/07557846251742693454noreply@blogger.comtag:blogger.com,1999:blog-26074795.post-78992100121653799352007-03-20T21:09:00.000+08:002007-03-20T21:09:00.000+08:00Hi William,but why would you built the HTML presen...Hi William,<BR/><BR/>but why would you built the HTML presentation of the table in JavaScript? Wouldn't it be better to let the server do this? <BR/><BR/>Most often you would get the data for the table from the server anyway. Since it is tabular data, it most probable, that it is data from a view. Considering (runtime) performance, I would propose a view, that generates the headers and table cells, and a $$ViewTemplate form (or a form embedding the view) for the rest.<BR/><BR/>ThomasAnonymousnoreply@blogger.com