on 08-07-2007 9:28 AM
Hi Web Dynpro masrers,
I have a quick question. I have a table with a checkbox. The problem is that when I check/uncheck not only the selected row is checked/unchecked but all the rows from the table. How can I fix this?
I also want when I open the view with this table some rows to be checked and some unchecked (whether some condition, like element's key or something else) and when I check/uncheck to save the changes.
Thanks in advance,
Kostadin
I just made it. The problem was so stupid, I've changed one of the attribute name with the other After I fixed this it works fine.
Thanks all for the quick response! You really helped me a lot and save me lots of hours!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, putting the attribute in the table source node was pretty good move Now I can check/uncheck eache checkboxes without changing all of them. Now I'm trying to set some rows to be checked depending on their key, but have no success by the moment, don't know why. I tried sever ways but haven't made it by now. I guess it should not be so hard to be done, so if someone has any idea for this can share otherwise I'll set the question status to "answered".
Thanks all for help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I'll try what Armin suggested. Hope it will work. I'll let you know the result of the try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I've made a new column for the checkbox. The contex for the checkbox is:
ColCheckBox
-
checkbox
checkbox is boolean, not calculated (I tried also calculated, the result was worse then not calculated)
The node ColCheckBox is with selection cardinality 0..n and singleton = true (although I'm not sure what exactly this is for)
I haven't made any implementation for onActionToggleCheckBox cause I want first to make it show some rows checked and the rest unchecked wheter some condition. The problem is that all the rows are always checked/unchecked together. Which I guess is not a big surprise cause I still haven't made the loop and setting some checked/unchecked rows. How exactly should I make this, cause I tried several times with no success?
Thanks,
Kostadin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Set cardinality=1:1, selection=1:1, singleton=false for node ColCheckBox and put it <b>under</b> the data source node of the table.
To access the check box value at table row 5, use code like
I<TableDataSource>Element row = wdContext.node<TableDataSource>().get<TableDataSource>ElementAt(5);
boolean value = row.currentColCheckBox().getCheckBox();
Armin
Hi
In your Context Node, take another attribute ReadOnly of boolean type
Now bind your check box readonly property to this attribute.
Now go to onSelect Event of the table.
loop at the Context Node Elements
and set readOnly attribute to true only if it is not the selected row
Hope it is clear.
Regards
Abhimanyu L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to say that I've read several other threads about checkbox in table before I ask for help, including this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, Use a context structure like this
Table (Value node, bound to <i>dataSource</i> property of table UI)
--Other attribute
--Other attribute
--Other attribute
--Checked (Value attribute, type <i>boolean</i>, bound to <i>checked</i> property of checkbox)
For conditional checking of the checkboxes, based on the condition use a code like:
wdContext.nodeTable().currentTableElement().setChecked(true);
In the meantime can you share your context structure?
Regards,
Satyajit.
Hi,
i think you want to create a Table column as check Boxes.
what you can do is create a value node for this checkBox column inside the context Root node from where you are binding your Table column value and then create a value attribute inside this value node and bind this value attribute from the checkBox column.
Thanks,
Mithileshwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.