Re: FileUpload not working

2014-08-07 Thread mohallo
Hi thanks for your reply .I want the user to select a xls file on their local
pc and upload the contents of the screen to that file .The file has to be
local to their system .
The examples i have seen all upload the file to the server with the method
FileUpload.writeTo(file).
In the past I have used ByteArrayResource which worked pretty good but since
moving to Wicket 6 I get a popup asking if I want to save or open the file
which locks up the application .I am trying a new approach which I hope will
work better .
I have been through all the examples but they dont meet my needs .should I
be doing something with FileUpload getInputStream .
Thanks again for you help .



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUpload-not-working-tp4666920p4666934.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: FileUpload not working

2014-08-07 Thread mohallo
Thanks for your help that worked out.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUpload-not-working-tp4666920p4666950.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



FileUpload not working

2014-08-06 Thread mohallo
Hi ,
  I am having an issue with the FileUpload component .
What I am doing is capturing the content of a screen which looks like a xsl
file and trying to upload this content to a file .
I store the screen data in a byte array .

Should this work .Thanks for your help .

here is the main part of the code .

uploadedFile is of type FileUpload



AbstractResourceStreamWriter rstream = new AbstractResourceStreamWriter() {

OutputStream outputStream = null;

public void write(OutputStream output) throws IOException {
try {
outputStream = output;

newFile = new File(fileNamePath);

if (newFile.exists()) {
newFile.delete();
newFile.createNewFile();
}

outputStream = new FileOutputStream(newFile);
outputStream.write(xlsOutput); // xlsOutput 
byte[]

uploadedFile.writeTo(newFile);

} catch (Exception ex) {
logger.error(Unable to write to the file 
specified in the search path
while trying to Export the File);
StringWriter stringWriter = new StringWriter();
ex.printStackTrace(new 
PrintWriter(stringWriter));
logger.error(stringWriter.toString());
}
}

@Override
public void close() {
try {
outputStream.close();
uploadedFile.closeStreams();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

};


RequestCycle.get().scheduleRequestHandlerAfterCurrent(new
ResourceStreamRequestHandler(rstream, null));

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUpload-not-working-tp4666920.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: FileUploadField best approach to populating a file

2013-04-11 Thread mohallo
Thanks Dan for your help.
That worked out great . 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-best-approach-to-populating-a-file-tp4657832p4657898.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: FileUploadField best approach to populating a file

2013-04-09 Thread mohallo
Dan thanks very much for the rapid response .Let me take a look . 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-best-approach-to-populating-a-file-tp4657832p4657851.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



FileUploadField best approach to populating a file

2013-04-08 Thread mohallo
I have an Excell file that I want to populate with Data .
I am using the FileUploadField component to do this .
The user locates the file that they want to populate throgh the microsoft
popup window .
The issus I am having is locating an OutputStream to populate .
When I access a fileItem OutputStream it is pointing to a Temp location .

Any Ideas how to approach this .

Thanks for your help .



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-best-approach-to-populating-a-file-tp4657832.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: Issue with panel ,model refresh

2013-01-29 Thread mohallo
Thanks for your help .
The only way I could get the getObject method called in the panel was by
adding the getDefaultModelObject call in the Timer as follows .

ajaxTimer = new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)){
public void 
onPostProcessTarget(AjaxRequestTarget target){


   refreshPanel.getDefaultModelObject();



}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-panel-model-refresh-tp4655775p4655894.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



Issue with panel ,model refresh

2013-01-28 Thread mohallo
I have the following code with a label and a model .Which works as expected
.I added a timer which refreshes the component and hence the getObject of
the model is called .
If I use the same code and Replace the timerLabel with a panel I would have
thought it would work the same way .

The Idea is to attach a model to the Panel and when the panel gets refreshed
it will call the getObject on the model .

public void init(){

timerTaskForm = new TimerTaskForm(timertaskform);
this.add(timerTaskForm);
}

private class TimerTaskForm extends Form {

public TimerTaskForm(String id) {
super(id);


timerLabel = new Label(status,new Model(){

@Override
public Serializable getObject(){

Date dt = new Date();
SimpleDateFormat sdfout = new 
SimpleDateFormat(dd--
hh:mm:ss);
String convertedValue = 
sdfout.format(dt);
return convertedValue;

}

});
ajaxTimer = new 
AjaxSelfUpdatingTimerBehavior(Duration.seconds(5));
timerLabel.add(ajaxTimer);
this.add(timerLabel);
}



}




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-panel-model-refresh-tp4655775.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: Issue with panel ,model refresh

2013-01-28 Thread mohallo
Thanks for looking at this .

that is the working code that I previously posted .

This is what I am trying to do .

private RefreshPanel refreshPanel;
private WebMarkupContainer container;
private AjaxSelfUpdatingTimerBehavior ajaxTimer;
private PanelRefreshForm panelRefreshForm; 

public PanelPageRefresh(){

init();
}

public void init(){

panelRefreshForm = new PanelRefreshForm(refreshform);
this.add(panelRefreshForm);


}

public class PanelRefreshForm extends Form{


public PanelRefreshForm(String id) {
super(id);

container = new WebMarkupContainer(container);
container.setOutputMarkupId(true);
this.add(container);

refreshPanel = new RefreshPanel(refreshPanel,new 
Model(){


@Override
public Serializable getObject() {
System.out.println(Returning Database 
objects);
return 000;
}


});

container.add(refreshPanel);  

ajaxTimer = new 
AjaxSelfUpdatingTimerBehavior(Duration.seconds(5));
container.add(ajaxTimer);



}


}






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-panel-model-refresh-tp4655775p4655854.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: Issue with panel ,model refresh

2013-01-28 Thread mohallo
It works for the Label .Trying to implement the same for the Panel .



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-panel-model-refresh-tp4655775p4655855.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