You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bhupat parmar <bh...@gmail.com> on 2007/08/29 08:04:43 UTC

wicket problem

hi
i am facing problems in retriving the values from a multiple choice box i
made in wicket frame work.I wrote a onSibmit() function but it througes an
exception saying that propertymodel is set to null.
Can somebody tell me how to implement this.
thanks

Re: wicket problem

Posted by bhupat parmar <bh...@gmail.com>.
if u check the file upload example in wicket site u can see this . any way
the only having a file upload so no probs but my form also contains some
text fields
thanks
bhupat

On 8/29/07, Igor Vaynberg <ig...@gmail.com> wrote:
>
> upload.getfileupload() ?
>
> -igor
>
>
> On 8/28/07, bhupat parmar <bh...@gmail.com> wrote:
> >
> > hi
> > my code goes like this
> >
> >
> >     private static class TabPanel3 extends Panel
> >     {
> >         FileUploadField fileUploadField = null;
> >         TextField styleNameTFld=null;
> >         private String message = "";
> >         /** available sites for the multiple select. */
> >         private static final List SITES =
> >             Arrays.asList(new String[] { "The Server Side", "Java
> Lobby","
> > Java.Net" });
> >
> >         public TabPanel3(String id)
> >         {
> >             super(id);
> >             final FileUploadForm simpleUploadForm = new
> > FileUploadForm("simpleUpload");
> >
> >             add(simpleUploadForm);
> >         }
> >         private class FileUploadForm extends Form
> >         {
> >             private FileUploadField fileUploadField;
> >             private TextField styleNameTFld;
> >
> >             /**
> >              * Construct.
> >              *
> >              * @param name
> >              * Component name
> >              */
> >             public FileUploadForm(String name)
> >             {
> >                 super(name);
> >
> >                 // set this form to multipart mode (always needed for
> > uploads!)
> >                 setMultiPart(true);
> >
> >                 // Add one file input field
> >                 add(fileUploadField = new FileUploadField("fileInput"));
> >                 add(styleNameTFld=new TextField("styleNameTFld"));
> >
> >                 // Set maximum size to 100K for demo purposes
> >                 setMaxSize(Bytes.kilobytes(500));
> >             }
> >
> >             /**
> >              * @see wicket.markup.html.form.Form#onSubmit()
> >              */
> >             protected void onSubmit()
> >             {
> >                 final wicket.markup.html.form.upload.FileUpload upload =
> > fileUploadField.getFileUpload();
> >
> >                 String imgPath = upload.getClientFileName();
> >
> >                 if (upload != null)
> >                 {
> >
> >                 System.out.println("inside onSubmit "+ imgPath);
> >                   // here i am getting the path but how do i get the
> value
> > in the text field??????????????????????????
> >                 }
> >
> >             }
> >         }
> >
>

Re: wicket problem

Posted by Igor Vaynberg <ig...@gmail.com>.
upload.getfileupload() ?

-igor


On 8/28/07, bhupat parmar <bh...@gmail.com> wrote:
>
> hi
> my code goes like this
>
>
>     private static class TabPanel3 extends Panel
>     {
>         FileUploadField fileUploadField = null;
>         TextField styleNameTFld=null;
>         private String message = "";
>         /** available sites for the multiple select. */
>         private static final List SITES =
>             Arrays.asList(new String[] { "The Server Side", "Java Lobby","
> Java.Net" });
>
>         public TabPanel3(String id)
>         {
>             super(id);
>             final FileUploadForm simpleUploadForm = new
> FileUploadForm("simpleUpload");
>
>             add(simpleUploadForm);
>         }
>         private class FileUploadForm extends Form
>         {
>             private FileUploadField fileUploadField;
>             private TextField styleNameTFld;
>
>             /**
>              * Construct.
>              *
>              * @param name
>              * Component name
>              */
>             public FileUploadForm(String name)
>             {
>                 super(name);
>
>                 // set this form to multipart mode (always needed for
> uploads!)
>                 setMultiPart(true);
>
>                 // Add one file input field
>                 add(fileUploadField = new FileUploadField("fileInput"));
>                 add(styleNameTFld=new TextField("styleNameTFld"));
>
>                 // Set maximum size to 100K for demo purposes
>                 setMaxSize(Bytes.kilobytes(500));
>             }
>
>             /**
>              * @see wicket.markup.html.form.Form#onSubmit()
>              */
>             protected void onSubmit()
>             {
>                 final wicket.markup.html.form.upload.FileUpload upload =
> fileUploadField.getFileUpload();
>
>                 String imgPath = upload.getClientFileName();
>
>                 if (upload != null)
>                 {
>
>                 System.out.println("inside onSubmit "+ imgPath);
>                   // here i am getting the path but how do i get the value
> in the text field??????????????????????????
>                 }
>
>             }
>         }
>

Re: wicket problem

Posted by bhupat parmar <bh...@gmail.com>.
hi
my code goes like this


    private static class TabPanel3 extends Panel
    {
        FileUploadField fileUploadField = null;
        TextField styleNameTFld=null;
        private String message = "";
        /** available sites for the multiple select. */
        private static final List SITES =
            Arrays.asList(new String[] { "The Server Side", "Java Lobby","
Java.Net" });

        public TabPanel3(String id)
        {
            super(id);
            final FileUploadForm simpleUploadForm = new
FileUploadForm("simpleUpload");

            add(simpleUploadForm);
        }
        private class FileUploadForm extends Form
        {
            private FileUploadField fileUploadField;
            private TextField styleNameTFld;

            /**
             * Construct.
             *
             * @param name
             * Component name
             */
            public FileUploadForm(String name)
            {
                super(name);

                // set this form to multipart mode (always needed for
uploads!)
                setMultiPart(true);

                // Add one file input field
                add(fileUploadField = new FileUploadField("fileInput"));
                add(styleNameTFld=new TextField("styleNameTFld"));

                // Set maximum size to 100K for demo purposes
                setMaxSize(Bytes.kilobytes(500));
            }

            /**
             * @see wicket.markup.html.form.Form#onSubmit()
             */
            protected void onSubmit()
            {
                final wicket.markup.html.form.upload.FileUpload upload =
fileUploadField.getFileUpload();

                String imgPath = upload.getClientFileName();

                if (upload != null)
                {

                System.out.println("inside onSubmit "+ imgPath);
                  // here i am getting the path but how do i get the value
in the text field??????????????????????????
                }

            }
        }

Re: wicket problem

Posted by Igor Vaynberg <ig...@gmail.com>.
show us your code and we maybe be able to tell you what you are doing wrong

-igor


On 8/28/07, bhupat parmar <bh...@gmail.com> wrote:
>
> hi
> i am facing problems in retriving the values from a multiple choice box i
> made in wicket frame work.I wrote a onSibmit() function but it througes an
> exception saying that propertymodel is set to null.
> Can somebody tell me how to implement this.
> thanks
>