Hello,

should the model of component B be persisted or set as property?

I have a page that has the same logic as in this example, but the
dynamically populated combobox value is always null when the post is done
(and also in the eventlistener method).

If i change the model to be fetch from a getModel() method that builds the
model from database, the value is set when the submit is made.

I have 3 different comboboxes, A that is built from the database and it's
model doesnt change between user selections. It's value is set correctly.
Combobox B is populated depending on what was selected in combo B and combo
C is populated depending on the selection of combo B.

now when i try to get the value of combo B in another eventlistener method,
the value is always null, and the same is also with combo C value.

tapestry version is the latest 4.1

On 9/13/06, Christian Dutaret <[EMAIL PROTECTED]> wrote:

Hi all,

I am trying to change the content of a dropdown list when some event
occur.
I am using PropertySelection to render the dropdown list. I assumed that
my
listener could change the component's PropertySelectionModel, and that
updateComponent would render the updated content, but this doesn't work.
Shouldn't the "model" binding be re-rendered when updateComponent is
called,
or am i doing something wrong?
I am using the latest 4.1.1 snapshot.

Thx for any hint.

My page class:

public abstract void setModelB(IPropertySelectionModel value);

@EventListener(targets="A", events="onchange", submitForm="form")
public void changeA(IRequestCycle cycle) {
    this.setModelB(buildNewModelFromDb(a));
    cycle.getResponseBuilder().updateComponent("B");
}

My HTML template:

<span jwcid="@Shell" title="Tapestry 4.1 test" browserLogLevel="DEBUG">
<body jwcid="@Body">
<form jwcid="[EMAIL PROTECTED]" success="listener:doNothing">
<span jwcid="[EMAIL PROTECTED]" model="ognl:modelA" value="ognl:a"/>
<span jwcid="[EMAIL PROTECTED]" model="ognl:modelB" value="ognl:b"/>
<input type="submit" value="Go"/>
</form>
</body>
</span>

Ch.


Reply via email to