Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1] 2
  Reply  |  Print  
Author Topic: Embedded Browser in Genero 2.30  (Read 46061 times)
James S.
Posts: 14


« on: October 10, 2013, 03:28:22 am »

Hi all,

I am trying to use the embedded browser that was introduced in Genero 2.20 on my Genero 2.30 system in order to display a webpage.

Does this feature still exist in Genero 2.30?

If so, could someone please give me an example of how to set up the embedded browser, as I am having trouble getting it working using the existing documentation.

Thanks,

James
Reuben B.
Four Js
Posts: 1046


« Reply #1 on: October 10, 2013, 03:45:34 am »

Are you using a TEXTEDIT or an IMAGE?  It was moved from TEXTEDIT to IMAGE somewhere around those versions you mention.

https://4js.com/online_documentation/fjs-fgl-manual-html/User/PresentationStyles.html#STYATT_IMAGE

Other thing to watch out for perhaps, are you using 32-bit GDC or 64-bit GDC?

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
James S.
Posts: 14


« Reply #2 on: October 10, 2013, 04:21:06 am »

Hi Rueben,

I tried both, but I may have to try again I guess.

I am using 32 bit version of the GDC.

This may be my lack of knowledge, but I am meant to do something like the following within a style file yes?

 <Style name="image.browser">
    <StyleAttribute name="ImageContainerType" value="browser"/>
  </Style>

Thanks,

James
Reuben B.
Four Js
Posts: 1046


« Reply #3 on: October 10, 2013, 04:36:23 am »

I can never remember when case is important but try this ...

Code
  1.   <Style name="Image.browser">
  2.    <StyleAttribute name="imageContainerType" value="browser"/>
  3.  </Style>

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
James S.
Posts: 14


« Reply #4 on: October 10, 2013, 04:50:29 am »

Hi Rueben,

Thanks for the help. Unfortunately, this did not resolve the trouble I am having.

When running the program, it just results in a white square where the image is, instead of the embedded browser that I am expecting.

Thanks,

James
Reuben B.
Four Js
Posts: 1046


« Reply #5 on: October 10, 2013, 06:54:36 am »

This is my little test ...
Code
  1. MAIN
  2.    CALL ui.Interface.loadStyles("browser")
  3.    CLOSE WINDOW SCREEN
  4.    OPEN WINDOW w WITH FORM "browser"
  5.    #DISPLAY "https://4js.com" TO browser
  6.    #DISPLAY "http://www.google.com" TO browser -- redirection issue
  7.    DISPLAY "https://4js.com/online_documentation/fjs-fgl-manual-html/" TO browser
  8.    MENU ""
  9.        ON ACTION close
  10.            EXIT MENU
  11.    END MENU
  12. END MAIN

Code
  1. LAYOUT (TEXT="Browser")
  2. GRID
  3. {
  4. [browser                                 ]
  5. [                                        ]
  6. [                                        ]
  7. [                                        ]
  8. [                                        ]
  9. [                                        ]
  10. [                                        ]
  11. [                                        ]
  12. [                                        ]
  13. [                                        ]
  14. }
  15. END
  16. ATTRIBUTES
  17. IMAGE browser=formonly.browser, STRETCH=BOTH,STYLE="browser";

Code
  1. <StyleList>
  2.   <Style name="Image.browser">
  3.    <StyleAttribute name="imageContainerType" value="browser"/>
  4.  </Style>
  5. </StyleList>





Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
James S.
Posts: 14


« Reply #6 on: October 10, 2013, 07:10:28 am »

Hi Reuben,

Trying something like that,

Code
  1.    <Grid name="grid2" width="47" height="23">
  2.        <Image name="browser" width="43" height="20" image="http://news.customs.gov.au/RSS_news_feed.asp?CAT=1" style="browser" posY="1" posX="3" gridWidth="43" gridHeight="20"/>
  3.    </Grid>
  4.  

Code
  1. <Style name="Image.browser">
  2.   <StyleAttribute name="imageContainerType" value="browser"/>
  3. </Style>
  4.  

