Bug in MultiFileUploadField

2008-01-05 Thread Franklin Antony

Dear All,
   I have been extensively using the MutiFileUploadField and have been
facing some issues, however I am happy that there is a component like this
and has save a lot of time for me. Some of the things that I have come
across are as follows

1)If I enter some data in the file upload field and just move out(something
like loose focus), then that entry I placed inside the text file just gets
listed below. My suggestion would be somehow to get that field as disabled
2)If you enter some data in the field and click just below the text field 
so as your click will be placed right on top of the delete, then you can
enter data inside the Delete button. My suggestion is that if the text
field is disabled then this problem might not come.
3)Not really sure how I can do internationalization.

I would really appreciate your help.
I have placed an image to show the problems also

Thanks guys for all the help.
Franklin.


Problem Image:  http://www.nabble.com/file/p14631169/wicket_bug.jpg 

-- 
View this message in context: 
http://www.nabble.com/Bug-in-MultiFileUploadField-tp14631169p14631169.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]



Dynamic Page Redirection

2007-12-01 Thread Franklin Antony

Dear All,
   I have three pages. Page A,Page B,Page C. The use case is as follows

When I click the onSubmit of Page A(has a form) I setResponse to Page B.
Page B already has forms and buttons and many other components in it. Now on
Page B i want to dynamically redirect to Page C under certain situations. To
make the whole story short, I want to bypass Page B(it shouldnt render) and
go to Page C.

I tried out RequestCyle.redirectTo and also call setResponsePage but didnt
work. Could someone please help?

Thanks,
Franklin.
-- 
View this message in context: 
http://www.nabble.com/Dynamic-Page-Redirection-tf4928005.html#a14104658
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamic Page Redirection

2007-12-01 Thread Franklin Antony

Thanks.
Perfect and working fine.


Regards,
Franklin.



Franklin Antony wrote:
 
 Dear All,
I have three pages. Page A,Page B,Page C. The use case is as follows
 
 When I click the onSubmit of Page A(has a form) I setResponse to Page B.
 Page B already has forms and buttons and many other components in it. Now
 on Page B i want to dynamically redirect to Page C under certain
 situations. To make the whole story short, I want to bypass Page B(it
 shouldnt render) and go to Page C.
 
 I tried out RequestCyle.redirectTo and also call setResponsePage but didnt
 work. Could someone please help?
 
 Thanks,
 Franklin.
 

-- 
View this message in context: 
http://www.nabble.com/Dynamic-Page-Redirection-tf4928005.html#a14105934
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Thanks, but I can't get this to work...

2007-11-29 Thread Franklin Antony

Hi Naaman ,
  I am also in the same boat. If it did work at your end, could you please
let me know.

Thanks,
Franklin.



Johan Compagner wrote:
 
 Wat you could try to do is make that markup container a
 transparantresolver. Then the components can be added to the page
 itself
 
 2007/11/18, nlif [EMAIL PROTECTED]:

 I tried adding an attributeModifier to the Page class, and it doesn't
 work
 (the dir attribute is not added to the html element).

 I then tried creating a WebMarkupContainer (and adding wicket:id to the
 html
 element in my html file), but this throws an exception. I think it's
 because
 I did it in my base-page class, and there are classes that extend it, and
 their components are not added to my webMarkupContainer.

 Last, I tried using a MarkupFilter, like this:

 getApplication().getMarkupSettings().setMarkupParserFactory(new
 IMarkupParserFactory()
 {
 public MarkupParser newMarkupParser(MarkupResourceStream
 resource)
 {
 MarkupParser parser = new MarkupParser(new
 XmlPullParser(), resource);
 parser.appendMarkupFilter(new AbstractMarkupFilter()
 {
 public MarkupElement nextTag()
 throws ParseException
 {
 // Get the next tag. If null, no more
 tags
 are available
 final ComponentTag tag = (ComponentTag)
 getParent().nextTag();

 if (tag == null)
 {
 return tag;
 }

 if (html.equals(tag.getName()))
 {
 tag.addBehavior(new
 AttributeModifier(dir, true, new Model(rtl)));
 }

 return tag;
 }
 });

 return parser;
 }
 });


 I used a debugger to verify it indeed executes the addBehavior() line,
 but
 still - no dir attribute is added to the html.

 I cannot seem to find anywhere in the forum a specific example. There are
 only general suggestions, such as use MarkupFilter or add an
 AttributeModifier... I guess an code-sample would be helpful.

 Thanks again,
 Naaman





 --
 View this message in context:
 http://www.nabble.com/How-can-I-switch-page-direction-%28LTR-RTL%29--tf4805391.html#a13817345
 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-can-I-switch-page-direction-%28LTR-RTL%29--tf4805391.html#a14025007
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Thanks, but I can't get this to work...

