Question

The title is self explanatory.

I'm developing a view in SAPUI5 using the XML view format and I don't know (and can't find information anywhere) how to make a link inside the view.

For example, given this code:

<ColumnListItem type="Navigation" press="handleLineItemPress">
    <cells>
        <ObjectIdentifier title="{Version}" />
        <ObjectNumber number="{Ejercicio}"/>
        <ObjectNumber number="{PlanInicial}"/>
        <ObjectNumber number="{Transferencias}"/>
        <ObjectNumber number="{PlanActual}"/>
        <ObjectNumber number="{ImporteCursado}"/>
        <ObjectNumber number="{PlanDisponible}"/>
        <Text text="{Moneda}"/>
    </cells>
</ColumnListItem> 

I need to be able to add a link to any of the ObjectNumber.

I've looked everywhere but I'm not able to find anything.

Thanks in advance for your time, Hoijof.

Was it helpful?

Solution

press=".onObjectNumberPress"

in controller:

onObjectNumberPress: function(e) {
   var iNumber = e.getSource().getNumber();
   //open in same window
   window.location.href = "http://google.de?q="+iNumber;
   //open in new window
   window.open("http://google.de?q="+iNumber);
}

not tested, but should work.

but also you can write html-code in xml-view. just add the html-namespace to document-header.

<core:View controllerName="my.own.controller" 
   ... 
   xmlns:html="http://www.w3.org/1999/xhtml">

<html:a href="http://google.de?q=123">TestLink</html:a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top