Hello I am developing a UI where I would like to get a dcc.input and a Button when a radioItem is selected. I am creating two different functions and trying to callback them in the app.callback function( the final func) but when I run the radioitem when selected it returns nothing.
below is the code
Func for the radio item:
def radio_itm():
children = html.Div([
([html.Div(
html.Label('Selected UPC Details'),
style = {'fontWeight':'Bold','fontsize':'25'}),
]),
html.Div(
dcc.RadioItems(id = 'UPC_select',
options = [{'label': 'ABS (default)', 'value': 'ABS (default)'},
{'label': 'ALH', 'value': 'ALH'},
{'label': 'Missing No', 'value': 'Missing No'}] ))])
return children
Function for the dcc.input and Button
def upc_selection():
children = [html.Div([
html.Div([
html.Label(("Enter a Number : "),
style = {'width': '180px','display': 'inline-block','color':'Black',
'margin-left':'250px','fontWeight':'Bold','font-style': 'italic',
'verticalAlign' : "middle"}),
html.Div(
dcc.input('',
style = {'font_family':'Gotham',
'fontSize':10,
'textAlign': 'left',
'fontWeight':'Bold',
'font-style': 'italic',
#'margin-left':'0px',
'display': 'inline-block',
'marginBottom':'10px',
'width': '100px',
'backgroundColor':'#FFFACD',
'color': colors['text']}),
html.Div(
html.Button("Find ME",className = "Find ME",
style = {'backgroundColor':'#FF7F50',
'border-radius': 9,
'type':'Bold',
'color':'Black',
'height':'25px',
'marginLeft':'20px',
'width':'90px',
'text-align':'center',
'display':'inline-block'}),
style={'width': '100px', 'display': 'inline-block'}))
]),html.Div(id = 'output-data1-promo')
]),
]
return children
@app.callback(
[Output('output-data1-promo','children')],
[Input(component_id ='UPC_select',component_property = 'value')])
def upc_layout(q,value):
child = upc_selection(q)
radio=radio_itm(value)
if value == 'Analytics List Hierarchy':
return child