2007-11-29 Thread Franklin Antony

Thanks jan a million. Its working now!!!

Just to add for more information sake

The wicket:id attribute should be as follows
html wicket:id=html

/html


Also I used a SimpleAttributeModifier and its working!!!


Thanks,
Franklin.



Jan Kriesten wrote:
 
 
 hi,
 
 just add a wicket:id to html and then within your page:
 
 ---
 MarkupContainer html, container;
 html = new WebMarkupContainer( html )
 {
   private static final long serialVersionUID = 1L;
 
   @Override
   public boolean isTransparentResolver()
   {
 return true;
   }
 };
 
 html.add( new AttributeModifier( xml:lang, lang ) );
 html.add( new AttributeModifier( lang, lang ) );
 add( html );
 ---
 
 all other elements can then added directly to the page as well.
 
 best regards, --- jan.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-switch-page-direction-%28LTR-RTL%29--tf4805391.html#a14028129
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FormComponentPanel doesn't get the Model set on Page

2007-11-26 Thread Franklin Antony

Dear Friends,
  I have a situation where in which I have a FormComponentPanel. This
FormComponentPanel  is placed on Form and the Form in turn placed on a Page.
Now when I instantiate the page I set a model on the page using setModel(new
CompoundPropertyModel(myModel)). Further I DO NOT  pass this model in to  my
Form or FormComponentPanel. The problem I am facing is that I cannot access
the model in the FormComponentPanel  but I can access it on the Form . On
the mailing list I have come across the convertInput() but not sure what it
actually does. Can someone please help in this context.


Thanks,
Franklin.


-- 
View this message in context: 
http://www.nabble.com/FormComponentPanel-doesn%27t-get-the-Model-set-on-Page-tf4876640.html#a13954695
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multi-file upload and ListView together

2007-11-13 Thread Franklin Antony

I need to give it a Model that holds a collection so I did something like
this

Model mode = new Model()
{
Object getObject()
{
Collection holder = new ArrayList();
return holder;
}

}


Then I do this.

MultiFileUploadField ff=new MultiFileUploadField(file_input,model,3);

Still it gives problems. I still dont know how will I get a handle on all
the files I have added.
Please correct me if I am wrong somewhere


Again this is a MultiFileUploadField in a ListView which is on a From. I
just want to know where should I define my collections. Should be on the
Page or Form or somewhere else.

Thanks,
Franklin.




