Commit 7104894c authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

bugje uit pulldown tgv update triplets aanpassing

parent c48078d5
......@@ -58,3 +58,8 @@ MyDir :: !ServerKind -> String // name of directory in which persistent
traceHtmlInput :: !ServerKind !(Maybe [(String, String)]) -> BodyTag // for debugging showing the information received from browser
globalFormName :== "CleanForm" // name of hidden Html form in which iData state information is stored
updateInpName :== "UD" // marks update information
globalInpName :== "GS" // marks global state information
selectorInpName :== "CS_" // marks constructor update
......@@ -58,20 +58,9 @@ globalstateform globalstate
] ""
]
globalFormName :: String
globalFormName =: "CleanForm"
updateInpName :: String
updateInpName =: "UD"
globalInpName :: String
globalInpName =: "GS"
selectorInpName :: String
selectorInpName =: "CS_"
isSelector name = name%(0,size selectorInpName - 1) == selectorInpName
getSelector name = name%(size selectorInpName,size name - 1)
getSelector name = decodeString (name%(size selectorInpName,size name - 1))
// Serializing Html states...
......@@ -186,20 +175,21 @@ where
# (thisexe,input) = mscan '\"' input // get rid of garbage
# input = skipping ['UD\"'] input
# (triplet, input) = mscan '=' input // should give triplet
// # (new, input) = mscan '-' input // should give triplet value <<< *** Bug for negative integers??? ***
# (found,index) = FindSubstr ['--'] input
# (new, input) = splitAt index input // should give triplet value
# (_,input) = mscan '=' input
# input = skipping ['\"GS\"'] input
# (found,index) = FindSubstr ['---'] input
# state = if found (take index input) ['']
= if (toString triplet == "")
# striplet = toString triplet
= if (striplet == "")
("clean", [], toString state)
(if (isSelector (toString triplet))
("clean", [(fromJust (parseString (decodeChars new)), "")], toString state)
("clean", [(fromJust (parseString (decodeChars triplet)) , toString new)], toString state))
(if (isSelector striplet)
("clean", [(fromJust` (decodeChars new) (parseString (decodeChars new)), "")], toString state)
("clean", [(fromJust` (decodeChars triplet) (parseString (decodeChars triplet)) , toString new)], toString state))
fromJust` _ (Just value) = value
fromJust` string Nothing = ("",0,UpdI 0)
ordertriplets [] accu = accu
ordertriplets [x=:((id,_,_),_):xs] accu
......
......@@ -19,7 +19,7 @@ Start world = doHtmlServer MyPage4 world
:: Record = {name :: String, address :: TextArea, zipcode :: Int}
myrecord :: TextArea
myrecord :: [Tree Record]
myrecord = createDefault
......
......@@ -208,7 +208,7 @@ gForm{|PullDownMenu|} (init,formid) hst=:{submits}
= ( { changed = False
, value = v
, form = [Select (onMode formid.mode [] [] [Sel_Disabled Disabled] [] ++
[ Sel_Name ("CS")
[ Sel_Name (selectorInpName +++ encodeString (itemlist!!menuindex))
, Sel_Size size
, `Sel_Std [Std_Style ("width:" <+++ width <+++ "px")]
, `Sel_Events (if submits [] (callClean OnChange formid.mode formid.id))
......
......@@ -348,7 +348,7 @@ where
mkConsSel :: Int String [String] Int (FormId x) -> BodyTag
mkConsSel cntr myname list nr formid
= Select [ Sel_Name ("CS_" +++ myname) : styles ] // changed to see changes in case of a submit
= Select [ Sel_Name (selectorInpName +++ encodeString myname) : styles ] // changed to see changes in case of a submit
[ Option
[Opt_Value (encodeTriplet (formid.id,cntr,UpdC elem)) : if (j == nr) [Opt_Selected Selected:optionstyle] optionstyle] elem
\\ elem <- list & j <- [0..]
......
Supports Markdown
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