PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Signal All Changes Multiline  (Read 295 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 108
    • View Profile
Signal All Changes Multiline
« on: April 20, 2021, 10:07:22 AM »
Hi List,
i hope what i'm trying to do is not too outlandish. I've done it before with a grid (changing row height to zero to filter rows) but i'm trying to do with a list box.
Here is scenario.

As the User types into a multi-line [like a keyword search], i want to reload list box with each key stroke... [so on multi-line i have signal all changes]
however after i reload list box i cannot get cursor to stay at the end of the Multi-Line so they can type next character
i've fiddled with selectoffset,selectlength but i cannot get to work.
has anyone had any luck doing anything like this?

Jeff
« Last Edit: April 20, 2021, 10:09:00 AM by Jeffrey Ferreira »

Gilles

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Signal All Changes Multiline
« Reply #1 on: April 20, 2021, 10:55:36 AM »
Jeffrey,
Have you tried to check "Append text" of the multi-line?

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 108
    • View Profile
Re: Signal All Changes Multiline
« Reply #2 on: April 20, 2021, 10:57:19 AM »
I have not. I'm not sure what that is (Dynamic Property).  I will read about it and try it.

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 108
    • View Profile
Re: Signal All Changes Multiline
« Reply #3 on: April 20, 2021, 12:00:21 PM »
I tried and it did not work. I have done this numerous times before...I changed the results grid to a control and it still doesnt work. I maybe mistaken but i think it is the version of my pxplus.  When i activate signal all changes on a multi-line it does not seem to work... i'm going to remove it and they search will not be interactive for now...

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3476
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Signal All Changes Multiline
« Reply #4 on: April 21, 2021, 04:32:07 PM »
We just added a search window to the Data Dictionary element list (something for PxPlus 2021 due in May), and had no trouble with a Signal all changes input field.

The logic basically scanned a list of what elements were in the grid then set the 'currentRow and 'currentColno properties in the grid accordingly.  It no match was found it also set the search control's text color to Red.

We haven't had any trouble with focus -- it stayed on the control and simply changed the current cell in the grid.

Perhaps you were using a GRID GOTO which changes the current cell but ALSO changes focus.

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 108
    • View Profile
Re: Signal All Changes Multiline
« Reply #5 on: April 22, 2021, 08:25:05 AM »
Hi Mike,

i'm not doing a grid goto.
i'm using v16.2 .
i have done this before and it worked great (and fast) and customers love it because they can immediately see applicable rows as they type in keywords. 
i've changed the code for now whereby they have to hit <Enter> to execute search (so it is not immediate) and they are fine with that...

here is on change logic: (i hope i'm not doing something silly)

8000 ! ^1000
8010 KEYWORD_SEARCH_ENTERED:
8020 ! -----------------------------------------------------------------------------------
8030 local ROW=0
8040 local ROWSHIGH=0
8050 local TOTAL_KEYWORDS=0
8060 local KEYWORD_MATCH=0
8070 local KEYWORD_ARRAY_INDEX=0
8080 local ROW_HEIGHT=0
8090 ! -----------------------------------------------------------------------------------
8100 let KEYWORD_SEARCH$=ucs(cvs(KEYWORD_SEARCH$,35))
8110 let TOTAL_KEYWORDS=0 ! THIS IS CONTROLLING VARIABLE / IF THIS IS ZERO THEN WE WON'T LOOK FOR KEYWORD MATCH
8120 if not(nul(KEYWORD_SEARCH$)) then {
8130 let TOTAL_KEYWORDS=pos($20$=KEYWORD_SEARCH$,1,0)+1 ! Get Number of Spaces $20$ and add 1
8140 local dim KEYWORD_ARRAY$[1:TOTAL_KEYWORDS]
8150 read data from KEYWORD_SEARCH$,sep=$20$ to KEYWORD_ARRAY${all}
8160  }
8170 ! -----------------------------------------------------------------------------------
8180 let ROWS_HIGH=CUSTOMER_GRID.CTL'ROWSHIGH
8190 if ROWS_HIGH=0 then goto *return
8200 for ROW=1 to ROWS_HIGH
8210 let CUSTOMER_GRID.CTL'ROW=ROW
8220 read data from CUSTOMER_GRID.CTL'ROWDATA$ to iol=CUSTOMER_GRID.CTL'LOADIOLIST$,err=*continue
8230 let G.CUSTOMER_NAME$=ucs(G.CUSTOMER_NAME$)
8240 let KEYWORD_MATCH=1 ! DEFAULT TO MATCH FOUND
8250 if TOTAL_KEYWORDS=0 then goto *break ! IF NOT KEYWORDS THEN JUST BREAK OUT (I.E. SHOW ALL ROWS)
8260 for KEYWORD_ARRAY_INDEX=1 to TOTAL_KEYWORDS
8270 if not(pos(KEYWORD_ARRAY$[KEYWORD_ARRAY_INDEX]=G.CUSTOMER_NAME$)) then {
8280 let KEYWORD_MATCH=0 ! COULD NOT FIND ONE OF THE KEYWORDS SO BREAK OUT
8290 goto *break
8300  }
8310 next KEYWORD_ARRAY_INDEX
8320 let ROW_HEIGHT=tbl(KEYWORD_MATCH<>0,0,1.75) ! SET ROW HEIGHT TO 1.75 IF WE GOT MATCH / OTHERWISE SET TO 0
8330 let CUSTOMER_GRID.CTL'ROW=ROW
8340 let CUSTOMER_GRID.CTL'COLUMN=0
8350 let CUSTOMER_GRID.CTL'ROWHEIGHT=ROW_HEIGHT
8360 next ROW
8370 return