You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by armandoxxx <ar...@dropchop.com> on 2011/07/05 02:35:45 UTC

AjaxFormComponentUpdatingBehavior causes javascript error

Hi guys 

got a little problem with AjaxFormComponentUpdatingBehavior.

I put a form in a panel and add text area to it. 

this.messageForm = new Form<T>("messageForm",
(IModel<T>)this.getDefaultModel());
		this.messageForm.setOutputMarkupId(true);
		this.message = new TextArea<String>("messageArea", new
Model<String>("Vpišite sporočilo ...")) {
			
			private static final long serialVersionUID = 7090971229354611969L;
			
			@Override
			protected void onComponentTag(final ComponentTag theTag) {
				if (PhonePanel.this.photoWrapper.isVisible()) {
					theTag.put("style", "height: " + (375 -30 -
DropchopApplication.DEFAULT_PHOTO_HEIGHT) + "px;");
				}
			}
			
		};
		this.message.add(
			new AjaxFormComponentUpdatingBehavior("onblur") {
				
				private static final long serialVersionUID = -3755174800992307122L;
				
				@Override
				protected void onUpdate(final AjaxRequestTarget theTarget) {
					Component comp = getComponent();

					TextArea textarea = (TextArea)comp;
					
					String message = (String) textarea.getConvertedInput();
					LOG.info("Current message:" + message);
					theTarget.addComponent(PhonePanel.this.messageForm);
				}
				
			}
		);
		this.message.setOutputMarkupId(true);
		
		this.messageForm.add(this.message);
		
		
		this.sendMessageLink = new AjaxSubmitLink("sendMessageLink",
this.messageForm) {;
		
			private static final long serialVersionUID = 8597958558044823747L;
			
			@Override
			protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
				// TODO Auto-generated method stub
				
			}
		};



when ever onblur event occurs I get javascript errors

Uncaught TypeError: Cannot read property 'id' of null (wicket-ajax.js:479)
Wicket.Form.serializeElement (wicket-ajax.js:479)
(anonymous function) (messaging:174)
onblur (messaging:175)


Does anyone know whats going on ? 

Regards

Armando

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-causes-javascript-error-tp3644889p3644889.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AjaxFormComponentUpdatingBehavior causes javascript error

Posted by armandoxxx <ar...@dropchop.com>.
got it ... was missing 

super.onComponentTag(theTag);


in text area

regards

Armando

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-causes-javascript-error-tp3644889p3644928.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org