After googling around on this topic, it seems that there is no clean way of
doing this.

The initial community-accepted way I managed to find was using javascript
(Browser.execute(String)) to retrieve your data, store it in window.status
and then, a BrowserStatusText listener would get that value from the status
text. An example is here:
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/QueryDOMnodevalue.htm

On the other hand, by checking the Eclipse/SWT API, it seems that
Browser.evaluate(String) also got implemented along the way and, compared to
execute(String), it actually returns the value of the executed JavaScript so
you can use it directly. Documentation here:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fbrowser%2FBrowser.html

So, to sum it up, use JS to document.getElementById(...) for each field in
the form and use their names+values to build the request performed by your
Finish button.

Hope this helps,
Eduard

P.S.: Can you post a screenshot of the wizard page containing the template's
form?

On Tue, Jun 28, 2011 at 2:56 PM, Karel Gardas <[email protected]>wrote:

>
> Hi Eduard,
>
> On 06/15/11 06:59 PM, Eduard Moraru wrote:
> > Hi Karel,
> >
> > On 06/15/2011 01:54 PM, Karel Gardas wrote:
> >> Hello Sergiu,
> >>
> >> thanks a lot for you hint, when I renamed
> >> xwiki-enterprise-web-3.1-SNAPSHOT to simple xwiki, then after clicking
> >> on<save and view>   button I got to normal login screen and when I log
> in
> >> the page is really created.
> >>
> > If you look at my first reply (with initial suggestions), you`ll see
> > that I suggested that the actual Save action when completing the
> > creation of a page should be performed by your wizard`s Finish button
> > (sending a HTTP request with all the parameters set), otherwise you mix
> > up the user by having 2 sets of buttons (XWiki`s and the wizard`s).
>
> I remember well your initial recommendation. Thanks for it! The way of
> using SWT browser directly was just rather a proof-of-concept of the
> idea of having browser embedded inside the wizard. Now, the situation is
> a little bit different. I do have:
>
> - small http client code which logs into xwiki server if needed and
> access the newly created page
> - strip all not needed information from the newly created page and leave
> just a form to fill the template data
> - show such page in the browser embedded inside the wizard window and
> allow user to fill the form.
>
> That's what working. Now I would like to press Finish button get the
> filled form from SWT browser (somehow!) and POST it to the xwiki server
> to save the page with entered data. The problem is that if I use
> getText() method on SWT browser it does not return page with filled data
> and I don't see any other API which should support this.
>
> So my question now is : do you have any idea how to get filled form page
> from the browser back into my code?
>
> Thanks a lot!
> Karel
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to