Johan Compagner wrote:
 
 you could try with a simpler model? and see if that works? (so just new
 Model())
 
 On Nov 13, 2007 8:22 AM, Franklin Antony [EMAIL PROTECTED] wrote:
 

 Thanks Igor but it doesnt seem to work still.

 Just some more hints:

 I have the listview on a form and the form is on the page.
 The uploads collection object is on the form.
 It keeps telling me that there is no such uploads object on the page and
 so
 I changed the call from

 MultiFileUploadField ff=new MultiFileUploadField(file_input,new
 PropertyModel(this,uploads),3);

 to

 MultiFileUploadField ff=new MultiFileUploadField(file_input,new
 PropertyModel(MyForm.this,uploads),3);

 Still doest work.


 So now i add the collections uploads directly to the page and make call
 like
 this


 MultiFileUploadField ff=new MultiFileUploadField(file_input,new
 PropertyModel(MyPage.this,uploads),3);

 Now there is some light in this direction. Only the last set of files in
 the
 listview go inside the uploads collection.


 I really wish if someone could shed some light on this. Wicket has been
 so
 easy to use up to now. But I am getting confused with how it will handle
 the
 model in case of reapeaters. I need all the repeaters to use the same
 collections object.


 Thanks for all the help Igor,
 Franklin



 igor.vaynberg wrote:
 
  did you call listview.setreuseitems(true)
 
  it is usually easier if you provide a quickstart...
 
  -igor
 
 
  On Nov 12, 2007 7:28 AM, Franklin Antony [EMAIL PROTECTED]
 wrote:
 
  Dear Friends,
 I am having a problem with putting MultiFileUploadField inside a
  ListView. I am following the example, but somehow the uploads
 collection
  is
  not getting populated with the files. However when I directly add the
  MultiFileUploadField  on a form everything seems to work. Could
 someone
  please shed some light on this.
 
  Here is some code snippet
 
  List ls = Arrays.asList(new String[]{Passport });
  ListView pl = new ListView(plist,ls)
  {
 
  protected void populateItem(ListItem
  arg0) {
 
 
  MultiFileUploadField ff=new
  MultiFileUploadField(file_input,new
  PropertyModel(this,uploads),3);
 
  fileUploadList.add(ff);
  fileUpload.add(ff);
  arg0.add(ff);
 
 
 
 
  }
 
 
  };
 
 
  And the listview is on a form and the collections(uploads) is on the
 form
  to
  just as in the example. I am sure its something with the component
  hierarchy. But not sure how to call the uploads correctly. I think
 there
  is
  something wrong with the expression.
 
 
  Thanks,
  Franklin
  --
  View this message in context:
 
 http://www.nabble.com/Multi-file-upload-and-ListView-together-tf4791788.html#a13707621
  Sent from the Wicket - User mailing list archive at
 Nabble.comhttp://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/Multi-file-upload-and-ListView-together-tf4791788.html#a13720963
  Sent from the Wicket - User mailing list archive at
 Nabble.comhttp://nabble.com/
 .


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/Multi-file-upload-and-ListView-together-tf4791788.html#a13722270
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multi-file upload and ListView together

2007-11-13 Thread Franklin Antony
 it = fileUpload.iterator();
 
 System.out.println(got iterator);

 }





}

private int uploadFile(final FileUpload upload , String comments, int
docTypeCD){
 
if( !upload.getClientFileName().toLowerCase().endsWith(.gif) ){
FileUploadPage.this.info(Can not upload file :  +
upload.getClientFileName() +. Only GIF file can be uploaded.);
return -1;
} 

// Create a new file
PassportDocDAO passportDAO =
((UploadApplication)Application.get()).getPassportDocDAO();
passportDAO.setComments(comments);
passportDAO.setDocDate(new Date());
passportDAO.setDocTypeCD(docTypeCD);
try {

passportDAO.savePassportDataStream(upload.getInputStream(), (int)
upload.getSize());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new IllegalStateException(Unable to write file);
}
passportDAO.setUserPassportId(1);
passportDAO.setVersion(0);
int docId =
((UploadApplication)Application.get()).getIFilePersistService().persistFile(passportDAO);
FileUploadPage.this.info(saved file:  + 
upload.getClientFileName());

return docId;
}


/** Log. */
private static final Log log = LogFactory.getLog(FileUploadPage.class);


/**
 * Constructor.
 * 
 * @param parameters
 *Page parameters
 */
public FileUploadPage(final PageParameters parameters)
{
Folder uploadFolder = getUploadFolder();

// Create feedback panels
final FeedbackPanel uploadFeedback = new
FeedbackPanel(uploadFeedback);

// Add uploadFeedback to the page itself
add(uploadFeedback);

/*fileListView = new FileListView(fileList, new
LoadableDetachableModel()
{
protected Object load()
{
return Arrays.asList(getUploadFolder().listFiles());
}
});
add(fileListView);*/

// Add upload form with ajax progress bar
final FileUploadForm ajaxSimpleUploadForm = new
FileUploadForm(ajax-simpleUpload);

ajaxSimpleUploadForm.add(new UploadProgressBar(progress,
ajaxSimpleUploadForm));
add(ajaxSimpleUploadForm);
}

private Folder getUploadFolder()
{
return ((UploadApplication)Application.get()).getUploadFolder();
}
}


Kindly please advice
Thanks,
Franklin.




Franklin Antony wrote:
 
 Dear Friends,
