Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • vagkavan
    replied
    Use a dialog

    You could use a dialog instead, where you could customize the buttons' titles:

    Code:
    Dialog dialog = new Dialog();
      dialog.setTitle("Customized Title");
      dialog.setMessage("Customized Message");
      dialog.setIcon("[SKIN]ask.png");
    
      Button buttonOK = new Button("customized OK");
      buttonOK.addClickHandler(new ClickHandler() {
        @Override
          public void onClick(ClickEvent event) {
    	// on ok button click action
          }
      });
    
      Button buttonCancel = new Button("customized Cancel");
      buttonCancel.addClickHandler(new ClickHandler() {
        @Override
          public void onClick(ClickEvent event) {
    	// on cancel button click action
          }
      });
    
      dialog.setButtons(buttonOK, buttonCancel);
    
      dialog.draw();
    You could wrap it in a function to pass titles and handlers per case.

    Leave a comment:


  • svjard
    replied
    You could do something like
    Dialog.addClassProperties({OK_BUTTON_TITLE:...,YES_BUTTON_TITLE:..}); this will overwrite the defaults with your localized selection. It will do so for ALL calls from then on though, not just for the specific ask() or confirm() your doing at that time, but sounds like that is what you want?

    Leave a comment:


  • JJMM
    replied
    As API supports to pass string for message as well as for title, I am able to localized those. But I am not able to localized the buttons "OK", "yes", "No".

    Here is my code

    SC.ask(ResourceUtil.getResource(ResourceUtil.ADMIN_CONSOLE_GWT_RESOURCES, "question"),ResourceUtil.getResource(ResourceUtil.ADMIN_CONSOLE_GWT_RESOURCES, "askDiscardChanges"),
    new BooleanCallback() {
    public void execute(Boolean value) {
    if (value) {
    selectServerStatus();
    }
    }
    });

    Thank you for your help.

    Leave a comment:


  • svjard
    replied
    Too complicated to list? So do you only want to localize the values of those buttons only?

    Leave a comment:


  • JJMM
    started a topic How to internationalize buttons of SC Dialog?

    How to internationalize buttons of SC Dialog?

    I'm working on a SmartGWT application and using SC Dialog to pop up messages to users, where they can click on 'OK' and 'Cancel' buttons. Now, we want to customize the value of these buttons ('OK', 'Cancel' etc.) so we can pass localized values. For reasons that are too complicated to list here, we cannot use SmartGWT's own localized values. Thanks in advance.
Working...
X