How to open a specific page with a button

620
1
Jump to solution
09-03-2021 08:44 AM
by Anonymous User
Not applicable

Could someone point me in the right direction for opening a page with a custom button?

The following code is close. It unfortunately opens /0/page/page_0//page_1

 

        <Button tag={Link} to="page_1" type="danger" size="sm"  >
          {this.props.intl.formatMessage({
            id: "open_fac_details",
            defaultMessage: defaultMessages.open_fac_details
          })}
        </Button>

 

And /page_1 reduces the entire url to http://server/page_1

To note, something like ?views=view_3 correctly open to the specific view

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

For reference, by diving into ExB source, I found how the LinkProps were defined and there is a LinkResult property that can be used to say "open a new page":

import {  Button, Link } from "jimu-ui";

        <Link target="_self" to={{
          linkType: LinkType.Page,
          value: "page_1"
          
        }} >        
          <Button  type="danger" size="sm" className="btn float-right" css={[reportBtn]} >
              Open  
          </Button>
        </Link>

 

Note the "page_1" is case sensitive. "Page_1" will not match.

View solution in original post

1 Reply
by Anonymous User
Not applicable

For reference, by diving into ExB source, I found how the LinkProps were defined and there is a LinkResult property that can be used to say "open a new page":

import {  Button, Link } from "jimu-ui";

        <Link target="_self" to={{
          linkType: LinkType.Page,
          value: "page_1"
          
        }} >        
          <Button  type="danger" size="sm" className="btn float-right" css={[reportBtn]} >
              Open  
          </Button>
        </Link>

 

Note the "page_1" is case sensitive. "Page_1" will not match.