on 07-11-2007 7:50 PM
Hi
I followed link and I was able to set visbility to cell editor of table. There are no errors but I found that
if any condition is false(in all rows of table) whole visibility is gone it any condition is true whole table is displayed.
ie If condition is false I can see celleditors else every thing is blank.it is supposed to check condition for each cell editor. Please see below code and suggest me if i am wrong
for (int i = 0; i < wdContext.<NODE>.size(); i++) {
IPrivate<VIEWNAME>.I<NODEElement> row1=wdContext.node<NODE>().get<NODEElementAt>(i);
v.setVisible(<CONDITION> ? WDVisibility.NONE :WDVisibility.VISIBLE);
}
My node structure is Node-->Visible(node)
I have changed the code but still that problem persists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried with 2 options 1) setting visibility in doModify view
2) Setting in getVisibility method.
I guess doModify code is invalid so i am not posting it. Please see below code
1) I made visibility folder as singleton false
2) I assigned visibility node attribute(which has visibility property) to my custom colomn visibility property.
Z_Bw_Portal_Info_Input
Output(ModelNode)
Zsummary (Modelnode)
VisibilityTest(node with signleton true and 1:1 cardinality and selection)
ImageVisibility (Attribute with visibility property)
public void wdDoInit()
{
//@@begin wdDoInit()
wdThis.wdGetCalController().CalRFC();
//@@end
}
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getVisibilityTestImageVisibility(IPrivateCalview.IVisibilityTestElement element)
{
//@@begin getVisibilityTestImageVisibility(IPrivateCalview.IVisibilityTestElement)
IPrivateCalview.IZsummaryElement Element = (IPrivateCalview.IZsummaryElement) element.node().getParentElement();
int i = Element.index();
if (i==10)
return WDVisibility.NONE;
else
return WDVisibility.VISIBLE;
//return null;
//@@end
}
Hi
The requirement is like this.
i wanted to setvisibility NONE or VISIBLE to a particular cell in the row based on the condition
if(getVisiblet is true)
{
ROW 1 : cel1 cel2 cel3(hide Cell3's Value)
}else
{
ROW 2: cel1 cel2 cel3(visibile Cell3's Value)
}
please help me so that i will be resolve my issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please clearly tell your question. I havent get it.
Roshan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this code:
For this code:
Node
-
Visible (Value Attribute) of type com.sap.ide.............visibility
(Set this attribute as the value of visibility property for the cell editor)
for (int i = 0; i < wdContext.<NODE>.size(); i++) {
wdContext.node<NODE>.moveTo(i);
if (condition)
wdContext.node<NODE>.currentNodeElement().setVisible(WDVisibility.VISIBLE);
else
wdContext.node<NODE>.currentNodeElement().setVisible(WDVisibility.NONE);
}
I don't understand your question. Can you please explain more clearly what you want to achieve?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for my unclear question. I want to set table cell editor visibility. I coded(as mentioned above) and executed . I am able to see that all celleditors are either hided or all are displayed. But based on conditions some cell editors have to be hided and some of them have to be displayed.
Please suggest me how to do it
One possibility: Use a calculated attribute. The generated getter has a parameter named "element" that denotes the node element for which the attribute value is calculated.
Example: The following method hides the editor in all rows with even index:
WDVisibility getRowsEditorVisibility(IRowsElement element)
{
return element.index() % 2 == 0 ? WDVisibility.NONE : WDVisibility.VISIBLE;
}
Armin
Hi,
You have to create a calculated attribute and do the application specific code in that
For ex:
public com.sap.tc.webdynpro.progmodel.api.WDVisibility getHierarchyRootVisibility(IPrivateMainView.IHierarchyRootElement element)
{
//@@begin getHierarchyRootVisibility
if(element.getIsLeaf() ) // put your application specific code here
return WDVisibility.VISIBLE;
return WDVisibility.NONE;
//@@end
}
and bind this to the visibility of the respective fields
Regards
Ayyapparaj
Hi,
create the "visible" value attribute of type "com.sap.ide.webdynpro.uielementdefinitions.Visibility"
<b>under the table node</b>.
But then what i have observed is that the row whose visiblity is set to NONE will still show in the table, but without any data.
If the row data is not necessary you can remove the element from the node.
IPrivate(your view).ITableNodeElement ele =wdContext.nodeTableNode.getTableNodeElementAt(i);
wdContext.nodeTableNode.removeElement(ele);
Message was edited by:
Shriram Kabra
Hi Armin
I want to set visibility of some cell editors based on other column values. For example my table structure is
Col1 | Col2
------------------------------------|-------
Col1 row1 | Col2 row1
Col1 row2 | Col2 row2
Col1 is from model node and Col2 is custom column in table (which I created in view layout using "create grouped Column" option . If Col1 row1 ==0 then Col2row1 should not be visible and if Col1 row1!=0 then Col2 row1 should be visible.
Similarly for all rows in table. Please suggest me how can I do it
Hi Armin
I followed same steps and I used element.index() % 2 == 0 condition for testing purpose. Result is, if IF condition is true all elements in all rows are visible (Col row1 and Col2 row1) and if IF condition is false all are rows are invisible.
My context struecture is
Rows (model node)
-- Name (attribute, string)
-- Additional (value node, card=1:1, selection=1:1, singleton=false)
---- EditorVisibility (attribute, type=Visibility)
Is there any thing to do with context structure or cordinatlity?
Probably your code does not set the "EditorVisibility" attribute correctly. The singleton=false means that there exists a node "Additional" for each <b>element </b>in node "Rows".
To set its value, you have to write code like
IRowsElement row = ...;
row.nodeAdditional().currentAdditionalElement().setEditorVisibility(value);
Armin
Thanks you very much for your responce in this thread. I am giving my code below. Please look at it.
What ever the condition I am writting its applicable only for first row. I am able hide first row cell editor based on condition but not other rows.
1)I have set node as singleton and cordinality, selection as 1:1.
2) I assigned that visibility attribute to my coloum cell editor property.
3) in doModify method I have written below code.
for (int i = 0; i < wdContext.nodeRows().size(); i++) {
IPrivate<View>.IAdditionalElement v =
wdContext.nodeAdditional().currentAdditionalElement();
IPrivate<View>.IRowsElement row =wdContext.nodeRows().getRowsElementAt(i);
v.setEditorVisibility (
(row.id() ==0 )? WDVisibility.NONE: WDVisibility.VISIBLE);
}
4) I tried same code in getVisibility method as metioned but i am getting same result.
for (int i = 0; i < wdContext.nodeRows().size(); i++)
{
IPrivate<View>.IAdditionalElement v =
wdContext.nodeAdditional().currentAdditionalElement();
IPrivate<View>.IRowsElement row =wdContext.nodeRows().getRowsElementAt(i);
v.setEditorVisibility (
(row.id() ==0 )? WDVisibility.NONE: WDVisibility.VISIBLE);
}
Replace by:
for (int i = 0; i < wdContext.nodeRows().size(); i++)
{
IPrivate<View>.IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
IPrivate<View>.IAdditionalElement v = row.nodeAdditional().currentAdditionalElement();
v.setEditorVisibility (
(row.id() ==0 )? WDVisibility.NONE: WDVisibility.VISIBLE);
}
Armin
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.