Google Books API implementation


I tried to implement the google api for Books in my project but it failed. I tried multiple ways but due to a lack of experience with CUBA. I haven’t managed to find a solution.

Kind regards
Ricardo Mayorga Mera

Hi Ricardo,

Please post more details: what you have tried, what works and what doesn’t.

I tried making a search bar with html.
The results would be displayed on the page and depending which book the user picks it would redirect to the right weblink.
This would happen with my javascript file.

I put the html into a htmlbox and tried to put my javascript into the html. But somehow the htmlbox would erase the script part and only output the html on the website.
The only thing I need is a way to link my javascript to the html and if possible my css file as well.

this is how it should look like


The easiest way to integrate custom HTML markup into your application is to use BrowserFrame UI component. You find documentation in our manual: BrowserFrame - CUBA Platform. Developer’s Manual and samples here:

You can define it in XML as follows:

<browserFrame id="browserFrame"

It supports different source types: ClasspathResource, FileResource, UrlResource, etc.

For instance, you can even generate HTML content dynamically:

public class ExtAppMainWindow extends AppMainWindow {
    private BrowserFrame browserFrame;

    public void init(Map<String, Object> params) {

        byte[] bytes = "<h1>DEMO</h1>".getBytes(StandardCharsets.UTF_8);
                .setStreamSupplier(() -> new ByteArrayInputStream(bytes))

BrowserFrame will add separate <firame> element with content into DOM tree and it supports JavaScript tags as usual. In fact, HtmlBoxLayout is aimed for custom layouts with integrated UI components, that’s why it removes all JS nodes from HTML.