webtier@glassfish.java.net

dynamically created form: decode methode called twice

From: Lyn Büsching <buesching_at_lat-lon.de>
Date: Mon, 16 Aug 2010 13:56:07 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I'm trying to write a client containing a dynamically created form. The user
have to select a web service process out of a selectOneMenu. Depending on this
selection the form must be created. Selecting the web service and the following
update of the form is ajax based.
The form in my xhtml page contains a binding and a preRenderComponentEvent:

<h:form id="form" binding="#{wPSBean.executeForm}" >
  <f:event type="preRenderComponent" listener="#{wPSBean.loadForm}" id="formEvent"/>
</h:form>

In the loadForm() methode the form, depending on the selected web service
process will be created:

public void loadForm( ComponentSystemEvent event )
                            throws AbortProcessingException {
(...)
HtmlInputText literalText = new HtmlInputText();
literalText.setId( input.getId().toString() );
(...)
HtmlCommandButton button = new HtmlCommandButton();
button.setId( "executeButton" );
String buttonEL = "#{executeBean.executeProcess}";
MethodExpression action =
fc.getApplication().getExpressionFactory().createMethodExpression(
        fc.getELContext(), buttonEL, null, new Class<?>[] { ActionEvent.class } );
button.getAttributes().put( "process", selectedProcess );
MethodExpressionActionListener listener = new MethodExpressionActionListener(
action );
executeForm.getChildren().add( button );
(...)
}

After clicking the created executeButton the listener (executeProcess()) will be
called to handle the submitted values.
The problem is, that the decode methode of the form elements will be called
twice in the apply request values phase!

Does anyone have an idea how to solve this?

Thanks,
Lyn


- --
l a t / l o n GmbH
Aennchenstrasse 19 53177 Bonn, Germany
phone ++49 +228 18496-0 fax ++49 +228 18496-29
http://www.lat-lon.de http://www.deegree.org
Follow deegree on Twitter: http://twitter.com/deegree_org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxpJ1YACgkQ/QSXMw31ZStKiACfbqjkTd/WScbAwB+D/MCvP4Qg
FeoAn0ax+Brnv9/5vIaII8rnt9rBCRXg
=Zd9k
-----END PGP SIGNATURE-----