cancel
Showing results for 
Search instead for 
Did you mean: 

how to get text of buttons present under button group

Former Member
0 Kudos

Hi

I Have abutton group with contains 3 buttons with text 1,2,3.when ever i clilck that buttons its text need to be displayed.

Can any one tell me how to achieve this.

Thanks

Rahul

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

1. Bind TextView to a valueAttribute of type string.

2. initialise the value attribute with empty string

3. create three actions for the buttons

in each action you can either set the valueAttribute text to the button text or hard code it like this:


wdContext.currentContextElement().setValueAtt("button_text");

Former Member
0 Kudos

You can achieve this by event parameter mapping. Say the buttons "onAction" events are all mapped to the same action "ButtonPressed" (works also for different actions). Add a parameter "buttonText" to the "ButtonPressed" action and map each button's text to this parameter with code like


wdDoModifyView()
{
  if (firstTime)
  {
    IWDButton button = (IWDButton) view.getElement("button_id");
    button.mappingOfOnAction().addParameter("buttonText", button.getText());
  }
}

Armin

Former Member
0 Kudos

hi

create three context attributes and bind them the TEXTVIEW element you create ,

and on each button click set the test to the context in the button onAction() method.

Former Member
0 Kudos

Hi,

create an element in context of string type & bind the text attribute of button(s) with it, pass text to

element by coding . create a textview & filled it at button click event by coding.

Edited by: Amit Solanki on Jun 3, 2009 6:25 PM