<br><br><div><span class="gmail_quote">On 10/11/06, <b class="gmail_sendername">Aaron Patterson</b> <<a href="mailto:aaron_patterson@speakeasy.net">aaron_patterson@speakeasy.net</a>> 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>> I'm trying to submit data in JSPWiki (edit page). I can read the data<br>> in the form, but nothings get saved when I submit the page. Cancel
<br>> doesn't work either. I don't get any errors. There is no JavaScript<br>> used to submit the form.<br>><br><br>This might be a dumb question, but how do you know that cancel doesn't<br>work? 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;">> After I'm logged in I do the following:<br>>
<br>> def save(page, content)<br>> @agent.get(@base_url + "Edit.jsp?page=#{page}")<br>> form = @agent.page.forms.with.name('editForm')<br>> form.fields.name('_editedtext').value = content<br>
> form.submit(form.buttons.first)<br>> end<br>><br>> And this is the cancel method (the @agent already got the edit page)<br>><br>> def cancel<br>> form = @agent.page.forms.with.name('editForm')
<br>> form.submit(form.buttons.name('cancel'))<br>> end<br>> Michele<br>[snip]<br><br>It is hard for me to debug this from just the headers... I'd actually<br>have to try it out. So I used the wiki set up on
<a href="http://jspwiki.org">jspwiki.org</a> with the<br>following script:<br><br> agent = WWW::Mechanize.new<br> page = agent.get('<a href="http://www.jspwiki.org/Edit.jsp?page=TestPage'">http://www.jspwiki.org/Edit.jsp?page=TestPage'
</a>)<br> form = page.form('editForm') { |f|<br> f._editedtext << "baz"<br> }<br><br> agent.submit(form, form.buttons.first)<br><br>And that seems to work fine for me. 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> </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>