Friday, 30 November 2018

Switch onslide event based data change in segment example

define({

  onNavigate : function(){
    kony.print("onNavigate");
    var segList = [{
      imgOS: "msdosimag.png",
      template: "flxSegTemplate",
      lblOSName: "MS-DOS",
      switchData : {onSlide:this.onSlideCallback}
    }, {
      imgOS: "linuximag.png",
      template: "flxSegTemplate",
      lblOSName: "Linux",
      switchData : {onSlide:this.onSlideCallback}
    },{
      imgOS: "callicon.png",
      template: "flxSegTemplate",
      lblOSName: "Call Icon",
      switchData : {onSlide:this.onSlideCallback}
    }];

    this.view.segExciseExample.widgetDataMap = { imgOS: "imgOS",
                                                lblOSName: "lblOSName",
                                                switchData :"switchData" };
    this.view.segExciseExample.setData(segList);

  },

  onSlideCallback : function(eventObject){
    try{
   
      var segSelectedIndex = this.view.segExciseExample.selectedIndex[1];
      var selectedIndexVal = eventObject.selectedIndex;
      alert("Selected Index "+selectedIndexVal);
      if(selectedIndexVal === 0){
        alert("ON =====================================>");
        var updateVal ={
          imgOS: "callicon.png",
          template: "flxSegTemplate",
          lblOSName: "Call Icon22344",
          switchData : {onSlide:this.onSlideCallback,selectedIndex:0}
        };
        this.view.segExciseExample.setDataAt(updateVal, segSelectedIndex);
      }else{

        alert("OF =====================================>");
         var updateVal ={
          imgOS: "callicon.png",
          template: "flxSegTemplate",
          lblOSName: "Call IconOFFF",
          switchData : {onSlide:this.onSlideCallback,selectedIndex:1}
        };
        this.view.segExciseExample.setDataAt(updateVal, segSelectedIndex);
      }
    }catch(err){
      alert("Error : "+err);
    }
  }

Wednesday, 28 November 2018

Segment Excise example for Kony MVC architecture?

define({

  onNavigate : function(){

    var segList = [{

      imgOSKey: "msdosimag.png",

      template: "flxSegTemplate",

      lblOSNameKey: "MS-DOS"

    }, {

      imgOSKey: "linuximag.png",

      template: "flxSegTemplate",

      lblOSNameKey: "Linux"

    }];

    this.view.segExciseExample.widgetDataMap = {imgOS:"imgOSKey",lblOSName:"lblOSNameKey"};

    this.view.segExciseExample.setData(segList);

  }
});

Monday, 12 November 2018

Adding Link and underline in Rich text kony segment Dynamic example




function dynamicSegmentData(){
  try{
    var listData = ["Android","Java","Dotnet","FrameWrok","Next"];
    var arrayList = [];
    for(var i=0;i      var templa = {"rechTextVal":{text:""+listData[i]+""}};
      arrayList.push(templa);
    }
    frmRichText.segmentRichText.setData(arrayList);
  }catch(err){
    alert("Error"+err);
  }
}




Thursday, 8 November 2018

Kony Dynamic TextBox widget?


Dynamic TextBox widget adding into the flex container

var countID = 0;
function addDynamicTextBoxEvent(){

  try{
    var txtBasic = {id:"textBox"+countID,placeholder:"enter text",maxTextLength:100,left:"10dp",top:"10dp",skin:"skintxtBoxroundGray120",focusskin:"skinTextBoxFocusGray120",isVisible:true};
    var txtLayout = {padding:[5,0,0,0], margin:[5,5,5,5], containerWeight:100, hExpand:true, widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT};
    var txtPSP ={placeholderSkin:"skintxtPlaceholderGray120"};
    var textBox1 = new kony.ui.TextBox2(txtBasic,txtLayout,txtPSP);
    frmDynamicTxtBox.flexHari.add(textBox1);
    countID++;
    alert(countID);
  }catch(err){
    alert("Exception while occuring..."+err);
  }
}
























                                                                                                                                               Reference 

Monday, 5 November 2018

Kony Log Location

Logging Appender
Kony Fabric supports below-mentioned logging appenders:
1. File Logging: This is used to log the information in a file (.log format) stored in the user’s system. This is supported in both Windows and Linux environments.
Log Location
  • For Tomcat and JBoss single node, logs are created in < Kony Fabric Install Dir>/logs folder.
  • For JBoss cluster/multinode and WebLogic, logs are created in /konymflogs folder.
  • For WebSphere, logsare created in /AppServer/logs/konymflogs folder.
We create separate log file for each service as mentioned below:


2. Sys logging: This is used to log the information in system log using UDP protocol. This is supported only for the Linux environment. This is the best way to store all the information in a single place.
3. Database logging: This is used to store the log in the database of each service. This is mainly useful in a clustered/multinode environment when services are running in more than one box and logs need to store at a centralized location. Kony Fabric supports MySQL, MS SQL Server, Oracle and DB2 database server for database logging in both Windows and Linux environment.



Kony middleware Logging


For logging, use log4j statements instead of System.out.println() statements


Logging Detailed Location : KonyFabricInstaller folder\logs\admin.log




Wrap the debug statements with the log.isDebugEnabled() method. For example.

Java Syntax :

if (logger.isDebugEnabled())
{
...logger.debug("printing debug info")
}



Java Example :

import java.util.HashMap;

import org.apache.log4j.Logger;

import com.konylabs.middleware.cloud.LoggerBean;
import com.konylabs.middleware.common.DataPreProcessor;
import com.konylabs.middleware.controller.DataControllerRequest;
import com.konylabs.middleware.dataobject.Result;

public class ExampledebugLogging implements DataPreProcessor {

public static final Logger LOG = Logger.getLogger(ExampledebugLogging.class);

@Override
public boolean execute(HashMap arg0, DataControllerRequest arg1, Result arg2) throws Exception {

LOG.debug("======Testing Pre processor debug printing=====start====");

if(LOG.isDebugEnabled()) {

LOG.debug("================Log Priting==============");
LOG.debug("======Testing Pre processor debug printing=====");
}
LOG.debug("======Testing Pre processor debug printing======end=======");

return true;
}
}




JavaScript Example :


function fun1() {
    logger.debug('Tesing put method of HashMap');
    serviceInputParams.put('place', 'London');
    return true;
}
fun1();






A failure occurred while executing com.android.build.gradle.tasks

Error in Kony visualizer V9 service pack 6 and FX11  [2023-01-09 22:23:32.695] [DEBUG] ~~~~ - INFO [exec-shell] Execution failed for task ...