I am having a problem with putting MultiFileUploadField inside a
 ListView. I am following the example, but somehow the uploads collection
 is not getting populated with the files. However when I directly add the
 MultiFileUploadField  on a form everything seems to work. Could someone
 please shed some light on this.
 
 Here is some code snippet
 
 List ls = Arrays.asList(new String[]{Passport });
 ListView pl = new ListView(plist,ls)
 { 
   
   protected void populateItem(ListItem arg0) {
   
   
   MultiFileUploadField ff=new 
 MultiFileUploadField(file_input,new
 PropertyModel(this,uploads),3);
   
   fileUploadList.add(ff);
   fileUpload.add(ff);
   arg0.add(ff);
   
   
   
   
   }
   
   
 };
 
 
 And the listview is on a form and the collections(uploads) is on the form
 to just as in the example. I am sure its something with the component
 hierarchy. But not sure how to call the uploads correctly. I think there
 is something wrong with the expression.
 
 
 Thanks,
 Franklin
 

-- 
View this message in context: 
http://www.nabble.com/Multi-file-upload-and-ListView-together-tf4791788.html#a13722948
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multi-file upload and ListView together

2007-11-12 Thread Franklin Antony

Dear Friends,
   I am having a problem with putting MultiFileUploadField inside a
ListView. I am following the example, but somehow the uploads collection is
not getting populated with the files. However when I directly add the
MultiFileUploadField  on a form everything seems to work. Could someone
please shed some light on this.

Here is some code snippet

List ls = Arrays.asList(new String[]{Passport });
ListView pl = new ListView(plist,ls)
{ 

protected void populateItem(ListItem arg0) {


MultiFileUploadField ff=new 
MultiFileUploadField(file_input,new
PropertyModel(this,uploads),3);

fileUploadList.add(ff);
fileUpload.add(ff);
arg0.add(ff);




}


};


And the listview is on a form and the collections(uploads) is on the form to
just as in the example. I am sure its something with the component
hierarchy. But not sure how to call the uploads correctly. I think there is
something wrong with the expression.


Thanks,
Franklin
-- 
View this message in context: 
http://www.nabble.com/Multi-file-upload-and-ListView-together-tf4791788.html#a13707621
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multi-file upload and ListView together

2007-11-12 Thread Franklin Antony

Thanks Igor but it doesnt seem to work still.

Just some more hints:

I have the listview on a form and the form is on the page.
The uploads collection object is on the form.
It keeps telling me that there is no such uploads object on the page and so
I changed the call from

MultiFileUploadField ff=new MultiFileUploadField(file_input,new
PropertyModel(this,uploads),3);

to

MultiFileUploadField ff=new MultiFileUploadField(file_input,new
PropertyModel(MyForm.this,uploads),3);

Still doest work.


So now i add the collections uploads directly to the page and make call like
this 


MultiFileUploadField ff=new MultiFileUploadField(file_input,new
PropertyModel(MyPage.this,uploads),3);

Now there is some light in this direction. Only the last set of files in the
listview go inside the uploads collection. 


I really wish if someone could shed some light on this. Wicket has been so
easy to use up to now. But I am getting confused with how it will handle the
model in case of reapeaters. I need all the repeaters to use the same
collections object.


Thanks for all the help Igor,
Franklin



igor.vaynberg wrote:
 
 did you call listview.setreuseitems(true)
 
 it is usually easier if you provide a quickstart...
 
 -igor
 
 
 On Nov 12, 2007 7:28 AM, Franklin Antony [EMAIL PROTECTED] wrote:

 Dear Friends,
I am having a problem with putting MultiFileUploadField inside a
 ListView. I am following the example, but somehow the uploads collection
 is
 not getting populated with the files. However when I directly add the
 MultiFileUploadField  on a form everything seems to work. Could someone
 please shed some light on this.

 Here is some code snippet

 List ls = Arrays.asList(new String[]{Passport });
 ListView pl = new ListView(plist,ls)
 {

 protected void populateItem(ListItem
 arg0) {


 MultiFileUploadField ff=new
 MultiFileUploadField(file_input,new
 PropertyModel(this,uploads),3);

 fileUploadList.add(ff);
 fileUpload.add(ff);
 arg0.add(ff);




 }


 };


 And the listview is on a form and the collections(uploads) is on the form
 to
 just as in the example. I am sure its something with the component
 hierarchy. But not sure how to call the uploads correctly. I think there
 is
 something wrong with the expression.


 Thanks,
 Franklin
 --
 View this message in context:
 http://www.nabble.com/Multi-file-upload-and-ListView-together-tf4791788.html#a13707621
 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/Multi-file-upload-and-ListView-together-tf4791788.html#a13720963
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]