[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Mechanize: save and cancel doesn't work in JSPWiki

michele

10/10/2006 12:04:00 PM

I'm trying to submit data in JSPWiki (edit page). I can read the data
in the form, but nothings get saved when I submit the page. Cancel
doesn't work either. I don't get any errors. There is no JavaScript
used to submit the form.

After I'm logged in I do the following:

def save(page, content)
@agent.get(@base_url + "Edit.jsp?page=#{page}")
form = @agent.page.forms.with.name('editForm')
form.fields.name('_editedtext').value = content
form.submit(form.buttons.first)
end


And this is the cancel method (the @agent already got the edit page)

def cancel
form = @agent.page.forms.with.name('editForm')
form.submit(form.buttons.name('cancel'))
end


Michele

2 Answers

Aaron Patterson

10/11/2006 12:17:00 AM

0

On Tue, Oct 10, 2006 at 09:05:10PM +0900, michele wrote:
> I'm trying to submit data in JSPWiki (edit page). I can read the data
> in the form, but nothings get saved when I submit the page. Cancel
> doesn't work either. I don't get any errors. There is no JavaScript
> used to submit the form.
>
> After I'm logged in I do the following:
>
> def save(page, content)
> @agent.get(@base_url + "Edit.jsp?page=#{page}")
> form = @agent.page.forms.with.name('editForm')
> form.fields.name('_editedtext').value = content
> form.submit(form.buttons.first)
> end
>
>
> And this is the cancel method (the @agent already got the edit page)
>
> def cancel
> form = @agent.page.forms.with.name('editForm')
> form.submit(form.buttons.name('cancel'))
> end

Can you try turning on logging, and sending the log to the
mechanize-users mailing list?

http://rubyforge.org/mail/?gro...

Then I can try to help you out more.

--
Aaron Patterson
http://tenderlovem...

michele

10/11/2006 8:16:00 AM

0

Aaron Patterson skrev:
> On Tue, Oct 10, 2006 at 09:05:10PM +0900, michele wrote:
> > I'm trying to submit data in JSPWiki (edit page). I can read the data
> > in the form, but nothings get saved when I submit the page. Cancel
> > doesn't work either. I don't get any errors. There is no JavaScript
> > used to submit the form.
> >
> > After I'm logged in I do the following:
> >
> > def save(page, content)
> > @agent.get(@base_url + "Edit.jsp?page=#{page}")
> > form = @agent.page.forms.with.name('editForm')
> > form.fields.name('_editedtext').value = content
> > form.submit(form.buttons.first)
> > end
> >
> >
> > And this is the cancel method (the @agent already got the edit page)
> >
> > def cancel
> > form = @agent.page.forms.with.name('editForm')
> > form.submit(form.buttons.name('cancel'))
> > end
>
> Can you try turning on logging, and sending the log to the
> mechanize-users mailing list?
>
> http://rubyforge.org/mail/?gro...
>
> Then I can try to help you out more.
>
> --
> Aaron Patterson
> http://tenderlovem...


Ok, done

Michele