on 05-09-2008 10:21 AM
Hi
i have dropdown which cointains 1 to 10 numbers,as soon as we select 2 in dropdown 2 input fields should be displayed.can u please help me in solving this problem
thanks
kishore
Please give more information on the use case. As you can see from the given answers, the simplicity of the solution depends on the needed degree of flexibility.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
1:Add one child TransparentContainer to RootContainer with id TransparentContainer1
2:Take one attribute of type integer in context
3:When dropdown selected set the selected value to this attribute like
wdContext.currentcontextElement().set<value>(wdContext.current<DDNode>Element().get<DDValue>);
4:And in do modify view Method, put following code
IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("TransparentContainer1");
if(tc!=null)
tc.destroyAllChildren();
int number=wdContext.currentContextElement().getNumber();
IWDNodeInfo info=wdContext.getNodeInfo();
if(!(wdContext.isEmpty()))
{
wdContext.getContext().reset(false);
}
for(int i=0;i<number;i++)
{
IWDInputField inp=(IWDInputField)view.createElement(IWDInputField.class,"inp"+i);
info.addAttribute("val"+i,"com.sap.dictionary.double");
inp.bindValue("val"+i);
tc.addChild(inp);
}
Regards
LakshmiNarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
The Input Fields have to be created dynamically based on the selection of the drop down .
for eg :
If the use selects the Dropdown , the onselect Action is fired .
In the Action ,
get the selected value from the context Attribute .
check using the If Conditional statement.
finally create the inputField in the action.
Note : InputFields cannot be created dynamically in the Action method.
For this we can add the parameter of type View , while creating the action.
or create the InputFields in the WdDomodify method and finally bind the visible property of the inputfield to the Attibute of type Visibility(NONE).
Finally in the action method set the visisbility of the inputField to Visibility.visible.
note : based on the user selection, we have make the inputField to visible.
Thanks abd regards
fazal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
In onselect action get the selected value and pass that number to the method which creates input fields dynamically
For dynamic proggramming refer following link
/docs/DOC-8061#34 [original link is broken]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If they are available as part of the design time based on the selection set the visibility property,
else
based on the selection create ui elements in the wdDomodify method.
place a container and add items to this
dont forget to clear the container.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.