AnushaSP07
AnushaSP07

Reputation: 401

Is it possible to call multiple handler methods on a single submit in atg?

Consider I have one submit button. On clicking submit, it should call both handleAddData() and handleInsertData().

Upvotes: 0

Views: 84

Answers (2)

AnushaSP07
AnushaSP07

Reputation: 401

Yes, we can call multiple handlers on single submit, using a component atg.search.formhandlers.MultipleSubmitHelper,

we have to configure - MultipleSubmitHelper component by setting its queryFormHandlers property to an array

Example- queryFormHandlers=/atg/search/formhandlers/QueryFormHandler1,
/atg/search/formhandlers/QueryFormHandler2

Upvotes: 1

radimpe
radimpe

Reputation: 3215

A <dsp:input> tag can only be bound to a single element in ATG. That said, you can have 3 handle methods, one which calls both the others (eg. handleCallAddInsertData) and bind your tag to this, still leaving you with the original handleAddData and handleInsertData. Alternatively you can submit your form via Javascript which will in turn call both handle methods.

If, however you need to call them 'both' you probably have a flaw in your design.

Upvotes: 0

Related Questions