Why does the url not change on my visual force page

37 views Asked by At

I am redirecting to a vf page from my LWC

async navigateToVFPage() {        
    this[NavigationMixin.GenerateUrl]({
        type: 'standard__webPage',
        attributes: {
            url: '/apex/SampleVfPage
        }
    }).then(generatedUrl => {
        window.location.href = generatedUrl;
    });
}

once redirected to SampleVfPage i am doing some processing and redirecting to a second vf page here is my Vf page

<apex:page controller="SampleVfController" action="{!redirect}">
    <apex:form >
        <apex:pageBlock title="My Button Page">
            <apex:pageBlockButtons >
                <apex:commandButton value="Click Me!" action="{!handleButtonClick}" rerender="outputPanel"/>
            </apex:pageBlockButtons>            
        </apex:pageBlock>
    </apex:form>
</apex:page>

here is my controller where i am redirecting to second Vf page

public PageReference redirect(){     
        PageReference seekApply = new PageReference('/apex/SampleVFpage2');
        seekApply.setRedirect(true);
        return seekApply;    
    }

The redirection is happening but dosent reflect in the url

0

There are 0 answers