cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable and disable columns fields within a table

Former Member
0 Kudos

Hello all,

I have the following situation,

I need to build a table who has an check box. If i check it, i must to enable and disable (depends of the case) some columns fields of my table´s line. I´ve search some forums thread and i know that this code must be develop on wdmodify view method. But i wonder if you guys have some sample codes or maybe a Weblog link that could help me to solve this problem.

Thank you in advance,

Mariana

Rewards the GURU who save my life jejeje...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

First, it is not true that you have to code this in method wdDoModifyView(). Don't believe everything you read in this forum

Please describe your use-case more clearly. Do you want to have a table column with a checkbox which controls the enabling-state of some other editors in the same table row?

If yes, just

- add a boolean context attribute "editorsEnabled" under the data source node

- bind the "enabled" property of each cell editor that should be controlled to this attribute

- bind the "checked" property of the CheckBox to this attribute

- assign an empty action to the "onToggle" event of the CheckBox. This will trigger a roundtrip when the checkbox is toggled and update the editor's enabled state directly

Armin

Former Member
0 Kudos

Hi Armin,

>

> First, it is not true that you have to code this in method wdDoModifyView(). Don't believe everything you read in this forum

> Armin

Are you sure that you are commenting about this thread? No one suggested to write in wdDoModifyView()! Please go through the thread again. Thanks!

Regards,

~kranthi

Former Member
0 Kudos

yes Armin, that's exactly my used-case...but now i'm ask you..what about if my node attribute..that is bound to my cell is a model node?...how can i add a node attribute to that?, i know the answer...i cant.. but how can manage the attribute value then...may be can i manage with another attribute of the main context? ... and kat...i read something to write the client event in the wdmodify view method...so in a certain way i suggest myself to do that....plis help me gurus...i know that you both have the answer to my problems ;-)...and may be is more easy than we thought...

kisses,

MC

Former Member
0 Kudos

Mariana wrote: "I´ve search some forums thread and i know that this code must be develop on wdmodify view method."

That's what I refered to.

Armin

Former Member
0 Kudos

If you can't add the attribute directly to the node, add a cardinality 1:1, selection 1:1 subnode to the node and add the attribute into the subnode.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Create new Context Attribute of type "boolean" in the node(i.e, dataSource bound to that table). Bind the new context attribute to "enabled" property of TableCell Editor. write an event handler for checkbox which would disable / enable the table cell.

if you are not clear, please post your context structure so that we can provide the exact code.

Cheers,

~kranthi

Former Member
0 Kudos

for every cell do i have to do that? ..i mean...i have my cells bound to model attributes (for example)...so said that i have to have a boolean context attribute for every cell that i have in my table and link it to the property enable of my cell?? that's it???

Best Regards,

Marianita

Former Member
0 Kudos

As the context attribute belong to the same node(dataSource), if it is bound that Table CellEditor, all cells in that column will have the similar behavior. If it is a model node, you would not be able to create new attribute. Either copy data from Model node to Value Node or do it some other way. What is your exact use case?

Former Member
0 Kudos

well i have a table in which the columns are bound to several model attribute (not only one i.e.: DataSource1 to cell1, DataSource2 to cell2 and so on)..each cell have a different behavior, i mean one list one type of data as a dropdown list (example a project name), one shows a search screen, etc. The only thing i want to do is if i check the checkbox only (and only) enable example: cell2 and cell3 and disable cell4 and cell5 (cell1 is the checkbox), but if i don't check it, the cell2 and cell3 remain disable. that must happen only on the layout level (client side event). Obviously, all my cells are linked (or bound) to different model node as i said before, so i know that i cant create an attribute within the model node. But i'm wondering if i could do what you tell me to do, creating several attribute of the main context (each for every cell) and set those to the property and manipulate the value of each cell if the action of the checkbox is activated. I´m developing the view so i haven't implemented yet. i'm at a design face.

Regards

MC