Skip to content

Unable to change .content value of ui.text() components within ui.section card #2209

Answered by mtanco
n-srinidhi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @n-srinidhi!

Your textbox has the name user_stat1_val, but in your update code you have q.page['top_section'].user_stat_1_val.content (note the extra underscore). When I updated the variables to match, the code worked.

To @mturoci's point, I did strip down a lot of your example to be able to get to the root cause. Here's what I might have shared an an MRE

from h2o_wave import main, app, Q, ui, data, run_on, on

# Sample Data
user_info = {'101': {'preferred_hour': '6'}, '102': {'preferred_hour': '7'}, '103': {'preferred_hour': '8'}, '104': {'preferred_hour': '9'}}

@app('/')
async def serve(q: Q):

    if not q.client.initialized:
        q.client.user_id = list(user_info.keys())[0]

  …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@n-srinidhi
Comment options

Comment options

You must be logged in to vote
2 replies
@n-srinidhi
Comment options

@mturoci
Comment options

Answer selected by n-srinidhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants