0
votes

I am trying to get his work. For some reason Input tag does not get rendered when create view is selected

{#customer}     
Name: 
{@select key="{viewType}"}
    {@eq value="create"}<input type="text" name="name"/></eq}
    {@eq value="edit"}<input type="text" name="name" value="{name}"/>{/eq}
    {@eq value="view"}{name}{/eq}
{/select}

Status:
{@select key="{viewType}"}
    {@eq value="create"}<input type="text" name="status"/>{/eq}
    {@eq value="edit"}<input type="text" name="status"value="{status}"/>{/eq}
    {@eq value="view"}{status}{/eq}
{/select}
{/customer}
2
Can you post a sample of your JSON? - smfoote

2 Answers

0
votes

Could it be that you're not closing your section with a proper {/eq} but a

</eq}  

instead?

0
votes

I resolved this by passing an empty JSON to the template while rendering create template view

var customer = {};

instead of

var customer = '';

I am passing following JSON for rendering view and edit view templates

var customer = {name:'Customer Name', status:'Important'};

Apparently the whole block was getting ignored when dust did not find matching JSON parameter.