<br><br><div><span class="gmail_quote">On 10/11/06, <b class="gmail_sendername">Aaron Patterson</b> &lt;<a href="mailto:aaron_patterson@speakeasy.net">aaron_patterson@speakeasy.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Michele,<br><br>On Wed, Oct 11, 2006 at 10:09:57AM +0200, michele mendel wrote:<br>&gt; I'm trying to submit data in JSPWiki (edit page). I can read the data<br>&gt; in the form, but nothings get saved when I submit the page. Cancel
<br>&gt; doesn't work either. I don't get any errors. There is no JavaScript<br>&gt; used to submit the form.<br>&gt;<br><br>This might be a dumb question, but how do you know that cancel doesn't<br>work?&nbsp;&nbsp;What are you expecting it to do?
</blockquote><div><br>[michele] When you start to edit a page that someone else has started to edit, you'll get informed about this. My script logs in, starts to edit the page and then saves or cancels. When I want to edit the same page I get the information that 'red' is still working on it, 
i.e. cancel didn't work.<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; After I'm logged in I do the following:<br>&gt;
<br>&gt; def save(page, content)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;@agent.get(@base_url + &quot;Edit.jsp?page=#{page}&quot;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;form = @agent.page.forms.with.name('editForm')<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;form.fields.name('_editedtext').value = content<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;form.submit(form.buttons.first)<br>&gt; end<br>&gt;<br>&gt; And this is the cancel method (the @agent already got the edit page)<br>&gt;<br>&gt; def cancel<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;form = @agent.page.forms.with.name('editForm')
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;form.submit(form.buttons.name('cancel'))<br>&gt; end<br>&gt; Michele<br>[snip]<br><br>It is hard for me to debug this from just the headers...&nbsp;&nbsp;I'd actually<br>have to try it out.&nbsp;&nbsp;So I used the wiki set up on 
<a href="http://jspwiki.org">jspwiki.org</a> with the<br>following script:<br><br>&nbsp;&nbsp;agent = WWW::Mechanize.new<br>&nbsp;&nbsp;page = agent.get('<a href="http://www.jspwiki.org/Edit.jsp?page=TestPage'">http://www.jspwiki.org/Edit.jsp?page=TestPage'
</a>)<br>&nbsp;&nbsp;form = page.form('editForm') { |f|<br>&nbsp;&nbsp;&nbsp;&nbsp;f._editedtext &lt;&lt; &quot;baz&quot;<br>&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;agent.submit(form, form.buttons.first)<br><br>And that seems to work fine for me.&nbsp;&nbsp;Is there a place that is publicly
<br>available where you can reproduce this error?</blockquote><div><br>[michele] I'll check that out. I will also try to use your code, because I got errors with agent.submit. That's why I use form.submit.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
--<br>Aaron Patterson<br><a href="http://tenderlovemaking.com/">http://tenderlovemaking.com/</a><br>_______________________________________________<br>Mechanize-users mailing list<br><a href="mailto:Mechanize-users@rubyforge.org">
Mechanize-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/mechanize-users">http://rubyforge.org/mailman/listinfo/mechanize-users</a><br></blockquote></div><br>