on 05-15-2009 7:06 AM
Hi all,
I am developing one application in which i require three radio buttons for that i used radiobutton group.
Now my requirement is to give three input fields to the corresponding radiobuttons.
for example
radiobutton1(name) inputfield1
radiobutton2(hno) inputfield2
radiobutton3(eid) inputfield3
I think u got my requirement.
please any one can provide me the solution.
Thanks in advance
Regards
Ravi
Hi,
can u plz teel me what is use of radio button in your application?like what is action on radio button?
Thanks
Abhilasha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
My requirement is as follows
name ravi
house 1-62
i want like this when i click on first radiobutton i should able to enter my name.
if i click on second radiobutton i should able to enter my house num.
on the whole i should to enter either name or house num at a time.
I think u got my requirement
Cheers
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
For this design create one transperent container.
Insert two transaparent container in that.
put radiobuttongroup in one and three input fields in the other.
select grid layout for both of them with col count = 1.
Select grid layout for outer container with col count =2.
In this way desired layout is deisgned.
Please let me know if you still have any problem.
Sarbjeet Singh,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Then you can control the readonly property of the input fields.
Just bind the read only property of the input fields to three attributes of boolean type and then control
their property by changing the value of attributes on the select event of the radiobutton group.
hope it is clear and you can imlement it.
If you require i can write the code for you also.
Regards,
Sarbjeet Singh.
Hi Ravi,
Please find the code for that logic of controlling the readonly property of input fields.
//...
public void onActionselectindex(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionselectindex(ServerEvent)
String selected_option = wdContext.currentContextElement().getA(); //where A is the attribute in the
//context used as the selected key for radiobuttongroup
if(selected_option != null)
{
if(selected_option.equalsIgnoreCase("name"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(true); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("rollno"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false);
wdContext.currentContextElement().setReadoonlypro_input_2(true);
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("class"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(true);
}
}
//@@end
}
Regards,
Sarbjeet Singh GIll
public void onActionselectindex(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionselectindex(ServerEvent)
String selected_option = wdContext.currentContextElement().getA(); //where A is the attribute in the
//context used as the selected key for radiobuttongroup
if(selected_option != null)
{
if(selected_option.equalsIgnoreCase("name"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(true); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("rollno"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false);
wdContext.currentContextElement().setReadoonlypro_input_2(true);
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("class"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(true);
}
}
//@@end
}
Hi,
I have one more doubt how to clear the values in the inputfields.
suppose i selected radiobutton1(name) and i entered the name.Then i selected second radiobutton
then name input field is disabled but the data present in name inputfield is appearing i want to disappear that name.
i can use reset button.
but i want to clear that data whenever i click another radiobutton.
i think u got my question.
Regards
Ravi
Hello Ravi,
Please modify the code as below
//...
public void onActionselectindex(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionselectindex(ServerEvent)
//reset the input fields on each select event
wdcontext.currentContextElement().setInput_1("");
wdcontext.currentContextElement().setInput_2("");
wdcontext.currentContextElement().setInput_3("");
String selected_option = wdContext.currentContextElement().getA(); //where A is the attribute in the
//context used as the selected key for radiobuttongroup
if(selected_option != null)
{
if(selected_option.equalsIgnoreCase("name"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(true); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("rollno"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false);
wdContext.currentContextElement().setReadoonlypro_input_2(true);
wdContext.currentContextElement().setReadoonlypro_input_3(false);
}
else if(selected_option.equalsIgnoreCase("class"))
{
wdContext.currentContextElement().setReadoonlypro_input_1(false); //context attributes bound to the readonly property
wdContext.currentContextElement().setReadoonlypro_input_2(false); //of all the input fields.
wdContext.currentContextElement().setReadoonlypro_input_3(true);
}
}
//@@end
}
Regards
Sarbjeet Singh
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.