For the outer dataTable, the selection="..." clause needs to reference a blueprint because the value="..." clause is a list of blueprints. To get the selected part, you'll need to include the selection clauses on the inner datatable as well.
Where you use the variable {a}, you should just be able to include the field name as in #{a.name} and #{a.amount}. You didn't indicate which version of Primefaces or what development tool your using, but in my version of NetBeans v12.2, Netbeans won't do the field name lookup automatically in this case. I just had to type it in manually, and ignore the warning triangle.
I had issues getting the selectedPart to work, maybe because there was no command button to submit the form on my page. I resolved it with a p:ajax tag.
Here's my version. I tested it with Primefaces 8, running on Wildfly 21 and using Java 11.
<h:form>
<p:dataTable id ="BlueprintList" value="#{rowExpansionController.blueprints}"
var="blueprint"
rowKey="#{blueprint.name}"
selectionMode="single" selection="#{rowExpansionController.selectedBlueprint}"
rowExpandMode="single">
<p:ajax event="rowSelect" listener="#{rowExpansionController.rowSelectBlueprint}" />
<p:column style="width:16px">
<p:rowToggler />
</p:column>
<p:column headerText="Name">
#{blueprint.name}
</p:column>
<p:rowExpansion>
<p:dataTable value="#{blueprint.parts}" var="part"
rowKey="#{part.name}" selectionMode="single"
selection="#{rowExpansionController.selectedPart}">
<p:ajax event="rowSelect" listener="#{rowExpansionController.rowSelectPart}" />
<p:column headerText="Name">
#{part.name}
</p:column>
<p:column headerText="Amount">
#{part.amount}
</p:column>
</p:dataTable>
</p:rowExpansion>
</p:dataTable>
</h:form>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…