2

I am new to Kony framework. Now i am going through Widget. There i came across Segment widgets using I would create a flex container with some labels and textbox.

My UI design are : 1. I Created a segment and set a flex container with some labels and text box in that segment 2. After that I turn off the flex container visible 3. And I type a code like :

function flex() { frmAssign.sgmt1.flex1.isVisible = true;//to show flex as visible but it does not read the property of that flex }

In simple terms just If I click segment first row flex container isVisible should be true
enter image description here

want to achieve this design in kony

Harikrishnan
  • 71
  • 1
  • 7

4 Answers4

0

Try change frmAssign.sgmt1.flex1.isVisible = true;

frmAssign.sgmt1.flex1.setVisibility(true);
Guilherme Gregores
  • 1,050
  • 2
  • 10
  • 27
0

You cannot access the widget of segment directly.

You have to create a property (eg:isVisible) in Master Data of the segment.

initial Value of this property would be "false",

Then change the value as you per your need.

0

To change properties in segment data you have change the properties in array which you have set to data of segment. Basically idea is

  • if you are using masterdata then you need to read the data change property values and reassign.

  • if you are dynamically setting data then you need to change that array and reassign

// always check for Null for selecteindex //Note keep your existing properties and just change isVisible to true

var selecteindex= frmAssign.sgmt1.selectedRowIndex;
var segData = frmAssign.sgmt1.data[selecteindex];
segData[selecteindex] =("YourFlexName": {
            "text": "CButton1",
             "isVisible":true
        });

form1.segment1.setDataAt(segData,selecteindex);
0

The right way to do this is :

var selectedIndex= frmAssign.sgmt1.selectedRowIndex;
var rowData = frmAssign.sgmt1.data[selectedIndex];
rowData["flex1"]["isVisible"] = true;
form1.segment1.setDataAt(rowData, selectedIndex);
Samir
  • 46
  • 5