on 10-17-2007 8:50 AM
hi
THis is madhu
can any one give sol for:
How to disable a row for a table
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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®ards
madhu.
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
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
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
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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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®ards
madhu
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.