Repository: gradio-app/gradio
Pull request: Add example of using component update method 
# Description

Fixes #1359 

<img width="1097" alt="image" src="https://user-images.githubusercontent.com/41651716/180884170-bc4e4101-10f2-4968-9861-987e40ba4dd5.png">



# Checklist:

- [x] I have performed a self-review of my own code
- [x] My code follows the style guidelines of this project
- [x] I have commented my code in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes


Problem statement:
Add component update to docs
- [x] I have searched to see if a similar issue already exists.

**Is your feature request related to a problem? Please describe.**  
In workflows with multiple steps it might be necessary to make the user choose based on output for model 1 for subsequent models. 
Currently, the radio and dropdown fields only support changing the active value but not all the values. 

**Describe the solution you'd like**  
Like updating the textbox i'd like to be able to do the following:
```
import gradio as gr

def update(name):
    return [f'Hello {name}',f'Bye {name}', f'Good morning {name}' ]

demo = gr.Blocks()

with demo:
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Radio(label="Greeting to use")
    
    inp.change(fn=update, 
               inputs=inp, 
               outputs=out)

demo.launch()
```

Hints from issue discussion:
This is actually possible with `Blocks`! We still need to add documentation around it, but in your case, all you need to do is modify the return statement to use the special `.update()` method that every component defines, like this:

```py
def update(name):
    return gr.Radio.update(choices=[f'Hello {name}',f'Bye {name}', f'Good morning {name}' ])

demo = gr.Blocks()

with demo:
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Radio(choices=[], label="Greeting to use")
    
    inp.change(fn=update, 
               inputs=inp, 
               outputs=out)

demo.launch()
```

<img width="626" alt="image" src="https://user-images.githubusercontent.com/1778297/169883905-669e825c-ee0b-4dd2-bf11-009ec09fc30d.png">

Ah thanks. I tried this using `gr.radio.update(["test1", "test2"])` . Adding documentation for this would be good
Opening the issue until update is added to docs.
@abidlabs @FarukOzderim Does this issue track adding the `update` method for each component to the Docs page? 

We already added `gr.update` to the Docs page under "blocks utilities" and "Introduction to Blocks" already includes an "Updating Component Configurations" section. 

I think we should close unless we specifically want to add the `update` method for each component to the docs page.
It should stay open because we need to document Component.update as we have it in our library as well, even if we have it in the guides. Btw, IMO Component.update should be the suggested usage because it has autocompletion for the function parameters.
But no need to list each of them seperately, we can just show an example of it in gr.update and suggest using it since it will have parameter tracking/autocompletion.

Commit message: Fix wording

Patch to review:
diff --git a/gradio/blocks.py b/gradio/blocks.py
index 733811e716..574b08f8b2 100644
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -205,8 +205,10 @@ def update(**kwargs) -> dict:
     Updates component parameters.
     This is a shorthand for using the update method on a component.
     For example, rather than using gr.Number.update(...) you can just use gr.update(...).
+    Note that your editor's autocompletion will suggest proper parameters
+    if you use the update method on the component.
 
-    Demos: blocks_update, blocks_essay_update
+    Demos: blocks_update, blocks_essay, blocks_essay_update
 
     Parameters:
         kwargs: Key-word arguments used to update the component's properties.


Code review comments:
diff_hunk: @@ -205,8 +205,10 @@ def update(**kwargs) -> dict:
     Updates component parameters.
     This is a shorthand for using the update method on a component.
     For example, rather than using gr.Number.update(...) you can just use gr.update(...).
+    Note that your editor's autocompletion will suggest proper parameters
+    if you use the update method on the component.
 
-    Demos: blocks_update, blocks_essay_update
+    Demos: blocks_update, blocks_essay, blocks_essay_update
path: gradio/blocks.py
text: @user1:
Good job!

Would prefer if the default example is Component.update version.
```suggestion
    Demos: blocks_essay, blocks_update, blocks_essay_update
```