Re: Error in dynamic form with any number of drop down ,enu

2012-03-22 Thread kshitiz
Thank you for the linkthe error is gone but now, drop down is not gtting
displayed...what could be the reason...surely organizationList is not
getting populated with dropdownchoice component but why?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-dynamic-form-with-any-number-of-drop-down-enu-tp4492543p4496153.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Error in dynamic form with any number of drop down ,enu

2012-03-22 Thread Martin Grigorov
Hi,

Your code:
  StatelessForm  registerForm = new StatelessForm
("registerForm", new CompoundPropertyModel(userDomain));
...
registerForm.add(organizationList = new ListView("organizationList") {

since organizationList has no its own model it asks its parent for a
model. Since the parent uses CompoundPropertyModel it tries to find
userDomain.organizationList bean property. Check CompoundPropertyModel
javadoc. Also https://cwiki.apache.org/WICKET/working-with-wicket-models.html

On Thu, Mar 22, 2012 at 7:58 AM, kshitiz  wrote:
> Hi, what is the relation between userdomain and organizationList as shown in
> the error...i have searched my things in internet but I am not able to
> understand...the problem is related to dropdownchoice declaration so where
> userdomain comes into picture??
>
> Please help me...
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Error-in-dynamic-form-with-any-number-of-drop-down-enu-tp4492543p4494681.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Error in dynamic form with any number of drop down ,enu

2012-03-21 Thread kshitiz
Hi, what is the relation between userdomain and organizationList as shown in
the error...i have searched my things in internet but I am not able to
understand...the problem is related to dropdownchoice declaration so where
userdomain comes into picture??

Please help me...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-dynamic-form-with-any-number-of-drop-down-enu-tp4492543p4494681.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Error in dynamic form with any number of drop down ,enu

2012-03-21 Thread kshitiz
Sorry..I missed to add *registerForm.add(organizationList);* in java class.
After adding that with proper getters and setters..I am getting the error:

WicketMessage: No get method defined for class: class domain.UserDomain
expression: organizationList

Root cause:

org.apache.wicket.WicketRuntimeException: No get method defined for class:
class domain.UserDomain expression: organizationList
 at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499)
...

What is the reason ... I have added getters and setters...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-dynamic-form-with-any-number-of-drop-down-enu-tp4492543p4492627.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Error in dynamic form with any number of drop down ,enu

2012-03-21 Thread Michal Wegrzyn
Hi,

You should add "organizationList" to the registerForm object.

Best regards,
Michal Wegrzyn

> -Original Message-
> From: kshitiz [mailto:k.agarw...@gmail.com]
> Sent: Wednesday, March 21, 2012 15:57
> To: users@wicket.apache.org
> Subject: Error in dynamic form with any number of drop down ,enu
> 
> Hi,
> 
> I want to create a form where user can have any number of drop down
> menus.
> Here is my code:
> 
> *private ListView> organizationList;* public
> Register() throws InvalidEmailException, Exception
>   {
>   add(new FeedbackPanel("feedbackPanel"));
>   final DropDownChoice organizationDropDown = new
> DropDownChoice(
>   "organizations", new
> PropertyModel(this, "selected"), SEARCH_ENGINES);
>   StatelessForm  registerForm = new StatelessForm
> ("registerForm", new
> CompoundPropertyModel(userDomain));
>   add(registerForm);
>   Label nameLabel = new Label("nameLabel", "Name");
> registerForm.add(nameLabel);
> RequiredTextField nameField = new
> RequiredTextField("name", new PropertyModel(this,
> "name"));
> 
> nameField.add(LengthBetweenValidator.lengthBetween(MIN_LOCATION_NAME_LE
> NGTH,
> MAX_LOCATION_NAME_LENGTH));
> registerForm.add(nameField);
> 
> *this.add(organizationList = new ListView("organizationList") {
> 
> /**
>*
>*/
>   private static final long
> serialVersionUID = 1L;
> 
>   @Override
> protected void populateItem(final ListItem item) {
> item.add(organizationDropDown);
> 
> }
> }); *
> 
> 
> 
> 
> 
> Button submitButton = new Button("submitButton") {
> @Override
> public void onSubmit() {
>   info("Selected search engine : " + selected);
>   System.out.println(selected);
>   organizationList.add(organizationDropDown);
> }
> };
> 
> registerForm.add(submitButton);
> 
> 
>   }
> 
> 
> 
> And my html files is:
> 
> 
>   
>  Name
> 
> * 
>  
>  *
> 
>   class="formbutton"
> name="Register" wicket:id="submitButton"/>
>   
> 
> 
> 
> But I am getting the error:
> *Unable to find component with id 'organizationList' in
> [MarkupContainer [Component id = registerForm]]. *
> 
> I have followed the same procedure as given in various examples in
> google.
> So what is the cause of error?
> 
> --
> View this message in context: http://apache-
> wicket.1842946.n4.nabble.com/Error-in-dynamic-form-with-any-number-of-
> drop-down-enu-tp4492543p4492543.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org


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