Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    customSelectExpression or customSQLExpression but no customUpdateExpression

    Am connection to a DS which uses datetime type, I used customeSelectExpression to separate the date with time.

    <DataSource ID="EPGDS" serverType="sql" dataSourceVersion="1" dbName="EPG" schema="data"
    tableName="DATA" audit="false">
    <fields>
    <field name="SCHEDULE_ITEM_ID" primaryKey="true" required="true" />
    <field name="PROGRAMME_NAME" type="text" length="100" required="true" editRequiresRole="EPG Coordinator"/>
    <field name="EPG_TITLE" type="text" length="40"/>
    <field name="US_EPISODE_NO" type="float"/>
    <field name="EPISODE_NO" type="float"/>
    <field name="PARENTAL_CODE" type="text" required="true" length="40" editRequiresRole="EPG Coordinator"/> <!--lookup EPG_PARENTAL_CODE -->
    <field name="SERIES_NAME" type="text" length="50"/>
    <field name="SERIES_YEAR" type="text" length="4" required="false" />
    <field name="SCHEDULE_DATE_TIME" type="datetime" editRequiresRole="EPG Coordinator" />
    <field name="DURATION" type="text" customSelectExpression ="to_char(to_date(DURATION,'sssss'),'hh24:mi:ss')"/>
    <field name="CHANNEL_NAME" type="text" length="30"/>
    <field name="EPG_GENRE" type="text" length="100" editRequiresRole="EPG Coordinator"/>
    <field name="EPG_SUB_GENRE" type="text" length="100" editRequiresRole="EPG Coordinator"/>
    <field name="SYNOPSIS" type="text" length="1000" editRequiresRole="EPG Coordinator"/>
    <field name="LONG_DESCRIPTION" type="text" length="4000" editRequiresRole="EPG Coordinator"/>
    <field name="LAST_MODIFIED_DATE" type="DATE"/>
    <field name="START_TIME" type="time" customSelectExpression = "TO_DATE(TO_CHAR(SCHEDULE_DATE_TIME,'hh24:mi:ss'),'hh24:mi:ss')" editRequiresRole="EPG Coordinator"/>
    <field name="END_TIME" type="time" customSelectExpression = "TO_DATE(to_char(SCHEDULE_DATE_TIME + DURATION/24/60/60,'hh24:mi:ss'),'hh24:mi:ss')" editRequiresRole="EPG Coordinator"/>
    <field name="SERIES_NO" type="text" length="40" editRequiresRole="EPG Coordinator"/>
    </fields>
    <operationBindings>
    <operationBinding operationType="fetch" operationID="fetchEPG">
    <orderClause> SCHEDULE_DATE_TIME ASC</orderClause>

    </whereClause> -->
    </operationBinding>
    </operationBindings>

    </DataSource>

    I also have a form which updates the DS, here is the js. I want to capture a new starttime on the form but it ignores it cause I used customSelectExpression and when I try use customUpdateExpression it does not display the
    information on the client and it still does not take the input. please assist with this query.

    isc.DynamicForm.create({
    ID:"epgUpdateFrm", autoDraw:false,
    dataSource:"EPGDS", //numCols:4,//height:200,
    fields:[
    {name:"CHANNEL_NAME",title:"Channel", width:"200",editorType: "staticText",canEdit:false},
    {name:"PROGRAMME_NAME" ,type:"text",width:"200",emptyCellValue: "<font size='2' color='red'><strong>Click to edit</strong> </font>"},
    //{name:"SCHEDULE_ITEM_ID" ,title:"Programme #",editorType:"staticText",width:"200", canEdit:false,canFilter:false,
    // align:"left"},
    {name:"PARENTAL_CODE" ,title:"Parental Code",required:true,type: "select", width:"200",align:"left",
    optionDataSource:"ParentalCodesDS",pickListWidth:200, displayField:"PARENTAL_RATING",
    valueField:"DVBCODE"},
    //{name:"SERIES_YEAR", width:"200",align:"left",editorType:"staticText", required:false,canEdit:false},
    {name:"SERIES_NO" ,title:"Series #",type:"number", width:"200",emptyCellValue: "Unknown"},
    {name:"EPISODE_NO", editorType:"staticText",width:"200",align:"left",canEdit:false},
    {name:"EPG_GENRE" ,type:"select", width:"200",title:"EPG Genre",required:true,
    optionDataSource:"GenreDS",displayField:"DESCRIPTION", valueField:"GENRE_CODE"},
    {name:"EPG_SUB_GENRE" ,type:"select", width:"200",title:"EPG Sub Genre",required:true,
    optionDataSource:"SubGenreDS",valueField:"DESCRIPTION", displayField:"DESCRIPTION"},
    {name:"SCHEDULE_DATE_TIME",title:"Schedule Date",editorType:"staticText",canFilter:false, format: "dd-MM-yyyy", width:"160", align:"left",visible:false, canEdit:false},
    {name:"START_TIME",title:"Start Time",type:"time", width:"80",align:"left",canSave:true,canEdit:true,canFilter:false},
    {name:"END_TIME",title:"End Time",type:"time", width:"80",align:"left",canEdit:true,canFilter:false},
    {name:"DURATION", type:"text", width:"100",canSave:true,canEdit:true,align:"left",canFilter:false},
    {name:"SYNOPSIS" ,type:"textItem" ,width:"300",canEdit:true},
    {name:"LONG_DESCRIPTION" ,type:"text", width:"300",canEdit:true}
    ],
    wrapItemTitles:false
    });
    isc.Button.create({ ID:"v_saveEpg", autoDraw:false,title:"Save",
    icon:Page.getAppImgDir()+ "/generalicons/save.png",
    click:function(){
    isc.RPCManager.startQueue();
    epgUpdateFrm.saveData();
    isc.RPCManager.sendQueue();
    }
    });
    isc.Button.create({ ID:"v_refreshEpg", autoDraw:false,title:"Refresh",
    icon:Page.getAppImgDir()+ "/generalicons/refresh.png",
    click:function(){
    fetchEPGdata();
    }
    })

    isc.HStack.create({ID:"v_epgUpdateButtonsStack",autoDraw:false,width:"100%",//height:30,
    membersMargin:6,margin:6,
    members:[v_saveEpg,v_refreshEpg],showEdges:false, edgeSize:2, showShadow:false
    });

    isc.VLayout.create({
    ID:"epgUpdateVLayout",membersMargin:6,margin:6,
    autoDraw:false,
    members:[epgUpdateFrm,v_epgUpdateButtonsStack]
    })




    #2
    Hello ntsakobilas,

    try using
    Code:
    <field name="START_TIME" customUpdateExpression="$values.START_TIME" ... />
    <field name="END_TIME" customUpdateExpression="$values.END_TIME" ... />
    Best regards
    Blama

    Comment


      #3
      I don't have START_TIME and END_TIME on its field from the database, I only have SCHEDULE_DATE_TIME which is datetime format hence I use customeSelectExpression. Is their a way of separating the date and time on display(on the client) and also allow for edit (update)

      Comment


        #4
        Hi,

        sorry, I missed that one. You can definitely solve this - either in Velocity, or, as it might be a bit complicated, in DMI.
        Create a hidden .ds.xml-field SCHEDULE_DATE_TIME. In Velocity you would take a customUpdateExpression of something involving $values.START_TIME and/or $values.END_TIME, values.DURATION. Same for DMI, where you just set the value in an custom add or update-override.
        As START_TIME and END_TIME have no DB-column, you don't need (=must not have) a customUpdateExpression there.

        I think that I would do it in DMI. On the client side, make sure that START_TIME and END_TIME match DURATION at all times.
        If you are using the latest version, you could perhaps also use the new feature formula fields.

        Best regards
        Blama

        Comment


          #5
          I Have duration in milliseconds on the database. I want to format it to be HH:MM and I also want to allow input on the form. Please assist with ideas of how to go about it.

          Comment


            #6
            My smartclient application doesnt want to work on Internet Explore, but it used to work three month ago. Is their any changes on Isomorphic?

            Comment

            Working...
            X