TextField Problem

Hi vaadiners,

I have a little app where the user types a google doc URL on a textfield and pressing a button, it should open that URL on a TYPE_BROWSER Embedded component, but the embedded constructor only accepts Resource source. My question is:

Is it possible to “convert” a textfield.getValue into a Resource?

My code:


public void buttonClick(ClickEvent event) {
           Embedded googledoc = new Embedded(null, new [u]
ExternalResource(tf.getValue()
[/u]));
           googledoc.setType(Embedded.TYPE_BROWSER);
           googledoc.setWidth("50%");
           googledoc.setHeight("150px");
           mainWindow.addComponent(googledoc);
       }
    });

Thank you very much. I hope you guys can help me :slight_smile:


new ExternalResource(new URL((String) tf.getValue()))
ought to work.

Hi Jouni,

It works great!

Thank you very much for your help :slight_smile: