[Bese-devel] UCW submit action issues
Christian Haselbach
chriss at muon.de
Mon May 1 13:28:28 UTC 2006
Hello,
I have got some issues with form and submit action. I want to perform
a certain action when a submit button is clicked.
(defaction call-viewer ((bac b-action-component) name)
(incf (counter bac))
(call 'b-viewer :name name))
(defmethod render ((bac b-action-component))
(<:h1 (<:as-html "Choose your action #" (counter bac)))
(let ((name "n/a"))
(<ucw:form :action (call-viewer bac name)
(<ucw:submit :value "one" :accessor name)
(<ucw:submit :value "two" :accessor name))))
This works just fine, but I cannot see a way to assign the action
directly:
(defmethod render ((bac b-action-component))
(<:h1 (<:as-html "Choose your action #" (counter bac)))
(<:form (<ucw:submit :value "one" :action (call-viewer bac "one"))
(<ucw:submit :value "two" :action (call-viewer bac "two"))))
This does nothing (except bringing you back to the start).
Taking a look a the dynamic forms example, I saw it uses the simple-form
component. Looking at the produced html one can see that the "add"
button does not have a name attribute. So the form does not know which
button has been pressed when javascript is turned off. Indeed, the
example does not work without javascript.
So, is there a way to associate an action with a button without relying
on javascript? Using value for manual association (like the code above
sort of does) becomes a nightmare with I18N.
Thanks.
Regards,
Christian
More information about the bese-devel
mailing list