Opened 12 years ago

Closed 12 years ago

#2998 closed defect (fixed)

Editor2 does not update the hidden input field, therefore submitting does not push the data to the server

Reported by: guest Owned by: liucougar
Priority: high Milestone: 0.9
Component: Editor Version: 0.4.2
Keywords: Editor2 submit Cc: attila.lendvai@…
Blocked By: Blocking:

Description

with a simple Editor2 setup, using <textarea name="foo" dojo:type="Editor2"> the contents of the textarea is not updated when the Editor2 widget is changed by the user.

probably an onchane event handler should update the value of the dom node that was used to instantiate the Editor2 widget (when it's an input node).

or do i badly miss something?

Change History (10)

comment:1 Changed 12 years ago by guest

oh, i forgot to mention that it's version 8582 from svn.

comment:2 Changed 12 years ago by Adam Peller

Owner: changed from anonymous to liucougar

comment:3 Changed 12 years ago by guest

some more info: seems like RichText?.js is trying to deal with form submitting using this:

if(this.textarea.form){
	dojo.event.connect('before', this.textarea.form, "onsubmit",
		// FIXME: should we be calling close() here instead?
		dojo.lang.hitch(this, function(){
			this.textarea.value = this.getValue();
		})
	);
}

but it doesn't seem to get called when ajax-submitting the form using dojo.io.bind and therefore the value of the textarea is empty when posted.

comment:4 Changed 12 years ago by guest

fyi, #3283 is somewhat related to this.

comment:5 Changed 12 years ago by Adam Peller

Component: GeneralDijit

comment:6 Changed 12 years ago by guest

fyi, i've implemented full js based nested form support and the new code does not rely on the normal form submission anymore, therefore this issue is not making me headaches anymore.

comment:7 Changed 12 years ago by bill

Component: DijitEditor
Milestone: 0.9

I know that Editor doesn't want to serialize it's value to the hidden <input> every time type a character (too expensive) but I thought it connected to the form's onsubmit or something?

comment:8 Changed 12 years ago by guest

yep, it attaches to form.onsubmit, but form.onsubmit is not called when submitting it with dojo.io.bind.

in my current setup i'm not using html form tags anymore, but rather use my own form repository on the client side, keeping track of the form fields and iterating them to collect the data to be submitted. this way i can flexibly handle everything, including nested forms which is not supported by <form>.

so i think we can close this ticket and wait until dijit is out. then i'll report back if i find some problem.

comment:9 Changed 12 years ago by bill

I see. OK, we should at least make sure that an editor in a Form widget has it's value correctly serialized (see test_Form.html).

comment:10 Changed 12 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [9887])

  • fixes #3926
  • fixes #2998: now Editor widget works in Form widget (see the updated Form test file); disabled normal form submit support in Editor for now
Note: See TracTickets for help on using tickets.