[Gambas-user] How to get started with WebView

Benoît Minisini gambas at ...1...
Tue Jan 24 10:36:16 CET 2017


Le 24/01/2017 à 10:11, Rolf-Werner Eilert a écrit :
> Am 23.01.2017 20:28, schrieb Benoît Minisini:
>> Le 23/01/2017 à 18:41, Rolf-Werner Eilert a écrit :
>>> Hi,
>>>
>>> I have 3.9.2 installed and started a new project as WebView project.
>>>
>>> Then added WebForm from the components.
>>>
>>> Then added a new form called Webform1.
>>>
>>> Then added a button, text area etc.
>>>
>>> When I press start, I get a Konqueror instance showing the example table
>>> from the Main.webpage. But there is nothing to see from the Webform.
>>>
>>> I guess I have to call the Webform from the Main.webpage somehow, but
>>> how? Or am I totally wrong here?
>>>
>>> Thanks for your insight!
>>>
>>> Regards
>>> Rolf
>>>
>>
>> Are you using gb.web or gb.web.form?
>>
>> If you use gb.web only:
>>
>> Remove the Main.webpage, and make your own webpage the startup form.
>>
>> If you have several forms, and want to decide which one to show, you
>> have to create a startup module (or class), and from the Main()
>> function, you have to analyze the Request object, and decide which form
>> to show by calling the Render() method of the form. The Render() method
>> will use the Response class to send back to the browser the page contents.
>>
>> Regards,
>>
>
> Thank you for the tip with the startup form. I made Webform1.webform the
> startup form, now I get a response with the webform. But I haven't tried
> Render() and Response class yet, just played around a bit with a button,
> text area and label.

You are confused. I said "if you use gb.web only".

Response and Request are the low-level class of the gb.web component.

If you make a 'gb.web.form' application, you have less use of them, are 
most of the things are managed directly by the gb.web.form component.

>
> Whenever I start, I get two errors in the konsole window:
>
> gb.httpd: bind 0.0.0.0 - Address already in use
> gbx3: warning: cannot switch to language 'de.UTF-8': No such file or
> directory. Did you install the corresponding locale packages?
>
> Anything to worry about?

The first message is not important. I didn't take the time to see why 
the 'gb.httpd' component always display it.

The second message means that your web browser has requested the german 
language, and that the german localization is not installed on your system.

Regards,

-- 
Benoît Minisini




More information about the User mailing list