How to manage Xblock and multiple children xblock

Hello,

I’m new to OpenEdx and I’m working on XBlocks development. In my project I have one xblock and multiple children xblock.
how to manage the children xblock in order to call them, sould I use a xml file and declare them in setup.py file like this :

xml file:

<first-block></first-block>
<second-block></second-block>

setup.py file

BLOCKS = [
        'myxblock-parent=myxblock.myxblock:MyXblock
        'first-block = myxblock.first:FirstBlock',
        'second-block = myxblock.second:SecondBlock',
]
        setup(
            name=''
            entry_points={
                'xblock.v1': BLOCKS,
            },
        )

but the problem is my js file isn’t execute in this case, Also the method with @XBlock.json_handler related with js isn’t called any more . What I should I do.
What shoud contain my parent xblock.
Thanks for your help

Hi, I’m not sure exactly what you’re trying to do but I recommend you play around with Problem Builder in Studio and look at its code - it is an example of an XBlock that uses various child XBlocks.

1 Like