Documentation

(reactui)

Programmatically fetch

If you use a work-screen for accessing your data, but the screen is completely customized (react code) you'll have a problem with record count. The number of initially loaded records is limited to 100 (set via startup request). If you open a custom screen, it only receives max. 100 records. This is not a problem if you use data components like table/grid or charts, because all standard components support lazy-loading of records.

If you have a custom screen, you have to do it on your own. The documentation contains detailed information.

Here's an example:

import React, { FC, useEffect } from "react";
import { REQUEST_KEYWORDS, ScreenWrapper, createFetchRequest, useAPI } from "@sibvisions/reactui";
 
const ScreenWrapperContacts:FC<any> = (props) => {
    const api = useAPI(); // use api to send a request to the server
 
    // useEffect with empty dependency array to only call it once on mount!
    useEffect(() => {
        const fetchReq = createFetchRequest();
        fetchReq.dataProvider = "JVxMobileDemo/Con-CG/contacts#4"; // the name of your dataprovider
        fetchReq.rowCount = -1; // -1 to receive all data
        api.sendRequest(fetchReq, REQUEST_KEYWORDS.FETCH);
    }, []);
 
    return (
        <ScreenWrapper onOpen={onOpen}>
            {workScreen =>
                <>
                    {workScreen}
                </>
            }
        </ScreenWrapper>
    )
}
export default ScreenWrapperContacts

In above example, we use the the Contacts screen of our demo project. The dataprovider name is JVxMobileDemo/Con-CG/contacts#4.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information