@flyboarder thank you again, it worked, and I also broke it down into smaller chunks. I actually created a per-component cell so I can update them individually if needed (each component has multiple properties that are frequently edited by users)
Yep probably a good way to do it!
I'm going crazy with this code. It creates 2 divs as expected but if I click button 1 first it deletes button 2 instead and then won't delete button 1 at all. However if I click button 2 first then button 1 it deletes correctly. Am I missing something obvious? Any help would be appreciated! I'm so close to getting it to work 😇
I think I did everything according to the wiki and sample source code
The text that prints the content of components is however updated correctly. @flyboarder am I possibly hitting an unusual corner case in Javelin?
Cells inside cells feels a little weird to me. I don't think I ever do that.
By that, I mean that you have a defc
cell definition where the value is a map containing more cells
I do fairly often have just a plain map (not wrapped in a cell) that includes cells as its values. Maybe that would work better?
I'll try it thank you so much @dave
I removed the inner cells and I get the same behavior. It seems that the collection is updated correctly but the wrong div is removed
@geo.ciobanu yeah, you cannot use cells within cells like that
there is special magic that cells do to find cells it depends on and wire them up
Makes sense. I removed them and only have the cell on the collection
therefor you cannot refer to a cell within a cell by anything other than a reference, ie. no anonymous usage within a cell
Even without cells inside cell the behavior is the same, I'm wondering if I need a closure over the div?
It seems like I'm doing basic Javelin stuff ...
Is it possible that what I'm trying to do is not a good fit for Javelin? @flyboarder I'm able to create the items, display them and bind a function to remove them from the collection. However when I click the correct item is removed from the collection but the div is incorrectly updated (unless I remove the last one first).
@geo.ciobanu you are dereferencing the cells that the for-tpl is giving you, this means the value internally is no longer updated based on the position in the list
you’ll want to pass those as attributes to the element you are trying to render so that when they update the element attributes are updated
you are close, but doing too much 😉
Lol ok that's refreshing, thank you
Omg I'm so dumb
It works!!!😍
I owe you a beer, whiskey or fancy tea, whichever you prefer :-)
donate to a local charity 😉
just a quick note, in case you want to see, that I'm using Hoplon (for now mostly Javelin) for a GUI editor and that it's working really nicely. http://lindenhoney.duckdns.org:7000 (you can select and move/resize items, and create new ones by clicking on the button on the top left bar and then clicking again on the canvas) I just thought you'd like to see it used in a slightly more unique tool
impressive
i want to build something similar to this, where we can generate hoplon apps from a gui
building a gui editor is not hard just different and no tutorials exist. happy to share my code to see how I did it - I'm using it to build a no code tool.
are you saving the contents to some cms?
or static html?
not yet - but I will save it in Datomic
because it has version history for free and a very powerful way to model hierarchical data
anyway for the actual app, there are two ways to do it: generate code from the EDN app structure (a form of compiling) or build and app that interprets the app structure and build the app dynamically (interpreter). I'm planning on going the interpreter path, which is a bit harder to build at first but allows for super easy and quick updates to the app
but the editor and the app are completely separate: the editor manipulates the app data structure and the app interprets and "executes" it. So once the editor is ready you can reuse it (or just use it) and create another app that creates a hoplon app dynamically
yep I had the same thought, to be able to use custom hoplon elements you would need to go the interpreter route
will do!
I won't spam more thank yous but I'm so so happy, I like Hoplon much more than Reagent, I really didn't want to use it. A thousand times thank you!