cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable multiple rows

Former Member
0 Kudos

hi

THis is madhu

can any one give sol for:

How to disable a row for a table

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Madhusudhan,

In you value node(which is bound to the table) insert 1 more value attribute, say 'RowEnabled' of type boolean.

Bind this to the table celleditor of table's each column.

and if you want to disable the i-th row ,give

wdContext.node<yourValueNode>().get<yourvalueNodeElement>At(i).setRowenabled(false);

Let me know whether this is helpful for you

Thanks

Smitha

Former Member
0 Kudos

Hi,

If you have to give for multiple rows,

for(int i=0;i<node(Your<valueNode>.size();i++)

{

//check condition, and give if true

wdContext.node<yourValueNode>().get<yourvalueNodeElement>At(i).setRowenabled(false);

//else

wdContext.node<yourValueNode>().get<yourvalueNodeElement>At(i).setRowenabled(true);

}

thanks

smitha

Former Member
0 Kudos

hi smitha,

i did the same as u suggested but of no use

it is not disabling

any other suggestion ie the settings,plz help on this

thanks&regards

madhu

Former Member
0 Kudos

Hi

In you value node(which is bound to the table) insert 1 more value attribute, say 'RowEnabled' of type boolean make it as calculated = true.

Bind this to the table celleditor of table's each column.

In the getter method you will have a parameter element

ex: if (element.getDept().equals("SALES"))

return true;

else

return false;

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Madhusudhan,

The smae code is working for me. You please check, whether you have set

the 'enabled' or 'readonly' property of celleditors of all yoru table columns are bound to the table value node's boolean attribute(I specified a variable 'RowEnabled').

Or please tell where you have given the coding to disable the row.

thanks

Smitha

Former Member
0 Kudos

hi smitha

i have have get the table after clicking a button so i kept the code in the action event of the button

here is the code

wdThis.wdGetFilteringCompController().execBapi() ;

wdContext.currentContextElement().setVisiatt2(WDVisibility.VISIBLE );

int size = 0;

size = wdContext.nodeProducts_All().size();

for(int i=0;i<size;i++)

{

String ss=wdContext.nodeProducts_All().getProducts_AllElementAt(i).getDealer_Id() .trim() ;

if(ss.equals("D123"))

{

wdComponentAPI.getMessageManager().reportSuccess("Hai");

wdContext.nodeProducts_All().getProducts_AllElementAt( i).setEnable(false );

}

}

thanks&regards

madhu.

Former Member
0 Kudos

Hi

Please let me know the following details.

When you execute this coding what output are you getting?

How many rows are displayed in you table, after execution?

Are they all enabled/disabled?

Is the message 'Hai' you have given, displayed in ouput??

Is your context attribute 'enable' bound to your table column's cell editors?

regards

Smitha

Former Member
0 Kudos

hi smitha

totallu 8 rows r displayed

all r enabled.

the msg is displaying for thre times,since there are three members with deptid

'D123'.

iam <b>sure</b> ,that i bounded <b>enable</b> to my tables cell editors.

thanks&reply

madhu

Former Member
0 Kudos

Hi,

Create an attribute under the node Products_All called ProductEnabled of type boolean and check the calculated.

You will see a getter like the one below

public boolean getProductEnabled(IPrivateTView.IContextElement element)

{

//@@begin getProductEnabled

//WRITE YOUR LOGIC HERE

Example based on your above code.

String ss= element.getDealer_Id() .trim() ;

if(ss.equals("D123"))

{

wdComponentAPI.getMessageManager().reportSuccess("Hai");

return false

}

return true;

//@@end

}

bind this attribute to the enabled properties of the table cell editors.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Is Your 'enable' variable bound to enable property of celleditor?

Then for sure, it should work.

Otherwise , you try by binding 'enable' value attribute to 'readonly' prperty of the cell editor?

let me know the result

reagrds

smitha

Former Member
0 Kudos

Hi

I checked even with this process, but not giving me the result

wat to do?

any other way,plz suggest

thamks&reply

madhu.

Former Member
0 Kudos

hi,

no readonly property for the table cell editor

how can i bind,

thanks&reply

madhu.

Former Member
0 Kudos

Hi,

Have you mapped the context attribute to the table celleditor?

Was the message displayed?

Regards.

Ayyapparaj

Former Member
0 Kudos

Hi,

Which table cell editor are you using?

It is there if your table cell editor is input field. please check.

I think the problem is there in binding your celleditor's 'enabled' property to boolean value attribute.

If it is bound,and if we haven't set it to enabled incoding,[wdContext.node<nodename>.get<nodeelemnt>At(i).setRowEnabled(true);], it will be disabled,

Please check the binding again.

regards

smitha

Former Member
0 Kudos

hi

The table cell editor is <b>TextView</b>

thanks&reply

madhu

Former Member
0 Kudos

Hi,

Textview is a noneditable field. so there is no difference even if you make it disabled/enabled or readonly=false/true.

If all your table column editors are textview , then I feel there is no relevance in making a row disabled/enabled.. Both will give same result

Thanks

Smitha

Former Member
0 Kudos

hi

But the requirment is like that,any other sol

plz revert back

thanks&reply

madhu.

Former Member
0 Kudos

Hi,

Please explain your scenario, and specify the Relevance of disabling the row,.

What all fields are there in table, and what type of cell editors?

Regards

Smitha

Former Member
0 Kudos

Hi

as i said earlier,all the table cell editors are textviews

so, ineed to disable a particular row satisfying a condition

Condition:

I had a table that displays the following details part num,part name ,status(SC/RE)

etc..

if the field regarding to status is SC(scrap),on displaying the table itself this row must be disabled.,so that the users cant select them for printing.

This is the actual requirement

plz do help

thanks&reply

madhu.

Former Member
0 Kudos

Hi Madhu,

I got your problem now only,

You bind your <b>'enable'</b> boolean attribute to your <b>table's 'row selectable'</b> property. and try the same coding what I had specified earlier.

I tried this and is working correctly. we can't select the row for which 'row selectable' is false.

Try it and let me know the result.

If again problem is there , do give you email ID. I will send you a sample project.

Thanks

Smitha

Former Member
0 Kudos

Hi Smitha

THank you verymuch Smitha

At last u pointed out the problem,in peak moments

and now i resolved the problem

thank you once again

my mailid is madhu.solleti@in.sealconsult.com

thanks&reply

madhu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Can you explain your requirement ?

As far as i understood you need to set the following property

1)For TableUIELement set SelectionMode property to single

or make the TableUIElement's readonly property to TRUE

Regards

Chaitanya.A

Former Member
0 Kudos

hi

my actual requirement is :

iwant to get rfc data and display in the table,while displaying in the table i have to diasble some rows depending on the condition

for ex if there is a column named 'dept'.the persons who are working in 'sales" dept ,that rows must be disabled.

how to do this ,give a clear cut clarification on how to disable asingle row

next how for multiple rows

thanks&regards

madhu