on 05-07-2008 3:11 PM
Hi,
i have an RFC which return the following Table:
Parameters
- checked --> DataType Boolean
- name --> DataType Char255
So, after calling the RFC, this table is filled, e.g.:
checked name
-
false ABAPCache
false JAVACache
true DB_DataSize
false ABAPBufferSize
true DB_LogSize
Now, reagarding to this table, i want to create checkboxes which can be set/unset by user! :
[ ] ABAPCache
[ ] JAVACache
[X] DB_DataSize
[ ] ABAPBufferSize
[X] DB_LogSize
Now, how to do that?
I have to "loop" over my table, within this loop i have to create my Checkbox. The visible Label of the Checkbox should be the "name":
Within this loop i have to create the checkboxes:
public static void wdDoModifyView(....)
{
if (firstTime) {
IWDTransparentContainer tCont = (IWDTransparentContainer) view.
getRootElement();
tCont.createLayout(IWDGridLayout.class);
for(int i =wdContext.nodeParameters().size()-1; i>=0;i--)
{
IWDCheckBox theCheckBox = (IWDCheckBox) view.createElement (IWDCheckBox.class, wdContext.nodeParameters().getParametersElementAt(i).getName());
theCheckBox.bindChecked( ??? )
}
Am I on the right way?
Use a CheckBoxGroup, bind property "texts" to attribute "name. This will create as many checkboxes as there are elements in the context node. It will not set the values of attribute "checked" however because the checking a box will only set the node's multi-selection state. Thus you have to update (for example before you write data into model) the "checked" attribute values using a loop like
for (int i = 0; i < wdContext.nodeParameters().size(); ++i)
{
IParametersElement parameter = wdContext.nodeParameters().getParametersElementAt(i);
parameter.setChecked(wdContext.nodeParameters().isMultiSelected(i));
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx for your help Armin, the creation of checkboxes works, but i do have another problem.
The checkboxes are created in pop up window. By closing (with window.destroyInstance();) and open again, the wdDoModify is called again with firsttime=true!
So, every time closing and opening the window, the initial values are shown and not the changed values from user.
Hi,
Change de code into loop for this:
IWDCheckBox theCheckBox = (IWDCheckBox) view.createElement (IWDCheckBox.class, wdContext.nodeParameters().getParametersElementAt(i).getName());
IWDAttributeInfo attInfo = wdContext.getNodeInfo().addAttribute(wdContext.nodeParameters().getParametersElementAt(i).getName, "ddic:com.sap.dictionary.boolean");
theCheckBox.bindChecked(attInfo);
Regards,
Edson Thomaz
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 | |
6 | |
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.