hi dear wd experts,
i have created a 2 coloumns table, which retrieves data from a model object. It's context is nodeUTable
nodeUrows
attribute1.
the second table column contains a checkbox.
For the checkbox I set up a node, which carries a bool variable and which is assigned to the checkbox "checked" poperty.
I set the cardinality of the checkbox node 1:n (when using 0:n the checkboxes are disabled...)
During wdDoModify I create checkbox contexts like this:
wdContext.nodeStandard().invalidate(); int rsize = wdContext.nodeUrows().size(); for (int i = rsize - 1; i >= 0; i--) { IPrivateDealer.IStandardElement standard = wdContext.createStandardElement(); wdContext.nodeStandard().addElement(standard); }
so I get as many bool vars as required. I am not sure about the "invalidate()" method.
I thought, when using it like above, I could also use a 0:n cardinality for my checkbox contents. But even "validate()" won't enable the checkboxes on the webpage... hence I use 1:n.
Now I set up an onToggle Event for the checkbox, which looks like this:
if(wdContext.currentStandardElement().getBolStandard()==false){ wdContext.currentStandardElement().setBolStandard(true); }else{ wdContext.currentStandardElement().setBolStandard(false); }
Unfortunatly this only works for all checkboxes, and furthermore, once checked, I can't reset the checkboxes.
I also tried to use the getLeadSelection() of my nodeUrows. But this returns always 1.
<b>Big Question goes here:
How can I address only one checkbox???</b>
thanx a lot for your patience and help...
Matthias