It looks fine. You can make sure it is the right button that is triggering the event by - if (e.getButtonName().equals(BUTTON_NAME)) { FormView formView = currentBlip.getDocument().getFormView(); FormElement element = formView.getFormElement("input"); wavelet.appendBlip().getDocument().append(element.getValue()); }
On Thu, Oct 8, 2009 at 1:17 AM, r.pesquera <r.pesqu...@pesqair.com> wrote: > > Here is part of my code which has a form with a send button. The code > as is does not work. When i press the submit button nothing happens, > no new blip is created. But, If I comment out the "FormView form = > blip.getDocument().getFormView();" the bot returns a new blip when the > send button is pressed, but the new blip come out empty. It is > supposed to return the same string entered in the text box. I would > appreciate any help.. Thanks. > > > if (bundle.wasSelfAdded()){ > Blip blip = wavelet.appendBlip(); > TextView textView = blip.getDocument(); > textView.appendMarkup("ENTER COMMAND:"); > form = textView.getFormView(); > form.append(new FormElement(ElementType.INPUT, > TEXTFIELD)); > form.append(new FormElement(ElementType.BUTTON, > "submit", > "Enter")); > } > > > for (Event e: bundle.getEvents()){ > if (e.getType() == EventType.FORM_BUTTON_CLICKED){ > Blip blip = e.getBlip(); > FormView form = > blip.getDocument().getFormView(); > String urlElement = > form.getFormElement(TEXTFIELD).getValue(); > Blip blip1 = wavelet.appendBlip(); > TextView textView = blip1.getDocument(); > textView.append(urlElement); > > > > } > > } > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to google-wave-api@googlegroups.com To unsubscribe from this group, send email to google-wave-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en -~----------~----~----~----~------~----~------~--~---