Can Ajaxed help me? What approach to use?

9 views
Skip to first unread message

ThinMan

unread,
Jun 23, 2009, 12:19:58 AM6/23/09
to asp-ajaxed
I have an application I am writing in classic ASP. I came across
Ajaxed and am excited about the possibilities, but as I look through
the documentation, I am left wondering if I will be able to leverage
Ajaxed in the ways I am envisioning.

My application presents a series of forms to capture, edit, and format
information provided by the user and generate reports.

I was envisioning using Ajaxed on the input forms so that users could
enter data into a series of text fields laid out in a row on the
page, Once the row was complete, a SQL insert would be performed and
the (now inserted) row would appear above the entry form. (Like
entering data into a spreadsheet). To do this would require that a
new recordset be generated after each insert (unless I cheat and
append the new field values into an array and re-display the array,
but I do not like this approach for a variety of reasons).

Additionally, I was thinking that I would be able to display a “draft”
version of the report and allow users to click on a data row and
perform edits. An edit form, specific to the type of record, would
display in-line on the report. (The preceding and subsequent rows in
the report contain informatino the user would want to see while
performing the edits). Once the edit is complete, the report would re-
display showing the changes. Again, this requires a round-trip to the
DB.

It appears, from the dependant drop down examples that Ajaxed can
perform background [SQL] queries and update the existing page with the
results. I was told however that the DataTable does not have this
functionality (specifically – a DataTable cannot be used in a
pagepart_). Are there other Ajaxed classes that do allow this
behavior (e.g. DataContainer, etc)?

If everything I need to do with my application will require a callback
() [essentially reloading the entire page] I am left wondering if my
application will benefit - either in performance or usabiity - from
using Ajaxed; or if it is not really a suitable candidate.

Thank you for you input,

ThinMan

Michal Gabrukiewicz

unread,
Jun 23, 2009, 10:41:42 AM6/23/09
to ThinMan, asp-ajaxed
hi thinman,
sure you can realize that with ajaxed ... all you need to do is create one page part which contains one datarow and call that with ajaxed.callback() when you need it.

rgrds
michal
--
michal

ThinMan

unread,
Jun 23, 2009, 1:18:43 PM6/23/09
to asp-ajaxed
hi michal,

thank you for the response. When you say "one datarow" do you mean a
"datatablerow"?
sorry if I am being picky on the terms, but I'm still new to this and
I can't find anything else in the API docs that references a
datarow...

thanks again,

TM
> michal- Hide quoted text -
>
> - Show quoted text -

Michal Gabrukiewicz

unread,
Jun 25, 2009, 12:23:21 PM6/25/09
to asp-ajaxed
hi,
i dont mean a row of a datatable ... if you need that stuff fully ajaxed, then i would not use a datatable ... 

use a page_part which will contain one row (i mean the HTML which represents the row) for that

here is a !nontested! code which you need to go through .. but it should roughly explain my idea:

<%
sub pagePart_row()
  'get the requested record
  set rs = db.getRS("select * from table where id = " & page.RFP("id", 0))
  showRow(rs)
end sub

sub showRow(aRS) %>
'if no record found then create an empty one
  if aRS.eof then set aRS = ["R"](array(array("val1"), array("")))
  %>
  <tr><td>
     <input type="text" name="val1" text="<%= str(aRS("val1")) %>">
  </td></tr>
<% end sub %>

<% sub main() %>

<table>
<%
'get all records and generate the rows ...
'inefficient yet, if a lot records!!
set rs = db.getRS("select * from table")
while not rs.eof
  rs.movenext()
wend
%>
<% showRow(rs) 'new record row %>
</table>

<% end sub %>

hope that gives you a clue ....
--
michal
Reply all
Reply to author
Forward
0 new messages