on 04-08-2016 5:23 AM
Hi
We are moving on to Portal 7.4.
One of the features we have is consuming a web service.
Since I find it very complicated, I would like to know
if it is possible to use Jquery.ajax on portal?
Thank you
Rrgards
yuval
Hi Yuval,
Did yo manage to add jQuery?
BR,
Saar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yuval,
Yes, it is possible to use AJAX for Portal version 7.4.
I have used ajax calls successfully in my custom components for EP 7.4
Let me know in case you have any questions.
Best Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yuval,
Consuming jQuery is quite easy.
My suggestion is to create an iView that you place on your framework page to manage all of your third party scripts (or else you will have lots of applications for no reason).
Create a portal component and use the PRT's IResource to add scripts:
public class myScriptsComponent extends AbstractPortalComponent {
public void doContent(
IPortalComponentRequest request,
IPortalComponentResponse response) {
IResource jquery =
request.getResource(IResource.SCRIPT, "scripts/jquery.min.js");
response.include(request, jquery);
}
}
That is all to it.
Summary:
1. create portal component with above code.
2. create a folder inside of your component calls scripts.
3. add file name jquery.min.js (or whatever name you want just make sure you refer to it).
4. build and deploy the component.
5. find the application in the portal applications tree.
6. right click copy, right click on a folder you want and select "paste as PCD Object" (this will create an iView from the application).
7. add the iView to your framework page (if AFP then in the hidden container).
8. make sure you unchecked / set to false the "show tray" property on the iView.
9. save.
You should now have jQuery available.
BR,
Saar
Hi Sai,
You need to create your own portal component, once you create it you open the folder "portal applications" under content management find your app, right click on the portal application you created and choose "copy" go to a folder, right click and select "paste as PCD Object" this will create the iView for you with the application as it's source.
BR,
Saar
Hi Saar,
Appreciate your quick response.
I have created JSPDynPage portal component with the jQuery library under the scripts folder as shown below:
and I have written a sample code in the jsp as below:
<script src="scripts/jquery-3.1.0.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
Then, when I preview the iview I get the below error messages:
It can't find the resource under the scripts folder. Can you please let me know what am I missing here?
Regards,
Sai
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.