Skip to Content
author's profile photo Former Member
Former Member

sapui5 opa5 how to write a OPA Script for an Input Control available in another project

I have 2 projects in my WebIDE workspace..

I have a strange requirement, i have a view which consists of 3 fields(One Input Picker and 2 input fields).. Here Input Picker is available in another project, But in the Current Project im accessing that field in my view.xml file using in this way..

View.xml

<Label text="Opportunity" required="true" id="oppIdLbl"></Label>
<core:ComponentContainer id="pcOpportunityInputComponent" name="com.tools.pc.oppdataopportunity" propagateModel="true"></core:ComponentContainer>

in OPA script i have imported the other project in .html file in this way..

<script id="sap-ui-bootstrap"
            src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
            data-sap-ui-resourceroots='{
            "com.tools.pc.oppdataopportunity":"../../../../opportunity/webapp/view/opportunity",
            "com.tools.melody.activityForm.test": "../",
            "com.tools.melody.activityForm.app" : "../index"
        }'
            data-sap-ui-frameOptions='deny'>
    </script>

View file Available in another Project

    <mvc:View controllerName="com.tools.pc.oppdataopportunity.controller.opportunity" xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" xmlns:oppor="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
    <Input valueHelpOnly="true" showValueHelp="true" valueHelpRequest="onOpportunityValueHelp" id="pcOpportunityInput" fieldGroupIds="pcOpportunityInput" change="onOppChange"></Input>
</mvc:View>

in my OPA Configuration file i have configured my Current Project in this way..

Opa5.extendConfig({
        viewName : "test",
        arrangements: new Common(),
        viewNamespace:"com.tools.melody.activityForm.view.",
        autoWait: true
    });

Here viewNamespace is a String, So atmost we can configure only One Project related Views.. But how can i write the OPA Script in the Current Project by access the above View file which is available in the Other Project??

Please help me with the above query..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.