weblocks-demo ajax

30 views
Skip to first unread message

Adam White

unread,
Aug 29, 2011, 2:00:33 AM8/29/11
to weblocks
Hello,

I'm running the latest stable weblocks (via quicklisp), and am having
trouble with the demo.
Specifically, clicking "add" on a gridedit doesn't immediately produce
the "add items" widget below.
Refreshing the page shows the widget ready for data entry.

Strangely enough, the online version of the demo (at the weblocks
website) works fine.

Any ideas what I'm doing wrong?

Adam White

Adam White

unread,
Aug 29, 2011, 10:29:07 PM8/29/11
to weblocks
Sorry the last message probably didn't make a lot of sense.

The weblocks-demo project works fine when compiled with sbcl.
However my main dev environment is Lispworks Professional on x86
linux.

Before I start digging through for environment-specific differences,
does anyone have any pointers on where the issue could lie?

Adam

Leslie P. Polzer

unread,
Aug 30, 2011, 4:23:25 AM8/30/11
to weblocks
It did make sense.

But it's good to know that you now found out it's an implementation-
specific issue.

To debug it you need to use Firebug or a similar tool along with some
debugging stuff on the server side to pinpoint the issue.

Leslie

Adam White

unread,
Aug 31, 2011, 2:01:41 AM8/31/11
to weblocks
Thanks Leslie.

I'm extremely new to XHR.

When complied with SBCL, clicking the "Add" button on the "Companies"
datagrid widget returns:

