[Bese-devel] *current-form* and call-in-restored-rendering-environment problems
Attila Lendvai
attila.lendvai at gmail.com
Thu Sep 6 13:10:01 UTC 2007
> I encountered two seperate problems with the latest ucw_ajax:
>
> The first one is about this call action before method. It seems to me
> that it is letting ucw think that the to be called component is a
> form, and subsequently tells all calls to install-action-js in that
> links component to put a: formsToSubmit : [ '<form>' ] }); into the
> javascript. Which then throws me into the debugger.
>
> (defmethod call-action :around ((action ajax-action) application session frame)
> (let ((form (creation-time-current-form-of action)))
> (if (and form
> (parent form))
> (let ((*current-form* form))
> (ucw.rerl.actions.dribble "Restored *CURRENT-FORM* to ~A
> from CALL-ACTION of AJAX-ACTION" *current-form*)
> (call-next-method))
> (call-next-method))))
the long story behind this is that i've refactored ajax stuff to work
based on a the new call-in-rendering-environment infrastructure. this
is a way to give a chance to components to restore their rendering
environment at various situations which includes the execution of
actions and the partial ajax rendering. this makes the action lambdas
behave more like continuations in that their dynamic environment can
be restored when needed (this is mostly a requirement by user code,
but the *current-form* special is also used by ucw).
the ajax rendering seems to work fine, and i'm using it in quite
complex situations.
the former hasn't been made yet, but instead an older form-specific
hackish solution is still in place that restores the rendering time
*current-form* when the actions are executed. this should be fixed
soon, but i need to think a little more about its interaction with
other stuff.
the idea is that if you register an action from inside a form
component wrapper, then it automatically submits the closest wrapping
form when the action is triggered. you can override this with the
forms-to-submit/forms-to-abandon args of the action.
> Commenting it out works for me but i am to un-knowledgeable about
> ucw-ajax to fix what this fixes.
>
>
> furthermore when clicking an ajax link, i'm thrown into the debugger
> with as message:
> There is no applicable method for the generic function
> #<STANDARD-GENERIC-FUNCTION IT.BESE.UCW:CALL-IN-RENDERING-ENVIRONMENT
it would be helpful if you could paste which arguments it was tried to
be called with.
> Apparently render-nearest-ajax-component can't find a component which
> is an ajax-component-mixin. Is this a new thing, that to be rendered
> components must be ajax-component-mixin's or am i barking up the wrong
> tree here. FYI all goes well in this area untill the
make sure you are using the proper register-action form. if you use
register-ajax-action, then your component must have an ajax-renderable
component somwhere among its parents. this contract may be broken also
by not updating the parent slot of some components properly.
(:component t option for component slots does that automatically)
> * Added call-in-restored-rendering-environment; renamed to
> call-in-rendering-environment
>
> patch.
but this doesn't sound too good.
looking at the code it could happen when you have a single
ajax-component in the parent chain and it's either the toplevel
component or its parent slot is nil. and an ajax action is triggered
in this situation.
i've pushed a fix that makes ajax rendering more tolerant for this
situation. this may solve the second problem.
hth,
--
attila
More information about the bese-devel
mailing list