I have the following code I am using with a matrix object. It is popping up a menu, allowing the user to enter a qty and the subtracts the user entered amount from the database. It is working wonderfully except the matrix updating. It takes a manual refresh to have the values show up. Maybe I am not using the timer code correctly?
local vMenuChoice,vCellClicked,vRecord
vCellClicked=info(“matrixcell”)
vRecord=Array(vSelectedShippingRecord,3,“;”)
popupatmouse “Ship Available?”+cr()+“Enter Qty”,“Ship Available?”,vMenuChoice
If vMenuChoice contains “Enter”
local vShipQty
gettext "Qty To Ship? : ",vShipQty
find JobNumber=vRecord
ShipQty=val(vShipQty)
QtyOnHand=QtyOnHand-val(vShipQty)
TotalDelivered=TotalDelivered+val(vShipQty)
starttimer “pause”,
“code”,{ObjectAction “ShipApprovalMatrix”, “redraw”, “all”, vCellClicked},
“repeat”,1,
“scope”,“window”
rtn
endif
This is a little above my pay grade, but I noticed that “redraw” isn’t listed as a possible object action in the Help files. matrixredrawclickedcell is, though. Also, although as far as I can see you’re using the timer correctly, I’m puzzled about why you need one in there at all. Does your code work as you expect without the timer?
I have the following code I am using with a matrix object. It is popping up a menu, allowing the user to enter a qty and the subtracts the user entered amount from the database. It is working wonderfully except the matrix updating. It takes a manual refresh to have the values show up. Maybe I am not using the timer code correctly?
“redraw”,“cell” is definitely a valid command for the matrix object.
Like Bill, I am puzzled as to why you are using a timer. I don’t see any reason why it should be necessary.
Since you are using a timer, I think the problem is the local variable, vCellClicked. That variable only exists in the original procedure – you can’t use it in the timer code. The timer code is a separate procedure, so it doesn’t share local variables with any other procedure, including the procedure where it is defined. So your timer code has an error. However, timer code doesn’t report errors with an alert, because that could easily cause a situation where Panorama locked up because it was generating errors once per second (or whatever the timer frequency is). It should have displayed a notification of the error, but maybe you have notifications disabled, either globally or for just Panorama.
My first choice would be to get rid of the time, and just use objectaction directly. That should be the simplest solution.
If you want to use the timer, you could make vCellClicked into a windowglobal variable. Or, you could embed it into the timer code like this:
I put the timer in the code when the objectaction did not work. But, as I am taking another look I realize I might have left out a small detail. The matrix is definitely redrawing, what is not updating is a TDO with this formula in it… pattern(val(Array(info(“matrixcelldata”),12,";")),"#,"). The procedure allows a click on a matrix cell, pops up a dialog that allows entry of a value, takes the entered value and adds it to a field. This field is used in the matrix data variable which is the 12th item of the Array(info(“matrixcelldata”)…
Simply put, I am updating a field, rebuilding the Array used as the data for the matrix which ends up being displayed with the formula above. If I manually refresh the matrix it works.
I don’t see any code to rebuild an array. There wouldn’t have to be if the matrix data was an arraybuild( function, or some other array building formula, but you seem to be saying it’s a variable.