on 07-27-2005 2:47 PM
Hi,
In my program I have some dropdowns and a checkbox group. The checkbox group's labels are created dynamically by what is chosen in one of the dropdowns. All of the dropdowns and the checkbox group are all mapped to the Component Controllers Context. The problem I am having is that I am binding the text to the checkbox group right after the dropdown is chosen (in its own function and NOT in wdDoInit or wdDoModifyView), and its clearing the dropdown's selection (and any other dropdowns in the form).
Is there a better way to dynamically assign the values to the checkbox group so that it doesn't clear those values?
Thanks,
Jonathan
Hi,
Can u restate your problem
Especially these few lines ?
<b>The problem I am having is that I am binding the text to the checkbox group right after the dropdown is chosen (in its own function and NOT in wdDoInit or wdDoModifyView), and its clearing the dropdown's selection (and any other dropdowns in the form).</b>
Regards
Bhaarthwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the dropdown onSelect, it executes makeCoursesVisible.
makeCoursesVisible, first makes the checkbox group visible, then assigns values to the checkboxes depending on what value was selected, it then binds the coursename to the node.
As soon as it does this, it clears out the values from the dropdowns. If I comment the bind line out, it doesn't clear them out, but it also doesn't assign the values to the checkboxes.
If you want to see the code, let me know.
-Jonathan
public void onActionmakeCoursesVisible(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionmakeCoursesVisible(ServerEvent)
wdContext.currentContextElement().setCoursesVisible(WDVisibility.VISIBLE);
wdContext.currentContextElement().setTextVisible(WDVisibility.NONE);
String department = wdContext.currentDropDownElement().getDepartment();
String[] courseNames = null;
List coursesNames = new ArrayList();
if (department.equals("English"))
{
courseNames =
new String[] { "ENG 010", "ENG 020", "ENG 030", "ENG 100", "ENG 101", "ENG 200", "ENG 400" };
}
else if (department.equals("Music"))
{
courseNames =
new String[] { "MUS 010", "MUS 020", "MUS 030", "MUS 100", "MUS 101", "MUS 200", "MUS 400" };
}
else if (department.equals("Computer Science"))
{
courseNames =
new String[] { "CIS 010", "CIS 020", "CIS 030", "CIS 100", "CIS 101", "CIS 200", "CIS 400" };
}
else
{
wdContext.currentContextElement().setTextVisible(WDVisibility.VISIBLE);
wdContext.currentContextElement().setCoursesVisible(WDVisibility.NONE);
courseNames = new String[] { "" };
}
for (int i = 0; i < courseNames.length; ++i)
{
IPrivateChooseCoursesToRoll.ICourseNameElement aCourse = wdContext.createCourseNameElement();
aCourse.setCourse(courseNames<i>);
coursesNames.add(aCourse);
}
wdContext.nodeCourseName().bind(coursesNames);
//@@end
}
Did you bind the CheckBoxGroup.texts property at design time to attribute CourseName.Course?
The code looks ok to me. But how did you bind the drop-down lists? Changing the content of the CourseName node should have no influence on the drop-down lists.
You can also omit the ArrayList if you replace the line
coursesNames.add(aCourse);
by
wdContext.nodeCourseName().addElement(aCourse);
and delete the last line
wdContext.nodeCourseName().bind(coursesNames);
Armin
Hi Jonathan,
Assign a defaultvalue to a new attribute created . change its value on select of dropdownbykey
and check its value in modify and do the rest
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.