Changing Application Toolbar item icons dynamically via ABAP - abap

I am searching for a way to edit items of the Application Toolbar of an SAP Dynpro dynamically via ABAP at runtime. More precisely, I would like to change the icon of such an item.
Can anybody help me out with this?

Define a global field in your program TEXT_1 TYPE SMP_DYNTXT. Define your function code text type in your GUI status as dynamic and enter your previously defined field.
At runtime assign your icon and text:
TEXT_1-ICON_ID = '#DL#'.
TEXT_1-ICON_TEXT = 'MY_TEXT'.
This is documented here.

Related

Is there a way to get a dropdown of Fonts?

b is an instance of the button class. Following are two ways to set the Font of the button b. But in both cases, I have typed out the word ‘Calibri’. Is there a way to pull ‘Calibri’ through some property or method so that we don’t have to type it? Ideally I would like to get a dropdown list from where I can choose a font (something similar to choosing colours). Is that possible?
b.Font = New Font("Calibri", 20)
OR
Dim fontF As New FontFamily("Calibri")
b.Font = New Font(fontF, 20)
Also, if the above is not possible, is there a way to find out the complete list of fonts available to be used in the WinForms I am trying to create? PLease note that I am looking for something as following: b.FlatAppearance.BorderColor = Color.Red. Here 'Red' comes as a dropdown after I type Color.Red. Is a similar thing possible while setting fonts for a button?
I understand you would like intellisense to provide a list of font names when typing. Unfortunately this isn't available directly. You can however, open the designer for the form, select a button and open the font editor:
Then select the font you would like, copy the name, cancel the dialog, and paste the name into your code; or set the font directly through the designer properties with this dialog. Whichever fits your scenario.

Kentico 10 | Toolbar for Rich Text Editor in a Custom Component

I can create a custom toolbar for the EditableText Web Part in Kentico 10, as there is plenty of documentation on how to create/set custom toolbars .. but I can ONLY find documentation for the EditableTextWebPart.
I need to create unique toolbars to be used within several custom Web parts for certain properties / fields. I can't find any documentation on setting them within my own custom Web part, and am hoping someone could point me in the correct direction.
Sounds like you're mixing a few things up. Each webpart has properties. Each property has an associated control. The control you use is based on the datatype of the field.
If you have a long text datatype on your webparts property you should be able to pick the rich text editor as your control. Then create a custom widget for the WYSIWYG editor.
Now if you don't want to work with the WYSIWYG editor then, create your own custom form control.
Check out this article on customizing the WYSIWYG editor. At the end of the article it has a reference to custom widgets for your WYSIWYG editor.
So the answer was under my nose, albeit a bit hidden.
In the /CMS/CMSAdminControls/CKeditor/config.js I added my own custom toolbar, which I had already created, but hand't figured out how to hand it off to the Web part property.
config.toolbar_Caption =
[
['Undo', 'Redo', '-'],
['Cut', 'Copy', 'Paste', 'PasteText', 'Scayt', '-'],
['Bold', '-'],
['InsertLink', 'Unlink', '-'],
['Maximize']
];
The web part has a property, named Caption, with the Data type set to Long text and the Form Comtrol set to Rich Text Editor.
Under Editing control settings, expand Advanced to access Toolbar set and set it to the custom toolbar. In my example, that would be Caption.
Also set the Toolbar location to In so that the toolbar is within the text area vs. floating on top of the entire form.

set the text of an Action Control to a document property

Is there a way to set the text of an Action Control to the value of a document property?
i.e. I have a property FooProp. I want to set the label text of a button to ${FooProp} so that when FooProp gets updated (via script), the button text changes.
Thanks.
I do not think you can set the Display Text of a button to a document property.
You could really easily create an HTML button that does similar functionality but could still have a dynamic title. Simply create a button and set the name of the button to a Spotfire Label equal to that Document Property. Then perhaps use a python script or other script to do work e.g. change page, load data, etc. Depends on your use case.

How do i manipulate the data templates inside listbox in uwp

I am making a chat application using XAML in UWP.The side panel is consisting of users. like this.
Everything is in Listbox in which I have this template that consists one ellipse as a circle which is like an indicator,one user image,textblocks and one toggle switch.I have to give states to the toggle switch in on the state it should change the green color of circle and make it red.
I want to give this functionality in code c# in MainPage.cs. I made the object of toggle in toggled Event Handler but I am not able to access the other elements inside the data template like ellispse,textblock.
What is the other alternative way of doing this?
NOTE: It has to be in listbox because I want to use the same template for every user.
The best way to do this would be to use data binding.
You would define a ViewModel class for the item, which would contain a bool property and would react to the toggling of the switch in the setter or have a Command which you would execute when the state event changes using behaviors.
If you really want the code as a event handler on main page, you have some options. To get the item associated with the toggle, you can use its DataContext property and cast it to the data type you are using. Alternatively, you can use Visual Tree Extesnions provided by the UWP Community Toolkit. This enables you to find the parent (probably Grid) where you store all the item controls and then manually find the user image, TextBlock, etc.

JasperReports dynamic input controls

I'm currently trying to create a JasperReport report with some special input control behaviour. My needs are:
four input controls, two of them are dateboxes, the other ones are radio buttons
depending on radio button choice, one of the databoxes should be visible or not
so if option 1 is chosen, show both dateboxes; if option 2 is chosen, show only one datebox
I wonder if there's a "clean" solution - didn't find anything.
Any pointers will be helpful.
The Print when expression is not relevant for input controls on JasperReports Server.
There is no built-in support for hiding and showing an input control based on the value of a different one. The infrastructure for cascading input controls can certainly be extended to achieve this... but it would not be trivial.
The path I would take is to customize the .jsp page that displays the input control. There is a section in the JasperReports Server Ultimate Guide called "Customizing the Input Controls Form" which would get you started down this path.
For datebox part, you can use print when expression to decide whether certain blocks of the report is visible.
For other "input", if you meant some data you want to display inside the report, you can make some Parameter in your report, then set the Parameter from user input before you export the report.