on 08-09-2005 3:21 PM
Hi,
I have created two radiobuttons, "AuthorRadioButton" and "PublisherRadioButton". I bound their properties 'keyToSelect' to two different context attributes of type boolean (Author and Publisher) and the property 'selectedKey' to the same context attribute named 'SelectedKey' of type string.
Now I want to access at runtime to the value of this UI-Element. The value of the radiobutton should be available in the context attribute 'SelectedKey' or?
But I always get the string "true" if I access via wdContext.currentContextElement().getSelectedKey(). But I must also know which radiobutton this value belongs.
Has somebody any idea?
Thanks.
Cemal
Hi Cemal,
create 2 context attributes say att1 and att2 of string type
create an attribute sel of string type
Assign some values for att1 and att2 say "a" and "b" .assign "a" for sel if you want first one checked
kettoselect of first button should be bound to att1 and
kettoselect of second button should be bound to att2
selectedkey of both should be bound to sel.
.At runtime whatever value you select will come to sel
hope this helps you
If you query is solved close the post
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
i have similar problem, posted another thread
I followed similar procedure what you mentioned , i have a textedit UI element apart from two radio buttons, now if select first button text related to fist button should appear in text edit similarly for the second one , Actually this text i am reading from bapi on the other hand i will hardcode some text (sometext for button1 and similarly for button2) how to do this.
How can i proceed further...
Regards,
Murali
Hi Murali,
This is also in relation to the question posted by cemal salman.
As i see it you both have the same problem with a little difference.
Here is an example which hopefully should solve your problems :
Consider an application with 2 radiobuttons(R1 and R2) and a TextEdit UI -
1) Create 3 context elements bike,car and vehicle_sel
2) In R1 properties,assign
Keytoselect -> bike
Selectedkey -> vehicle_sel
and have an event Update() where u write this code -
wdContext.currentContextElement().getVehicle_sel();
3) In R2 properties,assign
Keytoselect -> car
Selectedkey -> vehicle_sel
Similarly set the Event to Update()
4) In TextEdit UI, assign
Value -> vehicle_sel
5) In doInit() you can have the following code which will set the text for the radio buttons-
wdContext.currentContextElement().setBike("BIKE");
wdContext.currentContextElement().setCar("CAR");
Hope this helps you.
Kindly give a feedback
HI,
lets assume that there r two radio buttons R1 and R2
create three attributes in context. R1,R2,sel.
for R1
key to select --R1
selected key ---sel
for R2
ket to selcet --R2
selected key ---sel
under implimentation ---initilize as
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.currentContextElement().setR1("Pass");
wdContext.currentContextElement().setR2("Fail");
wdContext.currentContextElement().setSel("Fail");
//@@end
}
so that by default R2 will be enabled and its value is false bce
wdContext.currentContextElement().setR2("Fail");
wdContext.currentContextElement().setSel("Fail");
If we select the R1 radio button during run time then the sel value will set to "True" automatically.
Hope u were satisfied.
Regards,
Krishnam Raju
if u select the R1 button then the
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't need to bind the "keyToSelect" properties.
If buttonA.keyToSelect = "A" and buttonB.keyToSelect = "B", then you can select buttonA by setting the "selectedKey" context value to "A", similar for buttonB.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.