Commit 65c5386a authored by Bas Lijnse's avatar Bas Lijnse

Fixed use of custom views in updateSharedInformation

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@2061 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 8762b25b
......@@ -31,7 +31,7 @@ basicAPIExamples =
,workflow (sharedData +++ "Edit stored persons") "Update a stored list of persons" editStoredPersons
,workflow (sharedData +++ "View stored persons") "View a stored list of persons" viewStoredPersons
,workflow (sharedData +++ "Editors on shared note") "edit notes" notes
,workflow (sharedData +++ "BUGGY: Edit note or List of strings") "Edit note or List of strings" linesPar
,workflow (sharedData +++ "Edit note or List of strings") "Edit note or List of strings" linesPar
,workflow (seqTasks +++ "Hello User") "Enter your name:" hello
,workflow (seqTasks +++ "Positive Number") "Enter a positive number:" positiveNumber
......
......@@ -34,8 +34,8 @@ updateSharedInformation :: !d ![UpdateOption r w] !(ReadWriteShared r w) -> Task
updateSharedInformation d [UpdateWith tof fromf] shared
= interact d (toReadOnly shared)
(\r -> let v = tof r in (fromf r v,v,defaultMask v))
(\l r v m ok -> if ok (let nl = fromf r v in (let nv = tof r in (nl,nv,defaultMask nv))) (l,v,m))
@> (mapval,shared)
(\l r v m ok -> if ok (if (fromf r (tof r) =!= l) (let nv = tof r in (fromf r nv,nv,defaultMask nv)) (fromf r v,v,m)) (l,v,m))
@> (mapval,shared)
updateSharedInformation d _ shared
//Use dynamics to test if r == w, if so we can use an update view
//If different types are used we can only resort to a display of type r and an enter of type w
......@@ -43,7 +43,7 @@ updateSharedInformation d _ shared
(rtow :: (r^ -> w^))
= interact d (toReadOnly shared)
(\r -> let v = rtow r in (rtow r,v,defaultMask v))
(\l r v m ok -> if ok (let nl = (if (rtow r =!= l) (rtow r) v) in (let nv = nl in (nl,nv,defaultMask nv))) (l,v,m))
(\l r v m ok -> if ok (if (rtow r =!= l) (let nv = rtow r in (nv,nv,defaultMask nv)) (v,v,m)) (l,v,m))
@> (mapval,shared)
_
= interact d (toReadOnly shared)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment