Skip to Content
0

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

Sep 13, 2017 at 04:08 PM

62

avatar image
Former Member

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..

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers