Well, either you have your config file for your database action configured
wrong for the tables in your database, or you have the field names wrong on
your form (I'm assuming the DatabaseActions work similarly to the
ModularDatabaseActions), or the action is actually working and your pipeline
is routing successful actions to the wrong place (meaning you've set up the
pipeline wrong, not that it's making a mistake).

I'd suggest taking a fresh look at the samples (the code of them that is)
and the javadocs for the database actions.  If I remember correctly, the
abstract class javadoc is the one with the helpful configuration
information.

Geoff

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 10:11 AM
To: [EMAIL PROTECTED]
Subject: RE: Add/Remove/Edit Sql entries with buttons (using ESQL)


If I write <input type="submit" value="Save" name="cocoon-action-Add"/>
I just come back to the previous page. I think it's because I haven't
write the ID. That means :

The database contains following collumns : ID - Name - Dispatcher
The xsp page contains : text field for name - Select object for
dipatcher

I used a form.

-----Original Message-----
From: Geoff Howard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 4:13 PM
To: [EMAIL PROTECTED]
Subject: RE: Add/Remove/Edit Sql entries with buttons (using ESQL)


You need a proper name attribute on your submit button to get it to call
the action.

For instance, in your case (if you are not using an older version of
cocoon):
 <input type="submit" value="Save" name="cocoon-action-Add"/> would call
the "Add" action from your workflow action-set.  Similarly,
cocoon-action-Delete and cocoon-action-Update would call the others.

The value attribute is only there for display (this was not true at some
point in the past) and the name attribute is not visible to the end
user. As such, you probably want to name your actions more restrictively
as you may have many Add, Delete, and Update.  something like
action="add-workflow" corresponding to "cocoon-action-add-workflow"
might keep things easier to follow and potentially prevent problems.

The magic string "cocoon-action-" is not easily modified (I believe it's
compiled in).

Geoff

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 8:30 AM
To: [EMAIL PROTECTED]
Subject: FW: Add/Remove/Edit Sql entries with buttons (using ESQL)


Excuse me, previous message was not complete :



Hello,
I want to Add/Remove/Edit Sql entries by clicking on buttons. I tryied
with these 3 actions :

    <map:actions>
      <map:action name="add-workflow"
      src="org.apache.cocoon.acting.DatabaseAddAction" />
      <map:action name="del-workflow"
      src="org.apache.cocoon.acting.DatabaseDeleteAction" />
      <map:action name="upd-workflow"
      src="org.apache.cocoon.acting.DatabaseUpdateAction" />

And these action-sets

  <map:action-sets>
    <map:action-set name="workflow">
      <map:act type="add-workflow" action="Add" />
      <map:act type="del-workflow" action="Delete" />
      <map:act type="upd-workflow" action="Update" />
    </map:action-set>
  </map:action-sets>

. These actions are in my sitemap. Now, if I want them on a button, like
:
<form action="process-workflow" method="POST">
 <input name="process" type="hidden" value="Upd"/>
 <select name="SELdispatcher">
          <esql:connection>
                <esql:pool>personnel</esql:pool>
                <esql:execute-query>
                 <esql:query>select usrID, usrName from wfUsers order by
usrName</esql:query>
                 <esql:results>
                  <esql:row-results>
                  <option>
                          <xsp:attribute name="value"><esql:get-int
column="usrID"/></xsp:attribute>
                      <esql:get-string column="usrName"/>
                  </option>
                  </esql:row-results>
                 </esql:results>
                 </esql:execute-query>
          </esql:connection>
 </select>
 <input name="wfName" type="text"/>
 <input type="submit" value="Save"/>
</form>


Where  <input type="submit" value="Save"/> is the button to update sql
database.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to