(Yury Tolochko) #1

This is the topic for wForm extension.

If you have questions or found a bug let me know.

(Pumpk2k) #2


(Yury Tolochko) #3

Do you mean product example sources? If so, then why extension should be places into example which located INTO EXTENSION?

(Marek Paul) #4

Hi, Thanks for nice extension.

I tried your product example, but delete images (attachment) doesnt work.

I click on delete link (jquery remove elements), but after submnit product form, images records are still there.

Any idea?

Not implemented this function yet?


(Yury Tolochko) #5

Hi Marena,

Thanks for your reply.

You are right. Removing of related records is not working properly yet. It will be ready in the next extension version which we plan to get done during next week. BTW, there would be also cascade delete to allow remove products with all necessary relations.



Weavora Team

(Marek Paul) #6

Hi Alex

Thanks again,

I’ll wait for next version.

Meanwhile I’ll edit javacript in existing version. Instead of js delete element, just hide it and set hidden field “deleted” to 1 (because in some tables I dont want to delete an records (for history issues), but only set to deleted)

Have a nice weekend,


(Marek Paul) #7

Hi Alex,

Just ideas for you what changes I made to satisfied my needs.

I made some changes in jquery.multiplyforms.js

  1. option to choose between .appendTo / .prependTo (in some forms I prefer add new rows at the beginning)

  2. I change beforeDelete callback to (I needed to just hide records in database - not delete)

// beforeDelete callback

// I know - now its replace delete

if ($.isFunction(self.options.beforeDelete)) {

  self.options.beforeDelete.call(this, embedForm, self);

} else {



// in form i call

beforeDelete: function(embedForm, multiplyFormInstance){

  if (confirm("Are you sure to delete this record?")) {



  } else {

    return false;



Have a nice day


(sory for google translator english)

(Yury Tolochko) #8

Hi Marena,

Thnx for good ideas.

We’ll add appendMode option with possible values: ‘append’ or ‘prepend’

You are absolutely right there. That’s why we should move to jquery events instead of callbacks. So finally your code will look like:



    embedClass: 'has-many-item',

    templateClass: 'just-empty-form-template-hasManyRelation'


  .on('multiplyForms.add', function(event, embedForm, multiplyFormInstance){})

  .on('multiplyForms.delete', function(event, embedForm, multiplyFormInstance){

    event.preventDefault(); // callback-killer feature <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />

    if (confirm("Are you sure to delete this record?")) {




Also it will allow bind/unbind add/remove handlers in other places of the code.

Best regards,


(Marek Paul) #9

Thanks for reply Alex and good luck with new version.

(Yury Tolochko) #10

Version 0.2 released

Change log:

  • Cascade delete

  • Remove old related item during update

  • Multiple bug fixes

  • jQuery plugin: append mode

  • jQuery plugin: replace callbacks with events

(Hamidimahdinacim) #11

Hi, Thank you for this nice extension O0

Did the v 0.2 manage the add/update/delete process in a transaction?

the version I downlowa few days ago seems not! am I wrong? (hope yess, because this extension will make my life easier if it do manage transactions)

(Yury Tolochko) #12


I with to say ‘yes’, but wForm doesn’t support transactions for now. But that’s a good feature for next release.

For now you could try temporal hook:

public function actionEdit($id = null) {


  if ($yourForm->validate()) {

    $transaction = Yii::app()->db->beginTransaction();

    if ($yourForm->save()) {



    } else {





(Hamidimahdinacim) #13


I see that I am more concentrated on looking for extensions that make my life easier OutOfTheBox then traying to adapt solution to my needs, [sup]ehhmmm, maybe there is somethings to reconsidere here…[/sup]

or perhaps transactions in multidependent inserts is something MusHaveOutFromTheBox.

I definitely agree with you, I think it’s a good feature to have, maybe with autodetecting for transactions support in databases.

Thank you again.

(Hamidimahdinacim) #14


You have something verry interesting here to manage related models, I t hink your extension can be improved with this behavior


just trying it for now, but it look awsome for me.

(Lubosdz) #15


does WUNIT support testing AJAX requests?

(or to be precise - invoking and processing javascript events?)


I have a form with 2 dropdown boxes.

When I select option in first dropdown, then ajax is invoked and populates second dropdown box.

As far as I know Selenium is the only tool capable of invoking AJAX requests.

Does WUnit somehow support this magic and can fully replace Selenium server?

Thank you.


(Sebastien) #16

A try it, my input look nice. But when I want to save, I have this error.

Fatal error: Call to a member function validate() on a non-object in /var/www/html/senik/app/protected/extensions/wform/WFormRelationHasOne.php on line 32

The function getRelatedModel return an array and not a model object ?

(Yury Tolochko) #17

That’s quite strange. It could only if you put not well-formatted data into HAS_ONE model. E.g. not [name => 123], but [0 => [name => 123]]

(Sebastian Brams) #18

I tried out.

I want to include js/jquery.multiplyforms.js in my layout file, but it seems not to work. Normally the js-file should automatically copied in the asset-folder, or?

In the assets-folder is no jquery-multiplyforms.js. The result is that “delete” and “add” doesn’t work for me. :frowning:


(Sebastian Brams) #19

Is "attaching behavior" necessary ?

If I attach the behavior I get an error like this one: “Illegal offset type in isset or empty”. Maybe there is a Problem, because the PK of one table hast two columns. But I don’t know how setup this.

A short reply would help me.

After some tests: Your extension does not support a PK which hast two colums. Only the ManyManyRelation allows this. So the wform extension is not helpful for me, because I have a HasManyRelation, where the PK hast two Columns and only one of these two columns is a FK.

(Devnegikecjunk) #20

Thanks a lot WeaVora Team, for this grate extension.

Easy to use, and with very clear documentation and examples.

My question is in the example given here https://github.com/weavora/wform/wiki/Example:-Product-form

is it possible to add other information to "product_2_tag" table, suppose I want to add "product_tag_serial_no" for every entry in "product_2_tag".

I struct with this problem Please help me out.