Adding Controls on Smart template using Annotations…SAP WEB IDE
Hi all
i have created a blog
Create Smart Template Project………SAP WEB IDE
Now in Smart template if we want to add some controls like Data Field,Line item , Data point , presentation Variant etc
we don’t need to write code on JS , XML , HTML etc we can add controls by using Annotation file .
STEP 1.
open Annotation folder => right click on annotation.xml
here you can open 3 way.
code editor – you to wirte code your self .which can be difficult
so open file by Annotation Modeler after click this u will get
Click on Green icon
here you can chose function what you want add on smart template project.
Example 1 : i want to add on line item one Action button and one Navigation Button on overview page like this
so to create this select UI.LineItem and click Ok
then click Plus Icon on Line Item you will get
here you have to select controls according to your req.
now i select DatafieldforAction and DatafieldForIntentBasedNavigation
now you will see
Now click 1st one Data filed for Action U will get from Right side u have to fill.den
like this
click on apply Save Project
Run The Project Again
now when i run then project i got my desire output
So it was just a example .
plz do comment for any controls.which you want add on overview Page or List view Page
Regards
Virendra
Its Good Blog Virendra Soni
Thanks for sharing
Hi Virendra Soni,
I found a blog on the wiki page wrote by u in SCN:
http://scn.sap.com/community/developer-center/front-end/blog/2016/01/28/adding-controls-on-smart-template-using-annotationssap-web-ide
which really helped me on the topic: add a button in the toolbar,
but here comes an issue that have u found that after u add the button, the table column name was disappear when initial the page
and if I try to load the data, it pops up an error msg: “select item“
It’ll would be really nice if u could help check on this issue~
And thanks u very much in advance!
BR,
Magina
Hi Magina
if you want some Column is automatically display Data is automatically come on that column without using Setting Icon
use this annotation code at annotations/localAnnotations_1.xml
it is for Column
and if you want create some Filter Elements display at filterbar without using filter settings
then it for Filter elements
it will solve your problem ............
or follow this Blog Manage Smart Template (List View and Object View ) using Annotations file... you will get everything.
Regards
Virendra Soni
hi Soni,
right, I can set the default columns now,
but the issue was still there that:
when I add the button, all the columns and data can't load by following the ways above.
BR,
Magina
Hi Soni,
I am trying to build an overview page and added some Analyitcal cards on that. Now I am looking for how I can put Navigation so that user can go to a Master Detail App while clicking the card. Could you please enlighten how to do this?
BR
Shibaji
HI Shibaji
You have to use at your Cart Line item
<Record Type="com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation">
<PropertyValue Property="SemanticObject" String="SemanticObject1"/>
<PropertyValue Property="Action" String="Action1"/>
<PropertyValue Property="Label" String="App1"/>
<Annotation Term="com.sap.vocabularies.UI.v1.Importance" EnumMember="com.sap.vocabularies.UI.v1.ImportanceType/Medium"/>
</Record>
then you will be able to navigate another view
Regards
Virendra
can you also suggest how can we replace the text on the button with an icon, like "add" or other sap icons?
Please specify issue with snapshot
so that I can help you on same
regards
virendra
Hi Virendra,
Greeting...!!!
Thanks for the tutorial, it was very helpful....
I have created the same application using annotation but on my header there is action buttons initially there not enabled but the moment is click on some another button those action buttons gets enabled.
Kindly help....
Thanks and regards,
Amit Mahindre
Hi Amit
Is this Buttons are Custom button (Breakout/Extension ) or Action button (data field for action ) ..?????
Hi Virendra Soni,
Thanks for your blog.
Please find attached screen shots for reference. kindly look into this and advice accordingly.
Hi
Sorry for Delay . Did you get your Solution ??
Regards
Virendra
Hi Virendra,
Really helpful.
Just need one thing..
Question : If I want one column to be displayed as a LINK and on click of that I want open another SAP Standard WEBAPP by passing the Selected LINK INFORMATION.
Kindly help me with this.
Thanks in advance...
Hi Jithin cherian if you want more community members to be aware of your question, you should consider asking your question here: https://answers.sap.com/questions/ask.html
Best regards
Mynyna (SAP Community moderator)