on 07-09-2007 5:22 PM
Hi
I created a table and added a colomn to the table in view layout. Cell editor of that colomn contains an image. Based on some conditions , I need to make image invisible in table cell editor of custom colomn.
How can I do it.
As usual: Add attribute "Visibility" (DDIC type com.sap.ide.webdynpro.uielementdefinitions.Visibility) under data source node, bind property "visible" of cell editor to this attribute.
To show/hide cell editor in row at index i, use code like (assuming "Rows" is the data source node):
/* hide editor at row i */
wdContext.nodeRows().getRowsElementAt(i).setVisibility(WDVisibility.NONE);
/* show editor at row i */
wdContext.nodeRows().getRowsElementAt(i).setVisibility(WDVisibility.VISIBLE);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Armin
I am trying create Visibility under data source node . As I binded data directly from controller its not allowing me to create new attribute in my datasource node.
My context structure is ZRFC_Input>Output>ZData. Data is in ZData node and I am trying to create it in Visibility Atrribute in this node only.
Can you tell me what might me the solution
Thanks for response . I followed steps which were mentioned by you. But my question is how to set visibility to userdefined column cell editors(not binded from model). I created column with LinktoURL UI element. My understanding is your set a condition for visibility of whole row. Please correct me if I am wrong.
Also please show me how code will be after creating a visibility node in Context.I tried but I am getting syntax errors.
Example:
Context:
Rows (model node)
-- Name (attribute, string)
-- Additional (value node, card=1:1, selection=1:1, singleton=false)
---- EditorVisibility (attribute, type=Visibility)
Data binding:
LinkToAction.visible -> Rows.Additional.EditorVisibility
Make editor in row at index 4 visible if name is not empty:
IRowsElement row = wdContext.nodeRows().getRowsElementAt(4);
row.currentAdditionalElement().setEditorVisibility(row.getName() != null && row.getName().length() > 0
? WDVisibility.VISIBLE
: WDVisibility.NONE);
Ok?
Armin
I have set selection cardinality to 1:1 and initilizeLeadSelection=true and my cod eis
IPrivate<view>.IRFCElement row =wdContext.currentRFCElement();
for (int i = 0; i < wdContext.nodeRFC().size(); i++) {
row = wdContext.nodeRFC().getZinfoElementAt(i);
row.currentVisibilityTestElement().setImageVisible(<CONDITION>? WDVisibility.VISIBLE:WDVisibility.NONE);
}
Visibility is my value node in RFC model node and ImageVisibility is my visibility attribute.
My error is
com.sap.tc.webdynpro.progmodel.context.ContextException: Node(<View>.<RFC_Input>.Output.RFC): no child node 'VisibilityTest' at index -1
Please suggest me if i need to any changes.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.