$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

XML view control ID - different from FLP ?

Hi All,

I have control in one of my XML view its id is "idserAgnt" ...when the app is runnig on browser I can see the iD change to "__xmlview1--idserAgnt"... and wrote my code on "__xmlview1--idserAgnt".

<Input id="idserAgnt" enabled ="false" />

But when I ran this app from Fiori launchpad...ID ("__xmlview1--idserAgnt") remains same for the first time...when I navigate back and forth its chagning for ex : __xmlview5--idserAgnt.

So I need a way to know how I can handle this, in UI5- JS views this is not the case.

Thanks

Rajesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 06, 2017 at 05:18 PM

    Controls within XML views, have a dynamic first part in their IDs.

    So to access a control, you need to do

    <instanceofView>.byId('idserAgnt')

    For example,

    this.getView()..byId('idserAgnt')

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 07, 2017 at 02:53 PM

    Hi Kishore,

    Thanks and its works, I feel assigning a ID to view at routing is much better one.

    In my scenario there is a page which loads from Detail page, please find routing below

    routing: {
    config: {
    routerClass: "com.ShipmentUpdate.MyRouter",
    viewType: "XML",
    viewPath: "com.ShipmentUpdate.view",
    targetAggregation: "pages",
    clearTarget: false
    },
    routes: [{
    pattern: ["", "SelectionView"],
    name: "SelectionView",
    viewName: "SelectionView",
    viewId: "idSelView",
    targetControl: "idMasterApp",
    targetAggregation: "pages"
    }, {
    pattern: "split",
    name: "App",
    view: "App",
    targetAggregation: "pages",
    targetControl: "idMasterApp",
    subroutes: [{
    pattern: "split/",
    name: "split",
    viewName: "Master",
    viewId: "idMaster",
    targetAggregation: "masterPages",
    targetControl: "idAppControl",
    subroutes: [{
    pattern: "shipmentDetail/{tknum}/{vbeln}/:tab:",
    name: "shipmentDetail",
    viewName: "Detail",
    viewId: "idDetail",
    targetAggregation: "detailPages"
    }, {
    pattern: "shipmentUpdate/{tknum}/tab",
    name: "shipmentUpdate",
    viewName: "AddShipmentItem",
    viewId: "idAddShpItm",
    targetAggregation: "pages"
    }]
    }]
    }]
    }
    
    And I assigned ID for each of the which works for me, but the issue I am facing is ID is not geneated to the view for the last page which is "viewId: "idAddShpItm","  still its generating on its own like--xml....
    
    advise me how can I sort this
    
    Thanks
    Rajesh
    Add comment
    10|10000 characters needed characters exceeded