on 02-21-2008 10:24 AM
Hi,
How to work with check box kindly let me know.
i created a value attribute of type booaln and i binded to the UI element checkbox of property type checkd.
i coded like this
wdcontext.currentcontextelement.setcheck(true);
i m getting ant error "Null PointerException"
how to work with chek box
Hi,
What is your node structure.Do you have a value node and under it value attribute or directly value attribute under root context.
If you have value attribute under valuie node then change the cardinality of the node to 1:n.
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
create a checkbox ui element.Then u create a value attribute (check) of type boolean.
Then u bind the checked property of checkbox to the above attribute.
Then if u want to check that one use the following code
wdContext.currentContextElement().setVAName(true);
In the above case va name is :Check
Hazrath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
> guide me how to read value. like when i check checkbox, i should get success message when i uncheck it, sohuld get warning message.
1. In wdDoModifyView() write this:
if(firstTime){
IWDCheckBox chk = (IWDCheckBox) view.getElement("<ID of the CheckBox in the view>");
if(chk != null){
chk.mappingOfOnToggle().addSourceMapping("checked", "isChecked");
}
}
2. Create an action for the onToggle event of the checkbox. Let's say "Toggle" and the corresponding event handler "onActionToggle".
3. Add one parameter of type "boolean" and name it "isChecked". After this step the eventhandler signature would look like:
public void onActionToggle(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, boolean isChecked){}
4. Write the following in the eventhandler method:
if(isChecked)
wdComponentAPI.getMessageManager().reportSuccess("Success!!");
else
wdComponentAPI.getMessageManager().reportWarning("Warning.");
Regards,
Satyajit.
Hi,
create a context attribute of type boolean lets say checkedState
Place a check box UI element
From the properties bind its "checked" property to the context attribute in our case checkedState
If you want to access the current state of the check box
wdContext.currentContextElement().getCheckedState();
//To set the state to selected
wdContext.currentContextElement().setCheckedState(true);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Where you are getting this error. Could you please post the log.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.