You need to sign in to do that
Don't have an account?
Siva Sakthi
Have to open a Popup window by clicking the Command button
Hi,
I have created a Component and a Page.Below is my Component Code
<apex:component controller="contentController">
<script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script>
<script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
<Script type="text/javascript">
function WindowNew()
{
Window.open('https://dataloader.io/');
}
</Script>
<apex:form >
<apex:commandbutton onclick="Window.open('https://dataloader.io/')" value=" Upload "/>
<apex:commandbutton onclick="Window.open();" value="Upload "/>
</apex:form>
</apex:component>
Below is my Page Code
<apex:page controller="contentController">
<script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script>
<script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
<c:BulkUpload />
</apex:page>
While clicking the Button,the window is not opening as a popup.Can anyone help me to solve this issue.
Thanks
Maheshwar
I have created a Component and a Page.Below is my Component Code
<apex:component controller="contentController">
<script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script>
<script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
<Script type="text/javascript">
function WindowNew()
{
Window.open('https://dataloader.io/');
}
</Script>
<apex:form >
<apex:commandbutton onclick="Window.open('https://dataloader.io/')" value=" Upload "/>
<apex:commandbutton onclick="Window.open();" value="Upload "/>
</apex:form>
</apex:component>
Below is my Page Code
<apex:page controller="contentController">
<script src="/soap/ajax/15.0/connection.js" type="text/javascript"></script>
<script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
<c:BulkUpload />
</apex:page>
While clicking the Button,the window is not opening as a popup.Can anyone help me to solve this issue.
Thanks
Maheshwar
This may help you
Thanks
Shaijan Thomas
You need to add return infront of confirm.So when u click on ok it returns true and call action method otherwise do nothing.
<apex:commandbutton onclick="return Window.open('https://dataloader.io/')" value=" Upload "/>
shaijan
Note: I will add the same java script funtion in many pages. so, i want to avoid copy & past same code in many page. thats why i have created the component for the same function to use many pages. Please guide me to add and call the same java script function and CSS files in component .
<apex:commandbutton onclick="return Window.open('https://dataloader.io/')" value=" Upload "/>
Thanks
Maheshwar