once you understand models it becomes quiet trivial :)
below is the simple way (without using a compound property model)

class mypage extends webpage {
private user user;
private logtype logtype;
// getters setters (only necessary in 1.2.x, in later wicket will access
private properties through property model)

public mypage() {
 form form=new form();
 add(new DropDownChoice("users",new PropertyModel(this, "user"),....));
 add(new DropDownChoice("logtypes", new PropertyModel(this,
"logtype"),...));

  add(new DataView("results",new MyDataProvider(),...
  ...


 private class MyDataProvider implements IDataProvider {
     public Iterator iterator(int f,int c) {
         return getlogs(user,logtype);
      }
  }
}

and thats all she wrote. makes sense?

-igor




On 3/15/07, GS-ikiini <[EMAIL PROTECTED]> wrote:


The popilateItem as i know it is used within the dataview. That part i
understand. let me re-explain myself.

on my webpage class, i have a dataview component. i also have a
dropdownview
component . they are both children of a form component. i have a beans
user,
log and logtype. (I am using wicket along with spring.). now in my webpage
i have a drop down class whic implements dropdownchoice. the list for the
drop down is generated earlier in the webpage class. i have a drop down
for
the user. and a drop down for the log type. I want to get the user
selection
for these two, tie it back to the appropriate bean then set those beans in
the implementation of the dataprovider then use the implementation of the
data provider as the model for the dataview. My problem lies is getting
the
user selection from the drop down. I can't seem get it without having a
model to tie it to.



igor.vaynberg wrote:
>
> first of all the dataprovider is a readonly interface, it has no set
> method
> like the model.
>
> that said what you want is simple:
>
> populateitem(item item) {
>    final imodel namemodel=new propertymodel(item.getmodel(), "name");
>    add(new dropdownchoice("names",namemodel,nameslist));
> }
>
> -igor
>
>
> On 3/15/07, GS-ikiini <[EMAIL PROTECTED]> wrote:
>>
>>
>> i see....i have a fair understaning of models this is what i am doing:
I
>> have
>> a dataprovider that services a dataview. this data provider is the the
>> model
>> that i ultimately need to update. however the properties within this
are
>> beans i need to set them using the selection from the dropdown. so fo
>> instance....my dataprovider has a property that is a saya user. this
user
>> itself has a property called name. which is a string. now in my webpage
>> class i have a dropdown with a list of names. what i need to do is
select
>> a
>> name and get the appropriate bean to pass it to the dataprovider so
that
>> it
>> can do its thing and return its results to the dataview. how would i go
>> about this?
>>
>> -B
>>
>>
>> igor.vaynberg wrote:
>> >
>> > since you dont specify the model for the selection wicket will look
for
>> a
>> > compoundpropertymodel you have somewhere above. the value will go
into
>> the
>> > bean that is in the compoundpropertymodel into a property with the
same
>> > name
>> > as the id of the dropdownchoice.
>> >
>> > there is a great page on models on our wiki
>> >
>> > -igor
>> >
>> >
>> > On 3/15/07, GS-ikiini <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> also how do i get the user selection from a drop down that uses the
>> >> dropDownchoice(String id,list choinces) constrctor?
>> >>
>> >>
>> >>
>> >> Gwyn wrote:
>> >> >
>> >> > I'm away from my main computer now, so can't check code, but have
>> you
>> >> > had a look at the Wicket examples, e.g.
>> >> >
>> >>
>>
http://www.wicket-library.com/wicket-examples/compref?wicket:bookmarkablePage=:wicket.examples.compref.DropDownChoicePage
>> >> >
>> >> > /Gwyn
>> >> >
>> >> > On 15/03/07, GS-ikiini <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> ok here is another question...how do i by pass the validating and
>> form
>> >> >> processing and go straight to the onSubmit method of my form(not
>> the
>> >> >> button)?
>> >> >>
>> >> >> -B
>> >> >>
>> >> >>
>> >> >>
>> >> >> GS-ikiini wrote:
>> >> >> >
>> >> >> > hey all,
>> >> >> >
>> >> >> > I am attempting to do some form processing for a filter that i
am
>> >> >> > building. I user 4 dropDownChoice in a form with a submit
button.
>> I
>> >> >> want
>> >> >> > to overide the onSubmit method, which i did. however when i try
>> to
>> >> get
>> >> >> the
>> >> >> > values selected from the drop down in the method for
prodessing,
>> >> they
>> >> >> come
>> >> >> > back empty. I am using pro wicket as a reference. i wrote
simple
>> >> helper
>> >> >> > methods as illustrated in the book but they don't seem to work:
>> >> >> >
>> >> >> >
>> >> >> > ...
>> >> >> > desc = new
>> >> >> FilterChoice("description",ldp,processTypeDropDownList,logs);
>> >> >> > ...
>> >> >> >
>> >> >> > protected String getDescriptionSelection(){
>> >> >> >     return desc.getModelObjectAsString();
>> >> >> >   }
>> >> >> >
>> >> >> > ...
>> >> >> > @overide
>> >> >> > onSubmit(){
>> >> >> > if(MyClass.this.getDescriptionSelection() .equals(something)){
>> >> >> >    do something...
>> >> >> > }
>> >> >> > }
>> >> >> >
>> >> >> > thing is...I insert some log.debugs in there to see what was
>> being
>> >> >> > returned and nothing came back. How can i get the selection
back
>> to
>> >> my
>> >> >> > onSubmit method i guess is my question. Thank you
>> >> >> >
>> >> >> > -B
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>>
http://www.nabble.com/form-processing---getting-dropdown-selection-back-to-onSubmit-method.-tf3409455.html#a9501974
>> >> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >> >>
>> >> >
>> >> > --
>> >> > Download Wicket 1.2.5 now! - http://wicketframework.org
>> >> >
>> >> >
>> >>
>>
-------------------------------------------------------------------------
>> >> > Take Surveys. Earn Cash. Influence the Future of IT
>> >> > Join SourceForge.net's Techsay panel and you'll get the chance to
>> share
>> >> > your
>> >> > opinions on IT & business topics through brief surveys-and earn
cash
>> >> >
>> >>
>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> >> > _______________________________________________
>> >> > Wicket-user mailing list
>> >> > Wicket-user@lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>>
http://www.nabble.com/form-processing---getting-dropdown-selection-back-to-onSubmit-method.-tf3409455.html#a9503553
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>>
-------------------------------------------------------------------------
>> >> Take Surveys. Earn Cash. Influence the Future of IT
>> >> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share
>> >> your
>> >> opinions on IT & business topics through brief surveys-and earn cash
>> >>
>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> >> _______________________________________________
>> >> Wicket-user mailing list
>> >> Wicket-user@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >>
>> >
>> >
>>
-------------------------------------------------------------------------
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to
share
>> > your
>> > opinions on IT & business topics through brief surveys-and earn cash
>> >
>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> > _______________________________________________
>> > Wicket-user mailing list
>> > Wicket-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >
>> >
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/form-processing---getting-dropdown-selection-back-to-onSubmit-method.-tf3409455.html#a9503768
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>
-------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>

--
View this message in context:
http://www.nabble.com/form-processing---getting-dropdown-selection-back-to-onSubmit-method.-tf3409455.html#a9505291
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to