Topic
1 reply Latest Post - ‏2014-04-17T13:02:48Z by Charlie Shean
SystemAdmin
SystemAdmin
7615 Posts
ACCEPTED ANSWER

Pinned topic Tables, subviews and visibility

‏2013-01-12T01:04:56Z |
Hi everyone,

Once again, the tables bring me here.
Before all, let me introduce a little bit of context.

In BPM 8.0, in a coach view, is possible to set an element visibility in the view function like this:

Scenario: a control, p.e a textbox, in a coach view and it's ask to hide it


var controlId = 
"CONTROLID"; var views = this.context.getSubview(controlId, 

true);   
//considering that only exists one var view = views[0]   
//now, I can do it by two ways this.context.setDisplay(false, view); 
//visibility is hidden(1) 
//or var visibility = 
"NONE"; view.context.options._metadata.visibility.set(
"value",  visibility);
//visibility is hidden (2)


The first option could be find here: http://pic.dhe.ibm.com/infocenter/dmndhelp/v8r0m1/index.jsp?topic=%2Fcom.ibm.wbpm.wle.editor.doc%2Fdevelop%2Ftopics%2Frcontext.html
And the second's one here: http://bpmwiki.blueworkslive.com/display/samples/CV+-+Change+visibility+of+CVs+programmatically

Now, my problem...

Scenario: I have a table that in one column stands a control, in this case a button. The button's visibility depends of another row value, and I can get this value.

Problem 1: Using the previous cenario, it's not possible just set the controlId variable to the row's controlId
Solution: I had to get the table view first and then the subviews inside her.

So my code turn like this:

var tableControlId = 
"TABLEID"; var tableView = this.context.getSubview(tableControlId, 

true)[0]; 
//considering that only one table with this id exists   var rowsControlId = 
"ROWID"; var rowViews = tableView.context.getSubview(
"rowsControlId", 

true);   var visibility = 
"NONE";   
//so if we want to hide everything 

for(var i = 0; i < rowViews.length; i++) 
{ 
//it would make sense using of this options this.context.setDisplay(false, rowViews[i]); 
//or tableView.context.setDisplay(false, rowViews[i]); 
//or rowView[i].context.options._metadata.visibility.set(
"value",  visibility) 
}


Problem 2: Unfortunately, none of this options can hide the button, so what am I doing wrong and what can I do to solve this problem?

Best regards and I'm waitng for your answers.

VF
  • Charlie Shean
    Charlie Shean
    67 Posts
    ACCEPTED ANSWER

    Re: Tables, subviews and visibility

    ‏2014-04-17T13:02:48Z  in response to SystemAdmin

    I have similar scenerio:

    I want to customize the visibility of the first column in a table. What I want to achieve is: The table data should be READ ONLY however the Radio Button (Since the table is a Single select) should be EDITABLE.

     

    Any inputs welcomed.