Change Button text ?

Hi All,
I got a button in my custom transaction in ABAP. I want to change the text/Label of the button dynamically based on some conditions. How to achieve the same.
Thanks & Regards,
Navneeth K.

Data:   gs_toolbar           TYPE stb_button,
      handle_toolbar
          FOR EVENT toolbar OF cl_gui_alv_grid
              IMPORTING e_object e_interactive,
METHOD to handle_toolbar
  METHOD handle_toolbar.
append a separator to normal toolbar
    CLEAR gs_toolbar.
MOVE your text TO gs_toolbar-TEXT.
    APPEND gs_toolbar TO e_object->mt_toolbar.
Try this.
Thanks & Regards,
Harsha.

Similar Messages

  • Changing buttons text in Report

    Hi !
    I am using a standard Region report in my application.
    There are some buttons in this Region:
    "Next button" and "Previous button".
    How to change the buttons text ?
    I want to get empty text on this buttons.
    Thanks,
    Roman

    Hi user....
    I am sorry,
    but I want to change a text of link label inside the Region.
    There are two links inside the Region: Next link and Previous link.
    I want to get the links without text label.
    Thanks, Roman.

  • External ITS change button text

    We are just implementing ESS 50.4 using WAS 4.7, Portal 6.0, and external ITS.
    In the Enrollment IAC, transaction PZ14,
    SAP Template Button href=URLPLAN
    button=TXT_INFO
    iconName=b_info
    The button displays the word 'Information' and we need to change that word.  Where does one change the text for a button on external ITS?
    I have tried SE93.
    Thank you,
    D. Maupin
    University of Kentucky

    Hello Donna,
    normally the button texts are set by the application. But did you try to override it by providing the parameter buttonLabel="something" to the function that renders the button?
    With best regards,
      TJ

  • Using the Gradient tool to change button text

    I have had a request to change the text on a number of buttons on the website that I am maintaining. I thought it would be a simple case of cropping the text, editing this using the background colour and then pasting back in. The background colour, however, seems to be graduated so when I paste it back in, it doesn't match. What is the easiest way of using the Gradient tool to achieve this?
    Sorry if this seems a bit on a 'RTFM' request, but time is of the essence.
    Thanks.

    I see, the buttons are all pixels at this point.
    That's still pretty easy...
    1.  Edit the text out of the original button by duplicating the part of the button that doesn't have text over it.  You can just use the rectangular marquee and duplicate some of the gradient to the right or left of the text and move it over the text.  It will take a little care, but it's pretty easy if you work zoomed-in.
    2.  Determine what font they were using through a site like http://www.whatthefont.com.  In this case it looks like a pretty close match to Tahoma Bold.
    3.  Choose the Text tool and type the same text, then use the various adjustments in the CHARACTER panel to get it to match very closely.  Looks like it needs to be horizontally scaled in width to 110% or so.
    4.  Erase that text then type the text you want.
    Hope this helps!
    -Noel

  • RESOLVED:  Can't Change Button Text

    I have a text entry box that requires the user to enter a
    specific phone number. After entering the correct phone number,
    they are to click a Search button to go to the next slide. For the
    text entry box, I have the 'Show Button' option selected. I want to
    edit the text of the button to say Search, instead of Submit, but
    nothing happens when I double-click the button. Nor does anything
    happen when I right-click the button and select Properties.
    According to Captivate help, I should be able to edit the
    button's text, but it won't let me. Any ideas?

    Apparently this is another one of Captivate's 'Undocumented
    Features'. To resolve this issue, I deleted the original text-entry
    box and then inserted a new one. This time, using the same options,
    I was able to edit the button's text. Go figure.

  • Change Button text during component use of WDR_SELECT_OPTIONS

    Hello,
    I have implemented a WD component (WD for ABAP) by making use of component WDR_SELECT_OPTIONS. The selection screen is getting displayed. But the selection screen contains the button Copy, Check, Cancel and Reset.
    I want to rename the button tex "Copy" to "Search". Is it possible to do so?
    Please help!
    Thanks and Besd Regards,
    Maya

    Hi Maya,
    Unfortunately, this is not possible. There is also a translation bug while translating it from German into English. The button should have been translated into "Apply" instead of "Copy". This is issue is being addressed and should be fixed within one of the upcoming service packs.
    Nonetheless, there is a solution to your problem. Just hide the button (or the whole row) by calling method SET_GLOBAL_OPTIONS and add your own buttons below or above where you embed the SelectOptions component. The handler interface contains methods to reset the selection screen as well as for input validation.
    Kind regards,
    Thomas

  • Changing quiz button text

    I am working on a series of tutorials and quizzes for our
    client, I want to change the text on the "Next" button on the
    quizzes. It appears easy enough, in the options, Next button text
    field, I have entered what I want, but it still appears as "Next"
    when I publish it. Am I an idiot?
    Please help.

    This may be a stupid question, but did you save the file
    before you published? I have sometimes had instances of not saving
    and publishing first and my changes are not reflected.
    Also, if the buttons were already on the screen with the text
    "Next" when you decided to change the button text, you'll need to
    delete those buttons and then add them again. The text does not
    update dynamically.
    Worst comes to worst, you can manually change the button text
    with a double-click or through properties...
    Hope that helps.

  • How can i access and change a text from a button in diferents symbols!?

    I have this:   ELEMENTS:  Stage  - symbol_1
                                                         - symbol_2
    So,... i would like to change a text inside symbol_2 from a button on symbol_1, using sym.$("Text").html("NewText");  What's the correct path!?
    Thanks in advance,
    Regards,

    sym.$('symbol_2')
    sym.getComposition().getStage(). getSymbol('symbol_1').$("Text").html("NewText");

  • Simple Button.Text not changing properly

    Hi all,
    The WPF learning curve is steep.
    I have pulled my hair over this simple Button.Text change and I can't get it to work.
    In WinForms this works:
    Public Class Form1
    Private Sub BTN_1_Click(sender As Object, e As EventArgs) Handles BTN_1.Click
    BTN_1.Text = "CLICKED BUTTON 1"
    BTN_2.Text = "CHANGED BY BUTTON 1"
    End Sub
    Private Sub BTN_2_Click(sender As Object, e As EventArgs) Handles BTN_2.Click
    BTN_2.Text = "CLICKED BUTTON 2"
    BTN_1.Text = "CHANGED BY BUTTON 2"
    End Sub
    End Class
    I want to do the same thing in WPF
    <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0" Grid.Row="0">
    <Button Name="BTN_1" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_1_LABEL_1" Text="Button 1 text" VerticalAlignment="Top" Foreground="#BF000000" >
    </TextBlock>
    <TextBlock Name="CLICK_BTN_1_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 1</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    <Grid Grid.Column="1" Grid.Row="0">
    <Button Name="BTN_2" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_2_LABEL_1" Text="Button 2 text" VerticalAlignment="Top" Foreground="#BF000000">
    </TextBlock>
    <TextBlock Name="CLICK_BTN_2_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 2</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </Grid>
    </Window>
    Class MainWindow
    Private Sub CLICK_BTN_1(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles BTN_1.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CLICKED BUTTON 1"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CHANGED BY BUTTON 1"
    End Sub
    Private Sub CLICK_BTN_2(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles BTN_2.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CHANGED BY BUTTON 2"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CLICKED BUTTON 2"
    End Sub
    End Class
    This used to be so simple with WinForms, what am I doing wrong here?
    New to WPF

    Yeah, I saw that as well but now I am stuck again:
    Same project but I have put the buttons in a usercontrol
    <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Component_Changes"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0" Grid.Row="0">
    <Viewbox Stretch="Fill">
    <ContentControl Name="UC_BTN1">
    <ContentControl.Content>
    <local:btn1 Margin="20"/>
    </ContentControl.Content>
    </ContentControl>
    </Viewbox>
    </Grid>
    <Grid Grid.Column="1" Grid.Row="0">
    <Viewbox Stretch="Fill">
    <ContentControl Name="UC_BTN2">
    <ContentControl.Content>
    <local:btn2 Margin="20"/>
    </ContentControl.Content>
    </ContentControl>
    </Viewbox>
    </Grid>
    </Grid>
    </Window>
    btn1.xaml
    <UserControl x:Class="btn1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
    <Button Name="BTN_1" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_1_LABEL_1" Text="Button 1 text" VerticalAlignment="Top" Foreground="#BF000000" >
    </TextBlock>
    <TextBlock Name="CLICK_BTN_1_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 1</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </UserControl>
    btn1.xaml.vb
    Public Class btn1
    Dim CL_BTN2 As btn2
    Private Sub CLICK_BTN_1(sender As Object, e As RoutedEventArgs) Handles BTN_1.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CLICKED BUTTON 1"
    ' CHANGE LABEL 1 ON BUTTON 2
    CL_BTN2.CLICK_BTN_2_LABEL_1.Text = "CHANGED BY BUTTON 1"
    End Sub
    End Class
    btn2.xaml
    <UserControl x:Class="btn2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
    <Button Name="BTN_2" Click="CLICK_BTN_2">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_2_LABEL_1" Text="Button 2 text" VerticalAlignment="Top" Foreground="#BF000000">
    </TextBlock>
    <TextBlock Name="CLICK_BTN_2_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 2</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </UserControl>
    btn2.xaml.vb
    Public Class btn2
    Dim CL_BTN1 As btn1
    Private Sub CLICK_BTN_2(sender As Object, e As RoutedEventArgs) Handles BTN_2.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CL_BTN1.CLICK_BTN_1_LABEL_1.Text = "CHANGED BY BUTTON 2"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CLICKED BUTTON 2"
    End Sub
    End Class
    No warnings in the code but the error is: 'Object reference not set to an instance of an object' and I thought I did, obviously not in the right way.
    New to WPF

  • Change the text of a button in a form on the fly

    Hi all,
    I have a form that it is called from another form or from a report. I would like to change the text of the Update and Save buttons on the fly depending on who called it. For instance, if this form is called from the form I would like the Update button to say: "Save & Next", however if it is called from the report the button should say: "Save & Back to Report".
    How could I accomplish this if it is possible.
    Thanks

    I've got the problem fixed. For any of you that would like to know the solution is this. I added the following javascript at the end of an unstructured UI template where I have the form:
    <script language="JavaScript1.1">
    var inURL = false;
    for (i = 0; i < document.all.length; i++) {
         if (document.all.name != null) {
         if (document.all[i].name.indexOf("BACK_URL") > 0) {
                   if (document.all[i].value != '') {
                        inURL = true;
              else {
                   if (inURL) {
                        if (document.all[i].name != null) {
                             if (document.all[i].name.indexOf(".UPDATE") > 0 || document.all[i].name.indexOf(".SAVE") > 0) {
                                  var doc = document.all[i];
                                  doc.value = "Save & Back to Report";
    </script>
    The script works in IE 6+, I don't know if it works in any other browser, I haven't test it and I don't think I will.
    I hope this could help somebody

  • How to change the text of a button dynamically in module pool

    hi gurus,
    how to change the text of button dynamically

    Hi ,
    Declare a variable in TOP Include with your button name.
    Example : P_BUTTON(20) TYPE C.
    Place button with name P_BUTTON on you screen. Do not forget to mark it as "Output Field". [ Double click on button, Attributes --> Program tab --> tick "Output Field".
    In you PBO / PAI , whereever you want to change your text -
    Assign value to P_BUTTON.
    Example -
    iF COND1..
    P_BUTTON = 'EDIT'.
    ELSEIF COND2.
    P_BUTTON = 'DISPLAY'.
    ENDIF.
    Regards,
    Mohaiyuddin

  • How to change the text of a button in ALV dynamically?

    Hi Gurus,
    I have a ALV with a button in the toolbar.Basically i have to change the button text each time the button is pressed.
    How can i do this?
    PS:points will be awarded

    On your alv model, first call if_salv_wd_function_settings~get_function( ID = <your ID> ). This will return you a reference of cl_salv_wd_function. If your function uses a button editor, do the following:
    data:
    lr_button type ref to CL_SALV_WD_FE_BUTTON,
    lr_function type ref to cl_salv_wd_function.
    lr_function = l_alv_model->if_salv_wd_function_settings~get_function( ID = <your ID> ).
    lr_button ?= lr_function->get_editor( ).
    lr_button->set_text( ).
    I have not tried this, but it should work.
    Regards
    Nithya

  • Trying to change the text of the command button.

    Hi.,
    Am using jdeveloper 11.1.1.6.,
    I have dragged and dropped a command button in my jsff page.
    When there is no record in my VO which dragged and dropped as a af:form the button will act as a create insert so that the text of the button should also be create Insert. If there is record the button should act as a update so that the text should also be update. I have used the follwoing code to change the text accordingly.
        public void settext(ActionEvent actionEvent) {
            // Add event code here...
            BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            System.out.println (e);
            if ((e == 0)) {
                myButton.setText("CreateInsert");    // Null pointer exception occurs
            } else {
                myButton.setText("Update");  //null pointer exception occurs
        }Can any one pls help me?

    Hi Timo!
    This was the thing which i have did.
    I have dragged and dropped a command button to my jsff page.
    When i press the button a popup will show which ask the confirmation from the user.
    This is the code which i have written in my managed bean.
        public String delete_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            Commit();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public void deleteItem(DialogEvent dialogEvent)
            if (dialogEvent.getOutcome() != DialogEvent.Outcome.yes)
                delete_action();
              return;
          }I have used the EL Expression in my another button which will change it property according to the values in my row.
    #{bindings.EssEeoDemInfView1Iterator.estimatedRowCount gt 0 ? 'Update':'Create Insert'}For this button i have used the following code in my managed bean.
        public String update() {
             BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            if ((e == 0)) {
                  CreateInsert();
            } else {
                   Commit();
            return null;
        }When i initially delete the record the button has not been changed to createinsert it remains as update. When i press the update am getting NULL pointer exception in CreateInsert() and Commit();

  • How to change the text of the standard ALV button?

    Hallo everybody,
    WebDynpro ALV has its own buttons e.g. Export,   Is it possible to change the text "Export" as own text 'SaveInExcel' ?
    Many thanks,
    Meer

    Answer  to this question:
    Wenn der Typ des Oberflächenelements in der Toolbar oder seine Beschriftung vom Standard abweichen sollen, lassen Sie zwar die ALV-Standardfunktion zu, blenden jedoch das zugehörige Oberflächenelement aus. Stattdessen erzeugen Sie eine selbstdefinierte Funktion und weisen ihr die gewünschte ALV-Standardfunktion zu.
    Folgende Oberflächenelemente für ALV-Standardfunktionen können Sie auf diese Weise ersetzen:
    ●      Dropdown-Listbox Senden sowie die einzelnen Einträge der Dropdown-Listbox
    ●      Dropdown-Listbox Anzeigen als sowie die einzelnen Einträge der Dropdown-Listbox
    ●      Drucktasten Zeile einfügen, Zeile anhängen und  Zeile löschen
    ●      Drucktaste Prüfen
    ●      Drucktaste Rückgängig
    ●      Drucktasten Excel und Druckversion
    ●      Drucktaste Filter sowie die Einzelfunktionen Filter definieren und Filter löschen
    ●      Drucktaste Einstellungen  sowie die Einzelfunktionen Dialogfenster Einstellungen öffnen und Dialogfenster Einstellungen schließen
    ●      Dropdown-Listbox Sichten
    Um einer selbstdefinierten Funktion eine ALV-Standardfunktion zuzuweisen, verwenden Sie Methoden der Klasse CL_SALV_WD_FUNCTION.
    sap help

  • How to change the text in the Cancel button of JFileChooser ?

    Hello,
    In french the standart text in the Cancel button of the JFileChooser class is "Annuler". For a good reason which will be too long to explain, I need to change it by another term.
    I tried to create a super class and redefine the CANCEL_SELECTION string, but this does not work. I can't either change it directly because it has the final attribute.
    Where does JFileChooser get this word from ? ( I guess it is not hard coded for multilanguage support purpose).
    Any help would be appreciated
    Gege

    I believe the standard Look and feel implementations look in UIManager for a string called FileChooser.cancelButtonText.
    Therefore you might be able to change it after you've loaded your LnF by using the following code:
    UIManager.put("FileChooser.cancelButtonText", "---change me---");Note that this would change all file choosers in your application.
    If you only want to update one type of file chooser you could extend, for example, MetalFileChooserUI and set its cancel button text by overriding installStrings. You'd then need to install this UI on the file chooser you want to change.
    There may be an easier way to do this!
    Hope this helps.

Maybe you are looking for