{"widgets":{"companies-grid":"<div class='widget dataseq datagrid
dataedit-mixin gridedit' id='companies-grid'><div class='data-mining-
bar'><span class='total-items'>(Total of 3 Companies)<\/span><p
class='datagrid-select-bar'><strong>Select: <\/strong><a href='\/
weblocks-demo\/companies?
action=1442%3A8DB55FF30FD1ED771F2279AABFD3C534'
onclick='initiateAction(&quot;
1442:8DB55FF30FD1ED771F2279AABFD3C534&quot;, &quot;&quot;); return
false;'>All<\/a>, <a href='\/weblocks-demo\/companies?
action=1443%3A8F258AF9998092C8C92720B307C9D69B'
onclick='initiateAction(&quot;
1443:8F258AF9998092C8C92720B307C9D69B&quot;, &quot;&quot;); return
false;'>None<\/a><\/p><\/div><div class='widget flash' id='dom8'><!--
empty flash --><\/div><form class='dataseq-form' action='\/weblocks-
demo\/companies' method='get' onsubmit='initiateFormAction(&quot;
1444%3A03B42B1E9D8625595CC6EEE6E395233A&quot;, $(this), &quot;&quot;);
return false;'><div class='extra-top-1'><!-- empty --><\/div><div
class='extra-top-2'><!-- empty --><\/div><div class='extra-top-3'><!--
empty --><\/div><fieldset><div class='datagrid-body'><div class='view
table company'><div class='extra-top-1'><!-- empty --><\/div><div
class='extra-top-2'><!-- empty --><\/div><div class='extra-top-3'><!--
empty --><\/div><table summary='Ordered by name,
ascending.'><thead><tr><th class='select'><\/th><th class='name sort-
asc'><span><a href='\/weblocks-demo\/companies?
action=1445%3ACC55417462D7B4F03C9038D6D1D64321'
onclick='initiateAction(&quot;
1445:CC55417462D7B4F03C9038D6D1D64321&quot;, &quot;&quot;); return
false;'>Name<\/a><\/span><\/th><th class='industry'><span><a href='\/
weblocks-demo\/companies?
action=1446%3AC999E2E29FC97EB99B274577872E537E'
onclick='initiateAction(&quot;
1446:C999E2E29FC97EB99B274577872E537E&quot;, &quot;&quot;); return
false;'>Industry<\/a><\/span><\/th><th class='non-profit'><span><a
href='\/weblocks-demo\/companies?
action=1447%3A48880F3EC319D6DF437264DAA5FF949D'
onclick='initiateAction(&quot;
1447:48880F3EC319D6DF437264DAA5FF949D&quot;, &quot;&quot;); return
false;'>Non Profit<\/a><\/span><\/th><th class='drilldown modify'><\/
th><\/tr><\/thead><tbody><tr
onclick='initiateActionOnEmptySelection(&quot;
1448:A8810197234CF94215078365AEE5137E&quot;, &quot;&quot;);'
onmouseover='this.style.cursor = &quot;pointer&quot;;' style='cursor:
expression(&quot;hand&quot;);'><td class='select'
onclick='stopPropagation(event);' style='cursor: default;'><div><input
name='item-0' type='checkbox' value='f' \/><\/div><\/td><td
class='name'><span class='value'>Bar<\/span><\/td><td
class='industry'><span class='value'>Entertainment<\/span><\/td><td
class='non-profit'><span class='value'>No<\/span><\/td><td
class='drilldown modify'><\/td><\/tr><tr class='altern'
onclick='initiateActionOnEmptySelection(&quot;
1449:C4D0DC06471D44121DFF42674F0D6418&quot;, &quot;&quot;);'
onmouseover='this.style.cursor = &quot;pointer&quot;;' style='cursor:
expression(&quot;hand&quot;);'><td class='select'
onclick='stopPropagation(event);' style='cursor: default;'><div><input
name='item-1' type='checkbox' value='f' \/><\/div><\/td><td
class='name'><span class='value'>Church<\/span><\/td><td
class='industry'><span class='value'>Spiritual<\/span><\/td><td
class='non-profit'><span class='value'>Yes<\/span><\/td><td
class='drilldown modify'><\/td><\/tr><tr
onclick='initiateActionOnEmptySelection(&quot;
1450:E73100E73CD0374A335839749362A10B&quot;, &quot;&quot;);'
onmouseover='this.style.cursor = &quot;pointer&quot;;' style='cursor:
expression(&quot;hand&quot;);'><td class='select'
onclick='stopPropagation(event);' style='cursor: default;'><div><input
name='item-2' type='checkbox' value='f' \/><\/div><\/td><td
class='name'><span class='value'>Nuclear Plant<\/span><\/td><td
class='industry'><span class='value'>Energy<\/span><\/td><td
class='non-profit'><span class='value'>No<\/span><\/td><td
class='drilldown modify'><\/td><\/tr><\/tbody><\/table><div
class='extra-bottom-1'><!-- empty --><\/div><div class='extra-
bottom-2'><!-- empty --><\/div><div class='extra-bottom-3'><!-- empty
--><\/div><\/div><\/div><input name='action' type='hidden'
value='1444:03B42B1E9D8625595CC6EEE6E395233A' \/><\/fieldset><div
class='extra-bottom-1'><!-- empty --><\/div><div class='extra-
bottom-2'><!-- empty --><\/div><div class='extra-bottom-3'><!-- empty
--><\/div><\/form><div class='widget data-editor dataform'
id='dom28'><form class='view form company' action='\/weblocks-demo\/
companies' method='post' onsubmit='initiateFormAction(&quot;
1451%3A487177837F8DCCA931E27D7AC5DDD75E&quot;, $(this), &quot;&quot;);
return false;'><div class='extra-top-1'><!-- empty --><\/div><div
class='extra-top-2'><!-- empty --><\/div><div class='extra-top-3'><!--
empty --><\/div><fieldset><h1><span class='action'>Modifying:&nbsp;<\/
span><span class='object'>Company<\/span><\/h1><ul><li
class='name'><label class='input' for='dom30'><span class='slot-
name'><span class='extra'>Name:&nbsp;<em class='required-
slot'>(required)&nbsp;<\/em><\/span><\/span><\/label><input
type='text' name='name' maxlength='40' id='dom30' \/><\/li><li
class='industry'><label class='input' for='dom31'><span class='slot-
name'><span class='extra'>Industry:&nbsp;<\/span><\/span><\/
label><input type='text' name='industry' maxlength='40' id='dom31' \/><
\/li><li class='non-profit'><label class='checkbox' for='dom32'><span
class='slot-name'><span class='extra'>Non Profit:&nbsp;<\/span><\/
span><\/label><input name='non-profit' type='checkbox' id='dom32'
class='checkbox' value='f' \/><\/li><\/ul><div class='submit'><input
name='submit' type='submit' class='submit' value='Submit'
onclick='disableIrrelevantButtons(this);' \/><input name='cancel'
type='submit' class='submit cancel' value='Cancel'
onclick='disableIrrelevantButtons(this);' \/><\/div><input
name='action' type='hidden'
value='1451:487177837F8DCCA931E27D7AC5DDD75E' \/><\/fieldset><div
class='extra-bottom-1'><!-- empty --><\/div><div class='extra-
bottom-2'><!-- empty --><\/div><div class='extra-bottom-3'><!-- empty
--><\/div><\/form><\/div><\/div>","dom28":"<div class='widget data-
editor dataform' id='dom28'><form class='view form company' action='\/
weblocks-demo\/companies' method='post'
onsubmit='initiateFormAction(&quot;
1452%3AAFA7A730720899EACD83B6BE456BFE79&quot;, $(this), &quot;&quot;);
return false;'><div class='extra-top-1'><!-- empty --><\/div><div
class='extra-top-2'><!-- empty --><\/div><div class='extra-top-3'><!--
empty --><\/div><fieldset><h1><span class='action'>Modifying:&nbsp;<\/
span><span class='object'>Company<\/span><\/h1><ul><li
class='name'><label class='input' for='dom34'><span class='slot-
name'><span class='extra'>Name:&nbsp;<em class='required-
slot'>(required)&nbsp;<\/em><\/span><\/span><\/label><input
type='text' name='name' maxlength='40' id='dom34' \/><\/li><li
class='industry'><label class='input' for='dom35'><span class='slot-
name'><span class='extra'>Industry:&nbsp;<\/span><\/span><\/
label><input type='text' name='industry' maxlength='40' id='dom35' \/><
\/li><li class='non-profit'><label class='checkbox' for='dom36'><span
class='slot-name'><span class='extra'>Non Profit:&nbsp;<\/span><\/
span><\/label><input name='non-profit' type='checkbox' id='dom36'
class='checkbox' value='f' \/><\/li><\/ul><div class='submit'><input
name='submit' type='submit' class='submit' value='Submit'
onclick='disableIrrelevantButtons(this);' \/><input name='cancel'
type='submit' class='submit cancel' value='Cancel'
onclick='disableIrrelevantButtons(this);' \/><\/div><input
name='action' type='hidden'
value='1452:AFA7A730720899EACD83B6BE456BFE79' \/><\/fieldset><div
class='extra-bottom-1'><!-- empty --><\/div><div class='extra-
bottom-2'><!-- empty --><\/div><div class='extra-bottom-3'><!-- empty
--><\/div><\/form><\/div>","dom9":"<div class='widget pagination'
id='dom9'><span class='page-info'><span class='viewing-label'>Viewing <
\/span><span class='page-label'>Page <\/span><span class='current-
page'><strong>1<\/strong><\/span><span class='of-label'> of <\/
span><span class='total-pages'>1<\/span><\/span><\/div>"},"before-
load":["<script type='text\/javascript'>\n\/\/ <!
[CDATA[\ninclude_css('\/weblocks-demo\/pub\/stylesheets\/
pagination.css');\n\/\/ ]]>\n<\/script>","<script type='text\/
javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo\/pub\/
stylesheets\/dataform-import.css');\n\/\/ ]]>\n<\/script>","<script
type='text\/javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo
\/pub\/stylesheets\/dataform-import.css');\n\/\/ ]]>\n<\/
script>","<script type='text\/javascript'>\n\/\/ <!
[CDATA[\ninclude_css('\/weblocks-demo\/pub\/stylesheets\/flash.css');\n
\/\/ ]]>\n<\/script>","<script type='text\/javascript'>\n\/\/ <!
[CDATA[\ninclude_css('\/weblocks-demo\/pub\/stylesheets\/dataform-
import.css');\n\/\/ ]]>\n<\/script>","<script type='text\/javascript'>
\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo\/pub\/stylesheets\/
pagination.css');\n\/\/ ]]>\n<\/script>","<script type='text\/
javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo\/pub\/
stylesheets\/datagrid-import.css');\n\/\/ ]]>\n<\/script>","<script
type='text\/javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo
\/pub\/stylesheets\/datagrid.css');\n\/\/ ]]>\n<\/script>","<script
type='text\/javascript'>\n\/\/ <![CDATA[\ninclude_dom('\/weblocks-demo
\/pub\/scripts\/datagrid.js');\n\/\/ ]]>\n<\/script>","<script
type='text\/javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo
\/pub\/stylesheets\/dataseq.css');\n\/\/ ]]>\n<\/script>"],"on-
load":null}



When complied with Lispworks, the XHR response is:

{"widgets":{"dom22":"<div class='widget data-editor dataform'
id='dom22'><form class='view form company' action='\/weblocks-demo\/
companies' method='post' onsubmit='initiateFormAction(&quot;
85479%3AC30F9439EA4CC2B2E05CEA05B07E6034&quot;, $(this),
&quot;&quot;); return false;'><div class='extra-top-1'><!-- empty --><
\/div><div class='extra-top-2'><!-- empty --><\/div><div class='extra-
top-3'><!-- empty --><\/div><fieldset><h1><span
class='action'>Modifying:&nbsp;<\/span><span class='object'>Company<\/
span><\/h1><ul><li class='name'><label class='input' for='dom24'><span
class='slot-name'><span class='extra'>Name:&nbsp;<em class='required-
slot'>(required)&nbsp;<\/em><\/span><\/span><\/label><input
type='text' name='name' maxlength='40' \/><\/li><li
class='industry'><label class='input' for='dom25'><span class='slot-
name'><span class='extra'>Industry:&nbsp;<\/span><\/span><\/
label><input type='text' name='industry' maxlength='40' \/><\/li><li
class='non-profit'><label class='checkbox' for='dom26'><span
class='slot-name'><span class='extra'>Non Profit:&nbsp;<\/span><\/
span><\/label><input name='non-profit' type='checkbox'
class='checkbox' value='f' \/><\/li><\/ul><div class='submit'><input
name='submit' type='submit' class='submit' value='Submit'
onclick='disableIrrelevantButtons(this);' \/><input name='cancel'
type='submit' class='submit cancel' value='Cancel'
onclick='disableIrrelevantButtons(this);' \/><\/div><input
name='action' type='hidden'
value='85479:C30F9439EA4CC2B2E05CEA05B07E6034' \/><\/fieldset><div
class='extra-bottom-1'><!-- empty --><\/div><div class='extra-
bottom-2'><!-- empty --><\/div><div class='extra-bottom-3'><!-- empty
--><\/div><\/form><\/div>"},"before-load":["<script type='text\/
javascript'>\n\/\/ <![CDATA[\ninclude_css('\/weblocks-demo\/pub\/
stylesheets\/dataform-import.css');\n\/\/ ]]>\n<\/script>"],"on-
load":null}


... obviously one is a lot longer than the other! Does anyone have any
hints as to where this is generated?
I haven't poked through weblocks internals just yet.

Adam

Leslie P. Polzer

unread,
Aug 31, 2011, 5:28:07 AM8/31/11
to weblocks
On Aug 31, 8:01 am, Adam White <theroguemon...@gmail.com> wrote:

> ... obviously one is a lot longer than the other! Does anyone have any
> hints as to where this is generated?
> I haven't poked through weblocks internals just yet.

XHR handling of widget updates is centered around

src/request-handler.lisp (function render-dirty-widgets)

Printing *dirty-widgets* in this place might help.

Also check for any Javascript errors in your browser console.

Leslie
Reply all
Reply to author
Forward
0 new messages