Issues when passing Key to modify in the pff

Discussions about CSEntry
Post Reply
htuser
Posts: 687
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Issues when passing Key to modify in the pff

Post by htuser »

Dear CSPro Developer Team,
Thanks a lot for adding advanced and innovative features in CSPro, mainly anticipating thanks :D for the next CSPro CAWI feature.

I'm playing with the new CSPro 8.01 features (who almost fulfilled all the request that I posted). However, I find an issue when passing a key to modify a case via pff. This should allow to automatically open a case with a specific key in modify mode. But, I find the similar issue with this user: viewtopic.php?p=17824&hilit=StartMode%3DModify#p17824
For testing purposes, I used both keylist and Sqlquery to allow any user to select a key and I pass this key in a Pff.

a)
keylist(DICTNAME, enteredKeys);
            numeric indexKey= enteredKeys.show("la liste des cles est");
          string keyValue=enteredKeys(indexKey);
b)
CS.Sqlite.exec(db := inputData,
                       sql := keyListqueryFormatter,            
                       rowFormat := "scalarArray"));
        
string caseId=invoke ("caseIds");
                pffModify.setproperty ("StartMode",maketext ("Modify;%s",caseId));
However, both failed to open the specific case in modify mode. However, using the same key, I was able to open a case in add mode and pass the values as Id.
Other questions:
1) How to display qsf label only in a case viewer (not dictionary name)?
2) What's the scope of the webview displaying the qsf ? (I would like to use a worker thread in it for improving some aspects of an application).
Thanks in advance.
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1947
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Issues when passing Key to modify in the pff

Post by Gregory Martin »

Using StartMode is supported only for backwards compatibility. For all applications I encourage people to use the Key property instead, because then you don't have to worry about start/modify mode. From the helps:
Key= specifies the case ID to automatically open. If a key is provided that exists in the data file, CSEntry will open that case and then close once the case has been entered. If the case does not exist, a new case is created and the IDs automatically filled from the values specified. If only a partial key is provided, then only the values specified are prefilled. (For example, if the IDs are cluster and household number and the key only specifies the cluster, then the cluster will be automatically filled but the interviewer will have to specify the household number.) The StartMode attribute takes precedence over the Key attribute. You generally will use only one, if any, in your design. This attribute is typically used in menu programs, often with the output of the key logic function.
Let us know if this doesn't work.

1) What do you mean by case viewer?

2) On Windows, the web view uses Microsoft's WebView2 control, and on Android we use the WebView control. What are trying to do in the web view? We probably have to enable some settings to support whatever you're doing.
htuser
Posts: 687
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Issues when passing Key to modify in the pff

Post by htuser »

Thanks Greg for your response.
1) What do you mean by case viewer?
https://www.csprousers.org/help/cspro/C ... ction.html or questionnaire viewer.
2) On Windows, the web view uses Microsoft's WebView2 control, and on Android we use the WebView control. What are trying to do in the web view? We probably have to enable some settings to support whatever you're doing.
I've just shared the demo app with you on Github. As you''ll see, I'm using sqlquery and it's a little bit slow. What I wanted was to optimize this by running all the queries on a worker thread and send the results to CSPro logic using the Clipboard.putText action. I wanted to use UI.postWebMessage action instead of clipboard, but the CSProActionInvoker.getWindowForEventListener method and/or CS.getWindowForEventListener().addEventListener("message", event => {
// ...
});
are not wrapped in the CSPro logic (or I don't know about the right syntax)... It's also clearly written that the UI.postWebMessage is for posting message to Webview, not CSPro Logic.

Right now, I intend to call CSPro logic in a worker thread in the webview of the QSF. However, I'm not sure if the scope of calling CSPro logic functions in a worker thread of the webview QSF will span...
Integrating QuickJS in CSPro logic/CSPro apps will allow to use Worker(module_filename) and running codes in parallel.
Best
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply