Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
02:37 Xliff joined
Xliff How can I access a hash with a key that is stored in a given variable from within a template? 02:37
This is actually pretty basic stuff that is not in the documentation.
Trying to set the hash and the key into a variable so that the format is $h{$k} will not work. The template throws an error. 02:38
Likewise .hash.key, and .hash.$key
Please advise.
08:01 lizmat joined
jnthn Xliff: The docs state: "<.{$key}> can be used to do indirect hash indexing", and since that's a deref and any deref chould be parsed after a variable too, <$foo{$bar}> (or maybe <$foo.{$bar}>) should do it 09:11
The docs also cover defaults: cro.services/docs/reference/cro-we...ubroutines 09:13
09:26 Geth joined 09:33 Geth left, Geth joined 09:37 Geth left, Geth joined 12:05 xinming left 12:07 xinming joined
Xliff jnthn: Thank you for that. Must have missed it. After working all night, I finally got something working. 13:04
jnthn: Turns out the problem wasn't hash access, but trying to access a Nil value. 13:05
With appropriate guards in place, things worked.
jnthn Ah, good you got it working 13:10
Xliff jnthn: So I've noticed that for Cro::WebApp::Bootstrap::Template, your forms can only take on the attributes of the class being edited. 13:12
I've made some minor changes so that you can add supplementary elements to it. 13:13
jnthn I'm not sure if I ever really finished/released that module :) 13:14
Xliff Ah, got it. 13:15
jnthn But please do send the PR. Only thing is that by now bootstrap 5 is out so I dunno if I should just do it using that :)
Xliff OK.
One other thing, the forms have a tendency to submit when hitting enter. This kills things like having javascript prefill in <input> entries with auto calculations based on other fields. 13:16
I had to resort to javascript to stop that behavior. 13:17
jnthn: Did you get this bit? github.com/croservices/cro-webapp/...950d60f11e 13:20
jnthn Hm, it says it's not on any branch, so dunno. But it looks familiar... 13:21
Will check later
Xliff OK. Thanks for the help.
Geth cro-webapp: Xliff++ created pull request #75:
Adds the ability to add supplementary markup to the form
13:36
Xliff jnthn: There you go. 13:37
15:51 xinming left 15:53 xinming joined 16:06 Xliff left 19:35 Geth left 19:47 n1to joined 20:49 Geth joined 20:55 xinming left, xinming joined 20:57 Geth left, Geth joined 21:01 Geth left, Geth joined 21:11 n1to left 23:18 xinming left 23:19 xinming joined