Code
  1. DISPLAY "http://news.customs.gov.au/RSS_news_feed.asp?CAT=1" TO browser

And genero is happily telling me:

FORMS statement error number -1102.
Field (browser) not found in form.
Reuben B.
Four Js
Posts: 1046


« Reply #7 on: October 10, 2013, 07:41:17 am »

I think you have a Static Image in your form, not a Dynamic Image field.

A static image remains the same, whilst a dynamic image can be DISPLAY'ed to.

https://4js.com/online_documentation/fjs-fgl-manual-html/User/FormSpecFiles.html#FF_ITEMTYPE_IMAGE

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
James S.
Posts: 14


« Reply #8 on: October 10, 2013, 07:48:37 am »

Thanks, that was the cause of that error.

As you can probably tell, I am still fairly new to the GDC.

However, it is still displaying as an empty white square instead of the page I am expecting to show.

I have tested with the link you used also, with the same result.
Lionel F.
Four Js
Posts: 82


« Reply #9 on: October 10, 2013, 10:00:28 am »

Hello James,

By any chance, does your internet connection pass through a proxy?

If so, you need to specify the proxy settings in the connection tab of the options panel. Indeed, by default GDC doesn't inherit the system proxy settings.

Best regards,
Lionel
James S.
Posts: 14


« Reply #10 on: October 10, 2013, 11:30:45 pm »

Hi Lionel,

Good question, and probably the right one to ask.

I probably am behind a company proxy which would be stopping it.

I will try again once I have the details and post the results.

James
James S.
Posts: 14


« Reply #11 on: October 11, 2013, 12:12:49 am »

Well it seems I dont have access to the options panel on my machine.

It was suggested to me that I could instead try to display a local html file as a check to see if it is the proxy causing issues.

However this resulted in the same white square.

Is it possible to display local files in the embedded browser?
Reuben B.
Four Js
Posts: 1046


« Reply #12 on: October 11, 2013, 12:18:51 am »

James,

Re: the options panel, start the GDC in admin mode (-a) https://4js.com/online_documentation/fjs-gdc-manual-html/User/CmdLine.html

If you are planning to use the RSS News Feed URL you had in an earlier post, you may find that after you overcome the proxy issue you will be disappointed.

In my small program if I use the GDC and your URL I get what looks like raw html, if I use the GWC I get a page similar to what I see in a browser.  For the GDC note this disclaimer in the documentation https://4js.com/online_documentation/fjs-fgl-manual-html/User/PresentationStyles.html#STYATT_IMAGE
"Note: This feature uses the WebKit Open Source project as provided with Qt, and has limitations such as no Java or ActiveX support. It will display HTML / rich text, but may encounter difficulties with more complex Web pages"

An alternative way to read this RSS news feed would be to use the methods in the com library to read the RSS news feed into an XML document, and from there you can filter out what parts of the news feed you want to display

Code
  1. IMPORT com
  2. IMPORT xml
  3. DEFINE req com.HttpRequest
  4. DEFINE resp com.HttpResponse
  5. DEFINE str STRING
  6. DEFINE doc xml.DomDocument
  7.  
  8.    LET req = com.httpRequest.Create("http://news.customs.gov.au/RSS_news_feed.asp?CAT=1")
  9.    CALL req.doRequest()
  10.    LET resp = req.getResponse()
  11.    -- Either read as string or XML
  12.    LET doc =resp.getXmlResponse()
  13.    #LET str = resp.getTextResponse()  

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
James S.
Posts: 14


« Reply #13 on: October 11, 2013, 12:21:35 am »

Hi Rueben,

Thanks for the reply.

However I have been told to drop the idea of an external webpage for the time being and focus on trying to get a local html file to work instead.

Any comment on if it should or shouldn't work?

James
Reuben B.
Four Js
Posts: 1046


« Reply #14 on: October 11, 2013, 12:43:20 am »

Probably not...

Bz15152 Integrated browser: being able to display a local html file using "file:///" protocol

...fixed in GDC 2.50.00

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1] 2
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines