Search found 42 matches

by BrendanB
Wed Sep 16, 2020 9:20 am
Forum: Questions & Answers
Topic: Date Control value is previous day
Replies: 5
Views: 516

Re: Date Control value is previous day

Andy, the important part is #dateProcessed.value.asLocalizedDateTime the value returned from the datepicker is a UTC datetime... so when you get the 'date' if you dont specify to LocalizeDateTime, then you will get the UTC date (without the UTC adjustment). so for example, sydney is +10 hours, so if...
by BrendanB
Tue Aug 04, 2020 3:06 pm
Forum: Questions & Answers
Topic: Clear button in EditField
Replies: 2
Views: 300

Re: Clear button in EditField

Art, the Changed Event is fired twice when the Clear Button is pressed. Both times, the value is blank define_com class(#prim_nmbr) name(#ClearBtnClickCounter) Evtroutine Handling(#Edit.Changed) If (#Edit.Value = '') #ClearBtnClickCounter += 1 else #ClearBtnClickCounter := 0 endif if (#ClearBtnClick...
by BrendanB
Mon Aug 03, 2020 9:02 am
Forum: Questions & Answers
Topic: Reading JSON
Replies: 2
Views: 288

Re: Reading JSON

Jim, try something like: Define_Com Class(#PRIM_JSON.Document) Name(#lDocument) #UniCodeString := #Request.Response.AsString.Trim #lDocument.LoadFromString( #UniCodeString ) if (#Document.isObject) << returns false if not a JSON object... #msgdta := #lDocument.RootNode<'MESSAGE'>.AsString Endif Or e...
by BrendanB
Wed Jul 22, 2020 10:19 am
Forum: Questions & Answers
Topic: #PRIM_MD.List Row Background Colour
Replies: 2
Views: 320

Re: #PRIM_MD.List Row Background Colour

Jim, you could 'cheat' a little... place a Panel (sized FitBoth) on the list entry (Send to Back). Then set the color: #BackPanel.CurrentItem.Style <= #BackgroundStyle or #BackPanel.CurrentItem.ThemeDrawStyle <= #AlternateColor since a #PRIM_MD.List is a compound control, you can have as many items ...
by BrendanB
Fri Jul 10, 2020 8:52 am
Forum: Questions & Answers
Topic: RESTful on IBM i
Replies: 17
Views: 1567

Re: RESTful on IBM i

Jim, try here: https://www.lansa.com/downloads/support/tips/installing-a-dedicated-windows-web-server-for-mixed-multi.pdf I have used this guide successfully at with a few sites. Additionally, if you add something like: "map": [ { "aliases": [ "WEBSERVICES/swaggerV2" ], "method": "Get", "module": "W...
by BrendanB
Wed Jul 08, 2020 4:14 pm
Forum: Questions & Answers
Topic: Integrator - OpenLDAP - Password with special characters
Replies: 2
Views: 653

Re: Integrator - OpenLDAP - Password with special characters

Joe, I might be missing something, but i usually use double-quotes to escape things like passwords: so using something like #jsmxcmd := ('BIND HOST(&1) DN(&2) PASSWORD("&3")').substitute(#Server #DN #Password) usually that gets the password 'escaped'.... #JSMXCMD := ('BIND HOST(&1) DN(&2) PASSWORD("...
by BrendanB
Fri Apr 24, 2020 9:12 am
Forum: Questions & Answers
Topic: VLWeb Completed Event for File Downloads
Replies: 2
Views: 1504

Re: VLWeb Completed Event for File Downloads

Joe, 2 things here: 1. when you have a routine that does: routine <<< can be evtroutine or mthroutine <<showloading image>> << do important stuff >> <<hideloading image>> endroutine what happens is the *SCREEN IS NOT RENDERED* until the endroutine. if you were to do: Define_Evt Name(DownloadRequeste...
by BrendanB
Mon Dec 02, 2019 9:42 am
Forum: Questions & Answers
Topic: Method options *CONSTRUCTOR and *REQUIRED
Replies: 3
Views: 754

Re: Method options *CONSTRUCTOR and *REQUIRED

Marcus, The thing to remember: *New #TestComponent is not the same as *New #TestComponent.umConstructor The first is the *DEFAULT* constructor, the second is the constructor that you defined. The required flag tells VL that it cannot use the default constructor for the object. I think the bug is tha...
by BrendanB
Fri Nov 29, 2019 9:51 am
Forum: Questions & Answers
Topic: Method options *CONSTRUCTOR and *REQUIRED
Replies: 3
Views: 754

Re: Method options *CONSTRUCTOR and *REQUIRED

Marcus, try creating a RP Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_OBJT) Define_Com Class(#prim_alph) Name(#searchValue) Define_Com Class(#prim_alph) Name(#replacementValue) Define_Pty Name(SearchValue) Get(*Auto #searchValue) Set(*Auto #searchValue) Define_Pty Name(ReplacementValue) ...
by BrendanB
Tue Nov 26, 2019 9:58 am
Forum: Questions & Answers
Topic: VL-WEB #PRIM_LIST Selected?
Replies: 2
Views: 570

Re: VL-WEB #PRIM_LIST Selected?

Art,

did you try:

Code: Select all


Evtroutine Handling(#List.ItemSelected) Item(#Item)

* Call Mthroutine to Load Popup

Endroutine

B.
by BrendanB
Wed Nov 20, 2019 10:47 am
Forum: Questions & Answers
Topic: #PRIM_MD.Dropdown set selected VL-WEB
Replies: 6
Views: 929

Re: #PRIM_MD.Dropdown set selected VL-WEB

Ahh... gotcha... #DropDown.Items.Add( #shAcco001.AsString #shName ) is the same as #DropDown.Items.Add Value(#shAcco001.AsString) Caption(#shName) (There is actually a 3rd Parameter 'Result' -- boolean ^H^H^H^H^H^H^H object to let you know that the add succeeded or failed.) so to set the value you d...
by BrendanB
Tue Nov 19, 2019 4:29 pm
Forum: Questions & Answers
Topic: #PRIM_MD.Dropdown set selected VL-WEB
Replies: 6
Views: 929

Re: #PRIM_MD.Dropdown set selected VL-WEB

Art,

could you please share your code for creating the dropdown?

I wasnt aware that #prim_md.Dropdown allowed 2 columns....

B.
by BrendanB
Tue Nov 19, 2019 1:57 pm
Forum: Questions & Answers
Topic: #PRIM_MD.Dropdown set selected VL-WEB
Replies: 6
Views: 929

Re: #PRIM_MD.Dropdown set selected VL-WEB

Art, you have to do something like this: * CODE TO LOAD DROPDOWN: #dropDown1.AddItem Value(#shpVal) Caption(#shpCaption) #dropDown1.AddItem Value(#shpVal2) Caption(#shpCaption2) * Below code sets the 'selected' item as #shpVal (first item i added). #dropDown1.Value := #shpVal so your code could be r...
by BrendanB
Thu Oct 03, 2019 11:22 pm
Forum: Suggestions for Product Enhancements
Topic: Free Form Text Block in Code Editor
Replies: 3
Views: 2637

Re: Free Form Text Block in Code Editor

Joe, something that one of my colleagues does when doing SQL statements: #lSql := "( SELECT BDBC, BDFTYP, BDFR, " #lSql += " case when Month = 1 then sum(GM) end as JAN," #lSql += " case ..." and so on.... This allows you to break the statement for readability.... I know it is not as nice as what yo...
by BrendanB
Wed Oct 02, 2019 10:16 am
Forum: Questions & Answers
Topic: How do you decode a base64 string and turn it into a file (as pdf) and save it to a network drive
Replies: 5
Views: 1235

Re: How do you decode a base64 string and turn it into a file (as pdf) and save it to a network drive

you could also use the Integrator SMB Service to move the file from the IFS to a Network Server (SMB service handles domain users, so that might be easier than setting up FTP/QNTC).
by BrendanB
Fri Sep 27, 2019 3:46 pm
Forum: Questions & Answers
Topic: Collection in collections
Replies: 3
Views: 781

Re: Collection in collections

soa,

you need to:

Define_Pty Name(ItemMarks) get(*REFERENCE #ItemMarkCol)

then you can do:

#StdMarkCol.ItemMarks.Insert((*New #SMMKC2))
#StdMarkCol.ItemMarks.Last := #STDMKC_1 (could also do: #StdMarkCol.ItemMarks<#StdMarkCol.ItemMarks.ItemCount> := #STDMKC_1

and this should work.
by BrendanB
Wed Sep 25, 2019 9:31 am
Forum: Questions & Answers
Topic: VLWEB Photo
Replies: 4
Views: 714

Re: VLWEB Photo

I have found the Filepicker to allow taking photos on a mobile device.

I am not so sure that it will do that on a PC - you would need to test.

BTW - EPC142060 introduced a #PRIM_MD.Filepicker so that you can style the filepicker in the same way you style #PRIM_MD.Buttons.
by BrendanB
Tue Sep 03, 2019 12:52 pm
Forum: Suggestions for Product Enhancements
Topic: BLOB and IE 11
Replies: 1
Views: 2237

Re: BLOB and IE 11

Paul, you can use https://docs.lansa.com/14/en/lansa016/prim_web.blobreader.htm to read the blob. so call a method something like below should do the trick. Mthroutine Name(ReadBlob) Define_Map For(*INPUT) Class(#STD_BLOB) Name(#iBlob) Define_Com Class(#PRIM_WEB.BlobReader) Name(#BlobReader) #BlobRe...
by BrendanB
Wed Jun 12, 2019 8:55 am
Forum: Questions & Answers
Topic: SQL Join
Replies: 9
Views: 1575

Re: SQL Join

Hi, you are on the right path... simply do: define_com class(#prim_alph) name(#SqlStatement) #SqlStatement := "SELECT IM.*, SR.SRNDSC FROM im join sr on IM.IMFGRP = SR.SRNref WHERE sr.srnid = 'FG' and SR.SRNDSC like '%' || trim('" + #CASES + "') || '%' ORDER BY im.imitno" but change IM.* to the actu...
by BrendanB
Thu Apr 04, 2019 10:17 am
Forum: Questions & Answers
Topic: Make image sizes smaller (Composer)
Replies: 1
Views: 4729

Re: Make image sizes smaller (Composer)

René, depending on which type of server (windows or IBMi) they are using, the 'easiest' solution would be to place the files in a directory (from the xml) and use WATCH_DIRECTORY activity to monitor for new files, then run an external program over them (there are various command line programs for bo...