on 2005 Aug 12 7:10 AM
i have to views and both have a same component context
i have few redio buttons in first view under a
UIElement <b>Group</b>.
i want to set the common context as per the name of the selected radio button. i have tried the following not worked !!
<b>wdContext.currentContextElement().setModuleName
(wdComponentAPI.getComponentInfo().findInViews("AdminView").</b>
after this i m not getting ..
Hi
The selected value of the radio button has to be displayed in another view, is this your requirement?
Suppose you have two radio buttons in your first view. Create two context attributes(say r1 and r2) of type String and bind them to keyToSelect property of the buttons. Create another attribute of type String and bind it to selected Key property of both buttons. Create a similar attribute in the component controller and the next view and map them. For this, refer the following tutorial.
Set the values of the attributes r1 and r2.
Get the value of the selected radio button in the second view.
Thanks and regards
Leena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satya,
Have you done the mapping of attributes you want to share across two views through data modeler(available in menu on right click of component controller). Please do it and then the attributes will be available in both views.
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi satya,
what are you trying to do and what do you mean by same component context.
<b>If you want to pass the value of selected radiobutton from one view to another view,you can define the context in component controller and do the appropriate mapping. </b>
And while using radiobutton group
set the keytoselect property of the radio button in the doinit. Bind it to different attribute. And bind the selectedkey to a common attribute. So which ever radiobutton is selected its value will come in selectedkey Attribute.
you can get this as
wdcontext.currentcontextelement().get<selectedkeyattribute>()
hope this helps.
regards,
rahul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As i suggested you can use "Selectedkey" attribute to do this.
wdContext.currentContextElement().setText(wdContext.currentContextElement().getSelectedKey());
before this you should create contextAttrib "SelectedKey" and assign this to selectedkey attribute of radiobutton.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satya,
Somehow your question is not very clear !!!
You can make use of "SelectedKey" attribute of radiobutton.This specifies the path to the context attribute that stores the currently selected key.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
How are using the radio buttons. What do u want to set in the common context..
If u want to get the selected radio button value,
use wdCONtext.currentContextElement().get<selected key attr>()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.