if you want to propogate the cpm down to the panel, but maybe index it
with the panel's id you can do
class mypanel extends panel {
protected imodel initmodel() {
imodel model=super.initmodel(); // returns original cpm
return new compoundpropertymodel(new propertymodel(model, getid()));
}
}
-igor
On Tue, Mar 4, 2008 at 5:40 AM, Stefan Zachara <[EMAIL PROTECTED]> wrote:
>
> That was copy-paste mistake.
>
> Thx for that method with '.'
>
>
>
>
>
> Mr Mean wrote:
> >
> > You are adding the textfield not to panelTwo but to the form (in the
> > constructor of panelTwo).
> > That or you made some errors copy-pasting.
> > Try to add the textfield directly to PanelTwo and if that does not
> > work change the id of your textfield to "panelTwo.textfield"
> >
> > Maurice
> >
> > On Tue, Mar 4, 2008 at 2:04 PM, Stefan Zachara <[EMAIL PROTECTED]> wrote:
> >>
> >> I have Component using CompoundPropertyModel (sth like that):
> >> public class MyPanelOne extends Panel {
> >> public MyPanelOne(String id, CompoundPropertyModel cModel) {
> >> super(id);
> >> Form form = new Form("someForm",cModel);
> >> form.add(new MyPanelTwo("panelTwo"));
> >> form.add(new Label("blabla"));
> >> form.add(new TextField("blablabla"));
> >> ....
> >> }
> >> }
> >> with html like:
> >> <html>
> >> <wicket:panel>
> >> <form wicket:id="someForm">
> >>
> >>
> >> <input type="text" wicket:id="blablabla"/>
> >> ...
> >> </form>
> >> </wicket:panel>
> >> </html>
> >>
> >>
> >> And second panel is like this:
> >> public class MyPanelTwo extends Panel {
> >> public MyPanelTwo(String id) {
> >> super(id);
> >> form.add(new Label("label"));
> >> form.add(new TextField("textfield"));
> >> ....
> >> }
> >> }
> >> <html>
> >> <wicket:panel>
> >>
> >> <input type="text" wicket:id="textfield"/>
> >> ...
> >> </wicket:panel>
> >> </html>
> >>
> >> My object inserted into CompoundPropertyModel:
> >> public class MyObject implements Serializable {
> >> private MySecondObject panelTwo;
> >> private String blabla;
> >> private String blablabla;
> >> ... get + set ...
> >> }
> >> public class MySecondObject implements Serializable {
> >> private String label;
> >> private String textfield;
> >> ... get + set ...
> >> }
> >>
> >> Problem is wicket is searching for label and textfield in MyObject and
> >> not
> >> in MySecondObject.
> >> "WicketMessage: No get method defined for class: class MyObject
> >> expression:
> >> label"
> >> I'd like to have those two objects separated.
> >>
> >> How can I make that CompoundPropertyModel chained?
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-make-use-chain-models--tp15826732p15826732.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-make-use-chain-models--tp15826732p15827346.html
>
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]