Re: Newbie Question

2018-05-06 Thread Sven Meier

Hi,

Wicket can repeat markup, see here:

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_displaying_multiple_items_with_repeaters

Have fun
sven



Am 05.05.2018 um 22:56 schrieb athag...@csd.auth.gr:

The question is about as simple as it gets:
in the HelloWorld! example a single String is printed on the server by 
adding one new Label in the .java file in a such manner:

 add(new Label("id", "what I actualy want to print");

Therefore, in order to print a single string I must've predefined it 
the .html file:

 "Message goes here"

The question is: how do I print the contents of an ArrayList with an 
unknown and non-static ammount of Strings? In other words, how do I 
print a number of Strings without having predefined their ammount in 
the html file ?


Thanks in advance!


-
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



Newbie Question

2018-05-05 Thread athageor

The question is about as simple as it gets:
in the HelloWorld! example a single String is printed on the server by  
adding one new Label in the .java file in a such manner:

 add(new Label("id", "what I actualy want to print");

Therefore, in order to print a single string I must've predefined it  
the .html file:

 "Message goes here"

The question is: how do I print the contents of an ArrayList with an  
unknown and non-static ammount of Strings? In other words, how do I  
print a number of Strings without having predefined their ammount in  
the html file ?


Thanks in advance!


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



Re: Newbie question : How do I display a tabbed list vertically rather than horizontally?

2014-06-10 Thread Paul Bors
Extend the Wicket class you want like the AjaxTabbedPanel in Java (Model and 
Controller) and change the HTML (viewer) as you please.

You would need access to Wicket’s source code thus if you use Maven see the 
sources classifier at:
 http://maven.apache.org/pom.html

Perhaps your IDE (Eclipse, Netbeans, IntelliJ IDEA, etc) is already configured 
to view the sources of your project’s dependencies.
If not download the sources manually from maven central or view the source code 
in the right branch online at GitHub:
https://github.com/apache/wicket/tree/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs

Note the TabbedPanel.html contents:
wicket:panel xmlns:wicket=http://wicket.apache.org;
div wicket:id=tabs-container class=tab-row
ul
li wicket:id=tabsa href=# wicket:id=linkspan 
wicket:id=title[[tab title]]/span/a/li
/ul
/div
div wicket:id=panel class=tab-panel!-- no panel --/div
/wicket:panel

So create your own VerticalTabbedPanel.html and change the HTML mark-up to say 
a table but preserve the wicket:id hierarchy:
html xmlns:wicket=http://wicket.apache.org;
wicket:panel
table width=100% border=0 cellpadding=0 cellspacing=0
tr valign=top
td valign=top nowrap=nowrap
div wicket:id=tabs-container class=tab-row
ul
li wicket:id=tabs
a href=# wicket:id=linkspan 
wicket:id=title[[tab title]]/span/a
/li
/ul
/div
/td
tdnbsp;/td
td valign=top width=100%
div wicket:id=panel class=tab-panel[panel]/div
/td
/tr
/table
/wicket:panel
/html

Then you need to extend the AjaxTabbedPanel java class to your own 
VerticalTabbedPanel.java say:
public class VerticalTabbedPanel extends TabbedPanel {
// In your own VerticalTabbedPanel constructors call super.*
}

From then on, feel free to use your new VerticalTabbedPanel.

Alternately you can use CSS to style the original markup of the 
TabbedPanel.html to be vertical which might be an easier solution as earlier 
suggested.
I only provided this answer to you so you can learn how easy it is to override 
Wicket’s code and its markup if so desired.

On Jun 9, 2014, at 10:34 AM, Tim Collins tcoll...@greatergood.com wrote:

 I am rather new to wicket and am trying to do something that ought to be 
 rather easy... I want to make the tabs I display show up vertically rather 
 than horizontally.
 
 I am currently building a arraylist of tabs and then passing them to 
 AjaxTabbedPanel, but as far as I can see there is no way to make the 
 resulting tabs on a page show up down the left side of a page rather than 
 across the top... Is there an easy way to do that?
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



Newbie question : How do I display a tabbed list vertically rather than horizontally?

2014-06-09 Thread Tim Collins
I am rather new to wicket and am trying to do something that ought to be 
rather easy... I want to make the tabs I display show up vertically 
rather than horizontally.


I am currently building a arraylist of tabs and then passing them to 
AjaxTabbedPanel, but as far as I can see there is no way to make the 
resulting tabs on a page show up down the left side of a page rather 
than across the top... Is there an easy way to do that?


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



Re: Newbie question : How do I display a tabbed list vertically rather than horizontally?

2014-06-09 Thread Mihir Chhaya
Tim,

Do you need to show only titles in vertical or tabs in vertical with title
displayed horizontally? You can do that with CSS itself as below.

div.tabpanel div.tab-row {
float: left;
background: #F2F9FC url(../images/tabs/bg.gif) repeat-x bottom;
line-height: normal;
/*-webkit-transform:rotate(270deg);*/ /* Use different element and values
for IE, Firefox etc...*/
}

div.tabpanel div.tab-row ul {
margin: 0;
padding: 10px 10px 0;
list-style: none;
}

div.tabpanel div.tab-row li {
background: url(../images/tabs/left.gif) no-repeat left top;
margin: 0;
padding: 0 0 0 9px;
}

Un-commenting transform part in first will yield vertical titles with
horizontal tabs.

-Mihir.





On Mon, Jun 9, 2014 at 10:34 AM, Tim Collins tcoll...@greatergood.com
wrote:

 I am rather new to wicket and am trying to do something that ought to be
 rather easy... I want to make the tabs I display show up vertically rather
 than horizontally.

 I am currently building a arraylist of tabs and then passing them to
 AjaxTabbedPanel, but as far as I can see there is no way to make the
 resulting tabs on a page show up down the left side of a page rather than
 across the top... Is there an easy way to do that?

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




Re: Newbie question : How do I display a tabbed list vertically rather than horizontally?

2014-06-09 Thread Tim Collins

Hmmm That did not work.

To be clear, this is what the code looks like :

package com.charityusa.janus.page.home;

import com.charityusa.config.AppConfig;
import com.charityusa.janus.panel.footer.Footer;
import com.charityusa.janus.panel.vendor.CoolibarUpload;
import com.charityusa.janus.panel.vendor.KettlerUpload;
import com.charityusa.janus.panel.vendor.OWPUpload;
import com.charityusa.janus.panel.vendor.PetEdgeUpload;
import com.charityusa.janus.panel.vendor.StriderUpload;
import com.charityusa.janus.panel.vendor.TimTestUpload;
import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.head.CssUrlReferenceHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;

import java.util.ArrayList;
import java.util.List;

/**
 * The home page class.
 */
public class HomePage extends WebPage {

// For serialization.
private static final long serialVersionUID = 1L;
@SpringBean
private AppConfig appConfig;

/**
 * Constructor with page parameters.
 *
 * @param pageParameters PageParameters
 */
public HomePage(final PageParameters pageParameters) {

super(pageParameters);
final ListITab tabs = new ArrayList();

tabs.add(new AbstractTab(new Model(Coolibar)) {
@Override
public Panel getPanel(final String panelId) {
return new CoolibarUpload(panelId);
}
});

tabs.add(new AbstractTab(new Model(Kettler)) {
@Override
public Panel getPanel(final String panelId) {
return new KettlerUpload(panelId);
}
});
add(new AjaxTabbedPanel(tabs, tabs));
add(new Footer(footer));
}

public void renderHead(final IHeaderResponse response) {
if (development.equals(this.appConfig.getType())) {
// dev watermark added into the header via a css include
response.render(new 
CssUrlReferenceHeaderItem(css/dev.css, null, null));

}
response.render(new CssUrlReferenceHeaderItem(css/janus.css, 
null, null));

}

}

!DOCTYPE html
html xmlns:wicket=http://www.w3.org/1999/xhtml;
head
titleJanus Inventory File Upload Service/title
link rel=shortcut icon href=images/favicon.ico 
type=image/vnd.microsoft.icon /

/head

body

div class=content
div class=pageTitleimg src=images/janus.png height=120 
width=120/br/Janus Inventory File Upload

Service
/div
ul style=list-style-type: none
lia href=network_auth_logoutSign Out/a/li
/ul

hr/
div wicket:id=tabs class=tabpanel[tabbed panel will be 
here]/div

br/
/div

div style=clear:both;/div

div class=footer
div wicket:id=footerOur Footer Here/div
/div
/body

/html

(I removed a couple tabs from the Java code since they are just linear 
additions to the code and two ought to be enough to get the pattern).


What that would show is a tab structure like this :
CoolibarKettler
[Stuff in tab that changes based on which tab is shown]

And I want a tab structure like this :
Coolibar   [Stuff in tab that changes based on which tab is shown]
Kettler


On 6/9/14, 8:47 AM, Mihir Chhaya wrote:

Tim,

Do you need to show only titles in vertical or tabs in vertical with title
displayed horizontally? You can do that with CSS itself as below.

div.tabpanel div.tab-row {
float: left;
background: #F2F9FC url(../images/tabs/bg.gif) repeat-x bottom;
line-height: normal;
/*-webkit-transform:rotate(270deg);*/ /* Use different element and values
for IE, Firefox etc...*/
}

div.tabpanel div.tab-row ul {
margin: 0;
padding: 10px 10px 0;
list-style: none;
}

div.tabpanel div.tab-row li {
background: url(../images/tabs/left.gif) no-repeat left top;
margin: 0;
padding: 0 0 0 9px;
}

Un-commenting transform part in first will yield vertical titles with
horizontal tabs.

-Mihir.





On Mon, Jun 9, 2014 at 10:34 AM, Tim Collins tcoll...@greatergood.com
wrote:


I am rather new to wicket and am trying to do something that ought to be
rather easy... I want to make the tabs I display show up vertically rather
than horizontally.

I am currently building a arraylist of tabs and then passing them to
AjaxTabbedPanel, but as far as I can see there is no way to make the
resulting tabs on a page show up down the left side of a page rather than
across the top... Is there an easy way to do that?

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






Re: Newbie question : How do I display a tabbed list vertically rather than horizontally?

2014-06-09 Thread Mihir Chhaya
With CSS I provided, were you able to view your tab controls position
changing any bit?

Though you don't need any kind of animation here; Translate might be
helpful. Something like below in 'div.tabpanel div.tab-row' (in CSS)?

Here is one for chrome: -webkit-transform: translate(Xpx,Ypx); You will
have to make sure the div element has display:block set.








On Mon, Jun 9, 2014 at 1:51 PM, Tim Collins tcoll...@greatergood.com
wrote:

 Hmmm That did not work.

 To be clear, this is what the code looks like :

 package com.charityusa.janus.page.home;

 import com.charityusa.config.AppConfig;
 import com.charityusa.janus.panel.footer.Footer;
 import com.charityusa.janus.panel.vendor.CoolibarUpload;
 import com.charityusa.janus.panel.vendor.KettlerUpload;
 import com.charityusa.janus.panel.vendor.OWPUpload;
 import com.charityusa.janus.panel.vendor.PetEdgeUpload;
 import com.charityusa.janus.panel.vendor.StriderUpload;
 import com.charityusa.janus.panel.vendor.TimTestUpload;
 import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.markup.head.CssUrlReferenceHeaderItem;
 import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.spring.injection.annot.SpringBean;

 import java.util.ArrayList;
 import java.util.List;

 /**
  * The home page class.
  */
 public class HomePage extends WebPage {

 // For serialization.
 private static final long serialVersionUID = 1L;
 @SpringBean
 private AppConfig appConfig;

 /**
  * Constructor with page parameters.
  *
  * @param pageParameters PageParameters
  */
 public HomePage(final PageParameters pageParameters) {

 super(pageParameters);
 final ListITab tabs = new ArrayList();

 tabs.add(new AbstractTab(new Model(Coolibar)) {
 @Override
 public Panel getPanel(final String panelId) {
 return new CoolibarUpload(panelId);
 }
 });

 tabs.add(new AbstractTab(new Model(Kettler)) {
 @Override
 public Panel getPanel(final String panelId) {
 return new KettlerUpload(panelId);
 }
 });
 add(new AjaxTabbedPanel(tabs, tabs));
 add(new Footer(footer));
 }

 public void renderHead(final IHeaderResponse response) {
 if (development.equals(this.appConfig.getType())) {
 // dev watermark added into the header via a css include
 response.render(new CssUrlReferenceHeaderItem(css/dev.css,
 null, null));
 }
 response.render(new CssUrlReferenceHeaderItem(css/janus.css,
 null, null));
 }

 }

 !DOCTYPE html
 html xmlns:wicket=http://www.w3.org/1999/xhtml;
 head
 titleJanus Inventory File Upload Service/title
 link rel=shortcut icon href=images/favicon.ico
 type=image/vnd.microsoft.icon /
 /head

 body

 div class=content
 div class=pageTitleimg src=images/janus.png height=120
 width=120/br/Janus Inventory File Upload
 Service
 /div
 ul style=list-style-type: none
 lia href=network_auth_logoutSign Out/a/li
 /ul

 hr/
 div wicket:id=tabs class=tabpanel[tabbed panel will be
 here]/div
 br/
 /div

 div style=clear:both;/div

 div class=footer
 div wicket:id=footerOur Footer Here/div
 /div
 /body

 /html

 (I removed a couple tabs from the Java code since they are just linear
 additions to the code and two ought to be enough to get the pattern).

 What that would show is a tab structure like this :
 CoolibarKettler
 [Stuff in tab that changes based on which tab is shown]

 And I want a tab structure like this :
 Coolibar   [Stuff in tab that changes based on which tab is shown]
 Kettler



 On 6/9/14, 8:47 AM, Mihir Chhaya wrote:

 Tim,

 Do you need to show only titles in vertical or tabs in vertical with title
 displayed horizontally? You can do that with CSS itself as below.

 div.tabpanel div.tab-row {
 float: left;
 background: #F2F9FC url(../images/tabs/bg.gif) repeat-x bottom;
 line-height: normal;
 /*-webkit-transform:rotate(270deg);*/ /* Use different element and values
 for IE, Firefox etc...*/
 }

 div.tabpanel div.tab-row ul {
 margin: 0;
 padding: 10px 10px 0;
 list-style: none;
 }

 div.tabpanel div.tab-row li {
 background: url(../images/tabs/left.gif) no-repeat left top;
 margin: 0;
 padding: 0 0 0 9px;
 }

 Un-commenting transform part in first will yield vertical titles with
 horizontal tabs.

 -Mihir.





 On Mon, Jun 9, 2014 at 10:34 AM, Tim Collins tcoll...@greatergood.com
 wrote:

  I am rather new to wicket and am trying to do something that ought to be
 

Re: Newbie question: startup wicketapplication with loginform

2013-12-02 Thread Paul Bors
See also the Wicket Guide:
http://wicket.apache.org/guide/guide/chapter3.html#chapter3_3


On Tue, Nov 26, 2013 at 10:36 AM, Seçil Aydın techlove...@gmail.com wrote:

 Hi,
 you can also view the below example code:


 http://www.wicket-library.com/wicket-examples/authentication1/wicket/bookmarkable/org.apache.wicket.examples.authentication1.SignIn?0



 -
 Wicket-Java
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Newbie-question-startup-wicketapplication-with-loginform-tp4662641p4662685.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: Newbie question: startup wicketapplication with loginform

2013-11-26 Thread Seçil Aydın
Hi,
you can also view the below example code:

http://www.wicket-library.com/wicket-examples/authentication1/wicket/bookmarkable/org.apache.wicket.examples.authentication1.SignIn?0



-
Wicket-Java
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Newbie-question-startup-wicketapplication-with-loginform-tp4662641p4662685.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



Newbie question: startup wicketapplication with loginform

2013-11-25 Thread gerritqf
Hello usermembers,

I have a question about the startup page for my wicket webapplication.
I made a Loginform class and a Loginform.html which i want to start my
application with.
The Loginform class extends Form.
Now in the application class it is not possible to point to the
Loginform.class like this:

public Class? extends Page getHomePage()
{
return LoginForm.class;
}

Because Form of cannot convert from ClassLoginForm to Class? extends
Page

How can i make this work?, or do i have to make a Loginform which extends
WebPage?

Thanks in advance.
Gerrit



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Newbie-question-startup-wicketapplication-with-loginform-tp4662641.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: Newbie question: startup wicketapplication with loginform

2013-11-25 Thread Martin Grigorov
Hi,

You should use the form in a page.
Create a proper page, add the form to it, and use that page as a home page.


On Mon, Nov 25, 2013 at 11:44 AM, gerritqf gerrit.wass...@qfactors.nlwrote:

 Hello usermembers,

 I have a question about the startup page for my wicket webapplication.
 I made a Loginform class and a Loginform.html which i want to start my
 application with.
 The Loginform class extends Form.
 Now in the application class it is not possible to point to the
 Loginform.class like this:

 public Class? extends Page getHomePage()
 {
 return LoginForm.class;
 }

 Because Form of cannot convert from ClassLoginForm to Class? extends
 Page

 How can i make this work?, or do i have to make a Loginform which extends
 WebPage?

 Thanks in advance.
 Gerrit



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Newbie-question-startup-wicketapplication-with-loginform-tp4662641.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: Newbie question: startup wicketapplication with loginform

2013-11-25 Thread Gerrit Wassink
Ok i will try.Thanks!


Martin Grigorov mgrigo...@apache.org , 25-11-2013 10:55:
Hi, 
 
You should use the form in a page. 
Create a proper page, add the form to it, and use that page as a home page. 
 
 
On Mon, Nov 25, 2013 at 11:44 AM, gerritqf gerrit.wass...@qfactors.nlwrote: 
 
 Hello usermembers, 
 
 I have a question about the startup page for my wicket webapplication. 
 I made a Loginform class and a Loginform.html which i want to start my 
 application with. 
 The Loginform class extends Form. 
 Now in the application class it is not possible to point to the 
 Loginform.class like this: 
 
 public Class? extends Page getHomePage() 
         { 
                 return LoginForm.class; 
         } 
 
 Because Form of cannot convert from ClassLoginForm to Class? extends 
 Page 
 
 How can i make this work?, or do i have to make a Loginform which extends 
 WebPage? 
 
 Thanks in advance. 
 Gerrit 
 
 
 
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Newbie-question-startup-wicketapplication-with-loginform-tp4662641.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 
 
 


Newbie Question

2011-01-31 Thread Fernando O.
Hi All, how are you?

   I'm new in this list, actually I'm new to wicket and I'm trying to learn
it. So far I hadn't found any issues and it worked great until I came across
this anoying problem, I have as part of my html:
I wanted to add to a page a button with a text, on click the button hits the
sever, performs some action and it should remove the button from the page
(make it not visible)

I added:
a class=button wicket:id=ajaxbuttonlabel
wicket:id=button-text/label/a

and then In the java Page I have

(this code is inside a populateItem method from a ListView)
.
.
.
protected void populateItem(final ListItemPoll
item) {
  final AjaxLinkTest button = new
AjaxLinkTest(ajaxbutton, item.getModel()) {

public void onClick(AjaxRequestTarget target) {
//Do whatever I have
to do
System.out.println(works?);
this.setEnabled(false); //Also tried removing the label component,
setVisible(false)
}

};
 Label label = new Label(button-text, AText);
label.setOutputMarkupId(true);
button.add(label);
button.setOutputMarkupId(true);//these are desparates attemps to solve it
item.setOutputMarkupId(true);
button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this works,
those that should be disabled do not show a button.
item.add(button);
  }
.
.


Any idea of what I'm doing wrong?

Thanks!


Re: Newbie Question

2011-01-31 Thread Igor Vaynberg
onclick (target) { setvisible(false); target.add(this); }

-igor

On Mon, Jan 31, 2011 at 4:46 PM, Fernando O. fot...@gmail.com wrote:
 Hi All, how are you?

   I'm new in this list, actually I'm new to wicket and I'm trying to learn
 it. So far I hadn't found any issues and it worked great until I came across
 this anoying problem, I have as part of my html:
 I wanted to add to a page a button with a text, on click the button hits the
 sever, performs some action and it should remove the button from the page
 (make it not visible)

 I added:
 a class=button wicket:id=ajaxbuttonlabel
 wicket:id=button-text/label/a

 and then In the java Page I have

 (this code is inside a populateItem method from a ListView)
 .
 .
 .
                            protected void populateItem(final ListItemPoll
 item) {
                                      final AjaxLinkTest button = new
 AjaxLinkTest(ajaxbutton, item.getModel()) {

 public void onClick(AjaxRequestTarget target) {
                                                        //Do whatever I have
 to do
 System.out.println(works?);
 this.setEnabled(false); //Also tried removing the label component,
 setVisible(false)
 }

 };
  Label label = new Label(button-text, AText);
 label.setOutputMarkupId(true);
 button.add(label);
 button.setOutputMarkupId(true);//these are desparates attemps to solve it
 item.setOutputMarkupId(true);
 button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this works,
 those that should be disabled do not show a button.
 item.add(button);
                          }
 .
 .


 Any idea of what I'm doing wrong?

 Thanks!


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



Re: Newbie Question

2011-01-31 Thread Fernando O.
Thanks!!! worked!

On Mon, Jan 31, 2011 at 9:50 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 onclick (target) { setvisible(false); target.add(this); }

 -igor

 On Mon, Jan 31, 2011 at 4:46 PM, Fernando O. fot...@gmail.com wrote:
  Hi All, how are you?
 
I'm new in this list, actually I'm new to wicket and I'm trying to
 learn
  it. So far I hadn't found any issues and it worked great until I came
 across
  this anoying problem, I have as part of my html:
  I wanted to add to a page a button with a text, on click the button hits
 the
  sever, performs some action and it should remove the button from the page
  (make it not visible)
 
  I added:
  a class=button wicket:id=ajaxbuttonlabel
  wicket:id=button-text/label/a
 
  and then In the java Page I have
 
  (this code is inside a populateItem method from a ListView)
  .
  .
  .
 protected void populateItem(final
 ListItemPoll
  item) {
   final AjaxLinkTest button = new
  AjaxLinkTest(ajaxbutton, item.getModel()) {
 
  public void onClick(AjaxRequestTarget target) {
 //Do whatever I
 have
  to do
  System.out.println(works?);
  this.setEnabled(false); //Also tried removing the label component,
  setVisible(false)
  }
 
  };
   Label label = new Label(button-text, AText);
  label.setOutputMarkupId(true);
  button.add(label);
  button.setOutputMarkupId(true);//these are desparates attemps to solve it
  item.setOutputMarkupId(true);
  button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this
 works,
  those that should be disabled do not show a button.
  item.add(button);
   }
  .
  .
 
 
  Any idea of what I'm doing wrong?
 
  Thanks!
 

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




Newbie question anti-patterns and wicket, constructor component building

2010-06-15 Thread Brown, Berlin [GCG-PFS]
I am sorry, am just getting used to Wicket but I notice a lot of use of
calling a lot of code in the constructor.  Does it really matter?  I
mention it because this kind of style makes it difficult to test code
because code in the constructor may fail and the object won't be
created.
 
Should I just create a method and call that method in the constructor?


Re: Newbie question anti-patterns and wicket, constructor component building

2010-06-15 Thread Jeremy Thomerson
On Tue, Jun 15, 2010 at 2:11 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 I am sorry, am just getting used to Wicket but I notice a lot of use of
 calling a lot of code in the constructor.  Does it really matter?  I
 mention it because this kind of style makes it difficult to test code
 because code in the constructor may fail and the object won't be
 created.

 Should I just create a method and call that method in the constructor?


The constructor is supposed to construct the object.  In Wicket, this also
(typically) means constructing the component hierarchy.  So, your
constructor should be doing things like add(new FooPanel(foo, new
SomeModel()));  It should NOT be doing things like:

ListFoo foos = SomeDao.loadAll();
new FooPanel(foo, foos);

That's the kind of code I see newbs putting in their constructor all the
time - and it should NOT be there.

-- 
Jeremy Thomerson
http://www.wickettraining.com


RE: Newbie question anti-patterns and wicket, constructor component building

2010-06-15 Thread Brown, Berlin [GCG-PFS]
 

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Tuesday, June 15, 2010 3:25 PM
To: users@wicket.apache.org
Subject: Re: Newbie question anti-patterns and wicket, constructor
component building

On Tue, Jun 15, 2010 at 2:11 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 I am sorry, am just getting used to Wicket but I notice a lot of use 
 of calling a lot of code in the constructor.  Does it really matter?  
 I mention it because this kind of style makes it difficult to test 
 code because code in the constructor may fail and the object won't be 
 created.

 Should I just create a method and call that method in the constructor?


The constructor is supposed to construct the object.  In Wicket, this
also
(typically) means constructing the component hierarchy.  So, your
constructor should be doing things like add(new FooPanel(foo, new
SomeModel()));  It should NOT be doing things like:

ListFoo foos = SomeDao.loadAll();
new FooPanel(foo, foos);

That's the kind of code I see newbs putting in their constructor all the
time - and it should NOT be there.

--
Jeremy Thomerson
http://www.wickettraining.com

-

Well, the second version uses constructer injection.  Some frameworks
prefer that approach.

But, I see your point.


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



Re: Newbie question anti-patterns and wicket, constructor component building

2010-06-15 Thread Jeremy Thomerson


 Well, the second version uses constructer injection.  Some frameworks
 prefer that approach.

 But, I see your point.


You should not be calling a service or dao directly in your constructor,
regardless of whether you are using dependency injection or not.  This is
bad.  That's what models are for.  Load data in models - not while
constructing an object.

-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: Newbie question anti-patterns and wicket, constructor component building

2010-06-15 Thread Jeremy Thomerson


 Well, the second version uses constructer injection.  Some frameworks
 prefer that approach.

 But, I see your point.


You should not be calling a service or dao directly in your constructor,
regardless of whether you are using dependency injection or not.  This is
bad.  That's what models are for.  Load data in models - not while
constructing an object.

-- 
Jeremy Thomerson
http://www.wickettraining.com


Newbie Question about populating form values

2010-04-14 Thread David Hamilton

I'm a new Wicket using trying to figure out how to populate a form's
initial value with data from a bean (that is in the session already).
I've actually got it working, but I don't think I'm doing the best way.
public final class EmployeeMain extends BasePage {
public EmployeeMain() {
super ();
Form employeeForm=new Form(employeeContactForm);
Contact contact=getEmployeeSession().getEmployee().getEmpInfo();
employeeForm.setModel(new CompoundPropertyModel(contact));
add(new TextField(firstName,new
Model(contact.getFirstName(;
add(new TextField(lastName));

}

My issue is with this line:
add(new TextField(firstName,new Model(contact.getFirstName(;
Should I have to set the model even though I'm binding the form to a
bean has this property?
What is the correct way to handle setting the initial form value from a
bean?

Thanks,

David


Keep it Green! To help protect the environment, please
only print this email if necessary. 
Printing email can cost more than you think. 
Learn more on our website: http://www.hermitagelighting.com/printing_email.php

The information transmitted in this email is 
intended solely for the individual or entity 
to which it is addressed and may contain 
confidential and/or privileged material. 
Any review, retransmission, dissemination or
other use of or taking action in reliance 
upon this information by persons or entities 
other than the intended recipient is prohibited. 
If you have received this email in error please 
immediately notify us by reply email to the sender. 
You must destroy the original material and its contents from any computer. 
 


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



Re: Newbie Question about populating form values

2010-04-14 Thread Nikita Tovstoles
If you're using a CPM there's no need to explicitly set models  for child
components. Also think about what you want to happen on page reload.
Generally I'd imagine you want current data, so set CPM's object on
Page.onBeforeRender():

public class EmployeeMain extends BasePage{

final private FormContact employeeForm;

public EmployeeMain()
{
//super(); //no need - call implied
employeeForm = new FormContact(employeeContactForm, new
CompoundpropertyModel(null)); //we'll set model object @ page render time
add(employeeForm);
employeeForm.add(new TextFieldString(firstName)); //assuming existence
of String contact.getFirstName()  method
employeeForm.add(new TextFieldString(lastName));
}

@Override
public void onBeforeRender()
{
employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo());
//get up-to-date Contact and set as CPM's object
super.onBeforeRender(); //have to call to allow page children to render
themselves
}

that's it. Note that if you set CPM's object in page constructor, then on
page refresh, Contact won't be updated (because constructor won't run, but
onBeforeRender() will).



On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton 
dhamil...@hermitagelighting.com wrote:


 I'm a new Wicket using trying to figure out how to populate a form's
 initial value with data from a bean (that is in the session already).
 I've actually got it working, but I don't think I'm doing the best way.
 public final class EmployeeMain extends BasePage {
public EmployeeMain() {
super ();
Form employeeForm=new Form(employeeContactForm);
Contact contact=getEmployeeSession().getEmployee().getEmpInfo();
 employeeForm.setModel(new CompoundPropertyModel(contact));
add(new TextField(firstName,new
 Model(contact.getFirstName(;
add(new TextField(lastName));

}

 My issue is with this line:
add(new TextField(firstName,new Model(contact.getFirstName(;
 Should I have to set the model even though I'm binding the form to a
 bean has this property?
 What is the correct way to handle setting the initial form value from a
 bean?

 Thanks,

 David

 
 Keep it Green! To help protect the environment, please
 only print this email if necessary.
 Printing email can cost more than you think.
 Learn more on our website:
 http://www.hermitagelighting.com/printing_email.php

 The information transmitted in this email is
 intended solely for the individual or entity
 to which it is addressed and may contain
 confidential and/or privileged material.
 Any review, retransmission, dissemination or
 other use of or taking action in reliance
 upon this information by persons or entities
 other than the intended recipient is prohibited.
 If you have received this email in error please
 immediately notify us by reply email to the sender.
 You must destroy the original material and its contents from any computer.
 


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




Re: Newbie Question about populating form values

2010-04-14 Thread James Carman
Why not use a LoadableDetachableModel instead of setting on onBeforeRender()?

On Wed, Apr 14, 2010 at 12:10 PM, Nikita Tovstoles
nikita.tovsto...@gmail.com wrote:
 If you're using a CPM there's no need to explicitly set models  for child
 components. Also think about what you want to happen on page reload.
 Generally I'd imagine you want current data, so set CPM's object on
 Page.onBeforeRender():

 public class EmployeeMain extends BasePage{

 final private FormContact employeeForm;

 public EmployeeMain()
 {
 //super(); //no need - call implied
 employeeForm = new FormContact(employeeContactForm, new
 CompoundpropertyModel(null)); //we'll set model object @ page render time
 add(employeeForm);
 employeeForm.add(new TextFieldString(firstName)); //assuming existence
 of String contact.getFirstName()  method
 employeeForm.add(new TextFieldString(lastName));
 }

 @Override
 public void onBeforeRender()
 {
 employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo());
 //get up-to-date Contact and set as CPM's object
 super.onBeforeRender(); //have to call to allow page children to render
 themselves
 }

 that's it. Note that if you set CPM's object in page constructor, then on
 page refresh, Contact won't be updated (because constructor won't run, but
 onBeforeRender() will).



 On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton 
 dhamil...@hermitagelighting.com wrote:


 I'm a new Wicket using trying to figure out how to populate a form's
 initial value with data from a bean (that is in the session already).
 I've actually got it working, but I don't think I'm doing the best way.
 public final class EmployeeMain extends BasePage {
    public EmployeeMain() {
        super ();
        Form employeeForm=new Form(employeeContactForm);
        Contact contact=getEmployeeSession().getEmployee().getEmpInfo();
 employeeForm.setModel(new CompoundPropertyModel(contact));
        add(new TextField(firstName,new
 Model(contact.getFirstName(;
        add(new TextField(lastName));

    }

 My issue is with this line:
    add(new TextField(firstName,new Model(contact.getFirstName(;
 Should I have to set the model even though I'm binding the form to a
 bean has this property?
 What is the correct way to handle setting the initial form value from a
 bean?

 Thanks,

 David

 
 Keep it Green! To help protect the environment, please
 only print this email if necessary.
 Printing email can cost more than you think.
 Learn more on our website:
 http://www.hermitagelighting.com/printing_email.php

 The information transmitted in this email is
 intended solely for the individual or entity
 to which it is addressed and may contain
 confidential and/or privileged material.
 Any review, retransmission, dissemination or
 other use of or taking action in reliance
 upon this information by persons or entities
 other than the intended recipient is prohibited.
 If you have received this email in error please
 immediately notify us by reply email to the sender.
 You must destroy the original material and its contents from any computer.
 


 -
 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



Re: Newbie Question about populating form values

2010-04-14 Thread Nikita Tovstoles
Yeah, guess you could do that too, but then you'd have to wrap one model
into another (since LDM does not do property matching like CPM) + you've to
extend LDM.

On Wed, Apr 14, 2010 at 9:24 AM, James Carman
jcar...@carmanconsulting.comwrote:

 Why not use a LoadableDetachableModel instead of setting on
 onBeforeRender()?

 On Wed, Apr 14, 2010 at 12:10 PM, Nikita Tovstoles
 nikita.tovsto...@gmail.com wrote:
  If you're using a CPM there's no need to explicitly set models  for child
  components. Also think about what you want to happen on page reload.
  Generally I'd imagine you want current data, so set CPM's object on
  Page.onBeforeRender():
 
  public class EmployeeMain extends BasePage{
 
  final private FormContact employeeForm;
 
  public EmployeeMain()
  {
  //super(); //no need - call implied
  employeeForm = new FormContact(employeeContactForm, new
  CompoundpropertyModel(null)); //we'll set model object @ page render time
  add(employeeForm);
  employeeForm.add(new TextFieldString(firstName)); //assuming
 existence
  of String contact.getFirstName()  method
  employeeForm.add(new TextFieldString(lastName));
  }
 
  @Override
  public void onBeforeRender()
  {
 
 employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo());
  //get up-to-date Contact and set as CPM's object
  super.onBeforeRender(); //have to call to allow page children to render
  themselves
  }
 
  that's it. Note that if you set CPM's object in page constructor, then on
  page refresh, Contact won't be updated (because constructor won't run,
 but
  onBeforeRender() will).
 
 
 
  On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton 
  dhamil...@hermitagelighting.com wrote:
 
 
  I'm a new Wicket using trying to figure out how to populate a form's
  initial value with data from a bean (that is in the session already).
  I've actually got it working, but I don't think I'm doing the best way.
  public final class EmployeeMain extends BasePage {
 public EmployeeMain() {
 super ();
 Form employeeForm=new Form(employeeContactForm);
 Contact contact=getEmployeeSession().getEmployee().getEmpInfo();
  employeeForm.setModel(new CompoundPropertyModel(contact));
 add(new TextField(firstName,new
  Model(contact.getFirstName(;
 add(new TextField(lastName));
 
 }
 
  My issue is with this line:
 add(new TextField(firstName,new Model(contact.getFirstName(;
  Should I have to set the model even though I'm binding the form to a
  bean has this property?
  What is the correct way to handle setting the initial form value from a
  bean?
 
  Thanks,
 
  David
 
  
  Keep it Green! To help protect the environment, please
  only print this email if necessary.
  Printing email can cost more than you think.
  Learn more on our website:
  http://www.hermitagelighting.com/printing_email.php
 
  The information transmitted in this email is
  intended solely for the individual or entity
  to which it is addressed and may contain
  confidential and/or privileged material.
  Any review, retransmission, dissemination or
  other use of or taking action in reliance
  upon this information by persons or entities
  other than the intended recipient is prohibited.
  If you have received this email in error please
  immediately notify us by reply email to the sender.
  You must destroy the original material and its contents from any
 computer.
  
 
 
  -
  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




Re: Newbie Question about populating form values

2010-04-14 Thread James Carman
That's one of the key concepts of Wicket models.

On Wed, Apr 14, 2010 at 2:04 PM, Nikita Tovstoles
nikita.tovsto...@gmail.com wrote:
 Yeah, guess you could do that too, but then you'd have to wrap one model
 into another (since LDM does not do property matching like CPM) + you've to
 extend LDM.

 On Wed, Apr 14, 2010 at 9:24 AM, James Carman
 jcar...@carmanconsulting.comwrote:

 Why not use a LoadableDetachableModel instead of setting on
 onBeforeRender()?

 On Wed, Apr 14, 2010 at 12:10 PM, Nikita Tovstoles
 nikita.tovsto...@gmail.com wrote:
  If you're using a CPM there's no need to explicitly set models  for child
  components. Also think about what you want to happen on page reload.
  Generally I'd imagine you want current data, so set CPM's object on
  Page.onBeforeRender():
 
  public class EmployeeMain extends BasePage{
 
  final private FormContact employeeForm;
 
  public EmployeeMain()
  {
  //super(); //no need - call implied
  employeeForm = new FormContact(employeeContactForm, new
  CompoundpropertyModel(null)); //we'll set model object @ page render time
  add(employeeForm);
  employeeForm.add(new TextFieldString(firstName)); //assuming
 existence
  of String contact.getFirstName()  method
  employeeForm.add(new TextFieldString(lastName));
  }
 
  @Override
  public void onBeforeRender()
  {
 
 employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo());
  //get up-to-date Contact and set as CPM's object
  super.onBeforeRender(); //have to call to allow page children to render
  themselves
  }
 
  that's it. Note that if you set CPM's object in page constructor, then on
  page refresh, Contact won't be updated (because constructor won't run,
 but
  onBeforeRender() will).
 
 
 
  On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton 
  dhamil...@hermitagelighting.com wrote:
 
 
  I'm a new Wicket using trying to figure out how to populate a form's
  initial value with data from a bean (that is in the session already).
  I've actually got it working, but I don't think I'm doing the best way.
  public final class EmployeeMain extends BasePage {
     public EmployeeMain() {
         super ();
         Form employeeForm=new Form(employeeContactForm);
         Contact contact=getEmployeeSession().getEmployee().getEmpInfo();
  employeeForm.setModel(new CompoundPropertyModel(contact));
         add(new TextField(firstName,new
  Model(contact.getFirstName(;
         add(new TextField(lastName));
 
     }
 
  My issue is with this line:
     add(new TextField(firstName,new Model(contact.getFirstName(;
  Should I have to set the model even though I'm binding the form to a
  bean has this property?
  What is the correct way to handle setting the initial form value from a
  bean?
 
  Thanks,
 
  David
 
  
  Keep it Green! To help protect the environment, please
  only print this email if necessary.
  Printing email can cost more than you think.
  Learn more on our website:
  http://www.hermitagelighting.com/printing_email.php
 
  The information transmitted in this email is
  intended solely for the individual or entity
  to which it is addressed and may contain
  confidential and/or privileged material.
  Any review, retransmission, dissemination or
  other use of or taking action in reliance
  upon this information by persons or entities
  other than the intended recipient is prohibited.
  If you have received this email in error please
  immediately notify us by reply email to the sender.
  You must destroy the original material and its contents from any
 computer.
  
 
 
  -
  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




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



Newbie question - HTML Labels and IDs

2009-09-30 Thread Phillip Sacre
Hi,

I've been using Wicket now for a couple of weeks and am getting on
pretty well with it. I still run into issues occasionally though, and
I'd like to know what the recommended way of solving this one is!

I have the following HTML snippet in a component:

tr
td
label for=modelModel/label
/td
td
select id=model wicket:id=filterModel/select
/td
/tr 

The problem is, the select component (DropDownChoice) has
setOutputMarkupId on it, so the ID on the label for= tag is not
correct.

Is there a recommended way of solving this problem? I think it would be
possible to bind the label tag to a component and then set the for
attribute on it manually, but that seems quite a long way round of doing
things.

Thanks for your help,
Phill 


This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of the email by you 
is prohibited.

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



Re: Newbie question - HTML Labels and IDs

2009-09-30 Thread Igor Vaynberg
see FormComponentLabel and SimpleFormComponentLabel

-igor

On Wed, Sep 30, 2009 at 8:34 AM, Phillip Sacre
psa...@clifford-thames.com wrote:
 Hi,

 I've been using Wicket now for a couple of weeks and am getting on
 pretty well with it. I still run into issues occasionally though, and
 I'd like to know what the recommended way of solving this one is!

 I have the following HTML snippet in a component:

 tr
        td
                label for=modelModel/label
        /td
        td
                select id=model wicket:id=filterModel/select
        /td
 /tr

 The problem is, the select component (DropDownChoice) has
 setOutputMarkupId on it, so the ID on the label for= tag is not
 correct.

 Is there a recommended way of solving this problem? I think it would be
 possible to bind the label tag to a component and then set the for
 attribute on it manually, but that seems quite a long way round of doing
 things.

 Thanks for your help,
 Phill


 This message is for the designated recipient only and may contain privileged 
 or confidential information. If you have received it in error, please notify 
 the sender immediately and delete the original. Any other use of the email by 
 you is prohibited.

 -
 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



RE: Newbie question - HTML Labels and IDs

2009-09-30 Thread Phillip Sacre
That's great, thanks - I knew there must be a simple way of doing it!

Phill

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: 30 September 2009 16:36
To: users@wicket.apache.org
Subject: Re: Newbie question - HTML Labels and IDs

see FormComponentLabel and SimpleFormComponentLabel

-igor


This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of the email by you 
is prohibited.

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



Re: Newbie question: fileupload AJAX progressbar ?

2009-08-20 Thread Robin Sander


Hi,

I'm using Firefox 3.5.2 and the strange thing is that the live demo  
works (progress bar shows progress)
and the same sources copied into my (wicket 1.4) app do not work  
properly. (no progress shown)


That's why I asked for further requirements on the server side. I'm  
using Glassfish V2, maybe the
container is messing things up? I will try it again with the new  
wicket 1.4.1 and then with Tomcat

as a container...


On 20.08.2009, at 03:58, Ashika Umanga Umagiliya wrote:


Hi Robin,

Are you using Safari , I saw in following threads that its not  
working properly with Safari .


http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24205091.html
http://www.nabble.com/UploadProgressBar-does-not-work-in-Safari-browser--to21571997.html#a24322943

Regards

Robin Sander wrote:


I've just copied the example upload page from  
http://www.wicket-library.com/wicket-examples/upload/single
into my application with the same result: upload works but the  
progess bar is NOT updated.


So, anything else needed besides overriding 'newWebRequest()' ?
I'm using wicket, wicket-datetime and wicket-extensions, all in  
version 1.4.0.

Do I need another wicket module? Maybe some kind of wicket-ajax ??



On 19.08.2009, at 12:25, Robin Sander wrote:



Hi,

are there any further requirements? I use Wicket 1.4.0, defined  
'newWebRequest' in
my Application class and though I do see a progress bar and the  
upload works perfectly

I do not see any progress! (the bar never changes)
Is the progress automatically reported by the server side or do I  
have to implement

something or add/modify some Javascript?

Robin.


On 19.08.2009, at 09:19, Stefan Lindner wrote:


Hi Ashika,

I pointed yopu tot he documentation because I was not sure if  
using UploadWebRequest has any side effects. Does not seem so.


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 09:10
An: users@wicket.apache.org
Betreff: Re: Newbie question: fileupload AJAX progressbar ?

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i  
refered
documentation at http://www.wicketframework.org/wicket- 
extensions/ which
is kind of updated (versoin 1.2) . I had to download  
documentation for

1.4 from the maven repository.

Thanks again.

Stefan Lindner wrote:

You need

   @Override
   protected WebRequest newWebRequest(HttpServletRequest  
servletRequest) {

   return new UploadWebRequest(servletRequest);
   }

In your Application's class. I think you should definitly read  
the APIdoc (see UploadProgressBar)!


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 07:17
An: users@wicket.apache.org
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

I am new to Wicket and I used 'UploadProgressBar' to create an  
AJAX
brogressbar for fileupload.(refered example at wicket- 
library.org )

But when uploading a file, eventhough progreebar showed,theres no
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {

 ///fileupload form
 private class FileUploadForm extends FormVoid{

 private FileUploadField fileuploadField;
 public FileUploadForm(String name){
 super(name);
 setMultiPart(true);
 add(fileuploadField=new FileUploadField(fileInput));
 setMaxSize(Bytes.gigabytes(4));

 }
 @Override
 protected void onSubmit() {
  final FileUpload upload =  
fileuploadField.getFileUpload();

 if (upload != null)
 {

 File newFile = new File(getUploadFolder(),
upload.getClientFileName());

 try
 {
  newFile.createNewFile();
 upload.writeTo(newFile);

 UploadPage.this.info(saved file:  +
upload.getClientFileName());
 }
 catch (Exception e)
 {
 throw new IllegalStateException(Unable to  
write

file);
 }
 }
 }

 }


 public UploadPage(final PageParameters parameters) {
 final FeedbackPanel uploadFfeedback=new
FeedbackPanel(uploadFeedback);
 add(uploadFfeedback);

 final FileUploadForm fileUploadForm=new
FileUploadForm(ajaxupload);
 fileUploadForm.add(new UploadProgressBar(progress,
fileUploadForm));
 add(fileUploadForm);
 }


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


}


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

RE: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Stefan Lindner
You need

@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
return new UploadWebRequest(servletRequest);
}

In your Application's class. I think you should definitly read the APIdoc (see 
UploadProgressBar)!

Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com] 
Gesendet: Mittwoch, 19. August 2009 07:17
An: users@wicket.apache.org
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

 I am new to Wicket and I used 'UploadProgressBar' to create an AJAX 
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no 
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {
   
///fileupload form
private class FileUploadForm extends FormVoid{

private FileUploadField fileuploadField;
public FileUploadForm(String name){
super(name);
setMultiPart(true);
add(fileuploadField=new FileUploadField(fileInput));
setMaxSize(Bytes.gigabytes(4));
   
}
@Override
protected void onSubmit() {
 final FileUpload upload = fileuploadField.getFileUpload();
if (upload != null)
{
 
File newFile = new File(getUploadFolder(), 
upload.getClientFileName());
   
try
{
 newFile.createNewFile();
upload.writeTo(newFile);

UploadPage.this.info(saved file:  + 
upload.getClientFileName());
}
catch (Exception e)
{
throw new IllegalStateException(Unable to write 
file);
}
}
}
   
}
  
   
public UploadPage(final PageParameters parameters) {  
final FeedbackPanel uploadFfeedback=new 
FeedbackPanel(uploadFeedback);
add(uploadFfeedback);
   
final FileUploadForm fileUploadForm=new 
FileUploadForm(ajaxupload);
fileUploadForm.add(new UploadProgressBar(progress, 
fileUploadForm));
add(fileUploadForm);
}
   
   
private Folder getUploadFolder(){
return 
((SVRWebApplication)Application.get()).getUploadFolder();   
}
   

}


-
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



RE: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Jing Ge (Besitec IT DEHAM)
Hi,

Add this in your application class SVRWebApplication:

@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
 return new UploadWebRequest(servletRequest);
}

Best regards!
Jing
-Original Message-
From: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com] 
Sent: Mittwoch, 19. August 2009 07:17
To: users@wicket.apache.org
Subject: Newbie question: fileupload AJAX progressbar ?

Greetings all,

 I am new to Wicket and I used 'UploadProgressBar' to create an AJAX 
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no 
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {
   
///fileupload form
private class FileUploadForm extends FormVoid{

private FileUploadField fileuploadField;
public FileUploadForm(String name){
super(name);
setMultiPart(true);
add(fileuploadField=new FileUploadField(fileInput));
setMaxSize(Bytes.gigabytes(4));
   
}
@Override
protected void onSubmit() {
 final FileUpload upload = fileuploadField.getFileUpload();
if (upload != null)
{
 
File newFile = new File(getUploadFolder(), 
upload.getClientFileName());
   
try
{
 newFile.createNewFile();
upload.writeTo(newFile);

UploadPage.this.info(saved file:  + 
upload.getClientFileName());
}
catch (Exception e)
{
throw new IllegalStateException(Unable to write

file);
}
}
}
   
}
  
   
public UploadPage(final PageParameters parameters) {  
final FeedbackPanel uploadFfeedback=new 
FeedbackPanel(uploadFeedback);
add(uploadFfeedback);
   
final FileUploadForm fileUploadForm=new 
FileUploadForm(ajaxupload);
fileUploadForm.add(new UploadProgressBar(progress, 
fileUploadForm));
add(fileUploadForm);
}
   
   
private Folder getUploadFolder(){
return 
((SVRWebApplication)Application.get()).getUploadFolder();   
}
   

}


-
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



Re: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Ashika Umanga Umagiliya

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i refered 
documentation at http://www.wicketframework.org/wicket-extensions/ which 
is kind of updated (versoin 1.2) . I had to download documentation for 
1.4 from the maven repository.


Thanks again.

Stefan Lindner wrote:

You need

@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
return new UploadWebRequest(servletRequest);
}

In your Application's class. I think you should definitly read the APIdoc (see 
UploadProgressBar)!

Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com] 
Gesendet: Mittwoch, 19. August 2009 07:17

An: users@wicket.apache.org
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

 I am new to Wicket and I used 'UploadProgressBar' to create an AJAX 
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no 
activity nor incrementation of the bar

I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {
   
///fileupload form

private class FileUploadForm extends FormVoid{

private FileUploadField fileuploadField;
public FileUploadForm(String name){
super(name);
setMultiPart(true);
add(fileuploadField=new FileUploadField(fileInput));
setMaxSize(Bytes.gigabytes(4));
   
}

@Override
protected void onSubmit() {
 final FileUpload upload = fileuploadField.getFileUpload();
if (upload != null)
{
 
File newFile = new File(getUploadFolder(), 
upload.getClientFileName());
   
try

{
 newFile.createNewFile();
upload.writeTo(newFile);

UploadPage.this.info(saved file:  + 
upload.getClientFileName());

}
catch (Exception e)
{
throw new IllegalStateException(Unable to write 
file);

}
}
}
   
}
  
   
public UploadPage(final PageParameters parameters) {  
final FeedbackPanel uploadFfeedback=new 
FeedbackPanel(uploadFeedback);

add(uploadFfeedback);
   
final FileUploadForm fileUploadForm=new 
FileUploadForm(ajaxupload);
fileUploadForm.add(new UploadProgressBar(progress, 
fileUploadForm));

add(fileUploadForm);
}
   
   
private Folder getUploadFolder(){
return 
((SVRWebApplication)Application.get()).getUploadFolder();   
}
   


}


-
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

  



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



RE: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Stefan Lindner
Hi Ashika,

I pointed yopu tot he documentation because I was not sure if using 
UploadWebRequest has any side effects. Does not seem so.

Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com] 
Gesendet: Mittwoch, 19. August 2009 09:10
An: users@wicket.apache.org
Betreff: Re: Newbie question: fileupload AJAX progressbar ?

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i refered 
documentation at http://www.wicketframework.org/wicket-extensions/ which 
is kind of updated (versoin 1.2) . I had to download documentation for 
1.4 from the maven repository.

Thanks again.

Stefan Lindner wrote:
 You need

   @Override
   protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
   return new UploadWebRequest(servletRequest);
   }

 In your Application's class. I think you should definitly read the APIdoc 
 (see UploadProgressBar)!

 Stefan

 -Ursprüngliche Nachricht-
 Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com] 
 Gesendet: Mittwoch, 19. August 2009 07:17
 An: users@wicket.apache.org
 Betreff: Newbie question: fileupload AJAX progressbar ?

 Greetings all,

  I am new to Wicket and I used 'UploadProgressBar' to create an AJAX 
 brogressbar for fileupload.(refered example at wicket-library.org )
 But when uploading a file, eventhough progreebar showed,theres no 
 activity nor incrementation of the bar
 I have posted my code, what could be the problem?

 Thanks in advance.




 public class UploadPage extends WebPage {

 ///fileupload form
 private class FileUploadForm extends FormVoid{

 private FileUploadField fileuploadField;
 public FileUploadForm(String name){
 super(name);
 setMultiPart(true);
 add(fileuploadField=new FileUploadField(fileInput));
 setMaxSize(Bytes.gigabytes(4));

 }
 @Override
 protected void onSubmit() {
  final FileUpload upload = fileuploadField.getFileUpload();
 if (upload != null)
 {
  
 File newFile = new File(getUploadFolder(), 
 upload.getClientFileName());

 try
 {
  newFile.createNewFile();
 upload.writeTo(newFile);

 UploadPage.this.info(saved file:  + 
 upload.getClientFileName());
 }
 catch (Exception e)
 {
 throw new IllegalStateException(Unable to write 
 file);
 }
 }
 }

 }
   

 public UploadPage(final PageParameters parameters) {  
 final FeedbackPanel uploadFfeedback=new 
 FeedbackPanel(uploadFeedback);
 add(uploadFfeedback);

 final FileUploadForm fileUploadForm=new 
 FileUploadForm(ajaxupload);
 fileUploadForm.add(new UploadProgressBar(progress, 
 fileUploadForm));
 add(fileUploadForm);
 }


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


 }


 -
 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

   


-
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



Re: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Robin Sander


I've just copied the example upload page from  
http://www.wicket-library.com/wicket-examples/upload/single
into my application with the same result: upload works but the progess  
bar is NOT updated.


So, anything else needed besides overriding 'newWebRequest()' ?
I'm using wicket, wicket-datetime and wicket-extensions, all in  
version 1.4.0.

Do I need another wicket module? Maybe some kind of wicket-ajax ??



On 19.08.2009, at 12:25, Robin Sander wrote:



Hi,

are there any further requirements? I use Wicket 1.4.0, defined  
'newWebRequest' in
my Application class and though I do see a progress bar and the  
upload works perfectly

I do not see any progress! (the bar never changes)
Is the progress automatically reported by the server side or do I  
have to implement

something or add/modify some Javascript?

Robin.


On 19.08.2009, at 09:19, Stefan Lindner wrote:


Hi Ashika,

I pointed yopu tot he documentation because I was not sure if using  
UploadWebRequest has any side effects. Does not seem so.


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 09:10
An: users@wicket.apache.org
Betreff: Re: Newbie question: fileupload AJAX progressbar ?

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i  
refered
documentation at http://www.wicketframework.org/wicket-extensions/  
which
is kind of updated (versoin 1.2) . I had to download documentation  
for

1.4 from the maven repository.

Thanks again.

Stefan Lindner wrote:

You need

@Override
	protected WebRequest newWebRequest(HttpServletRequest  
servletRequest) {

return new UploadWebRequest(servletRequest);
}

In your Application's class. I think you should definitly read the  
APIdoc (see UploadProgressBar)!


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 07:17
An: users@wicket.apache.org
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

I am new to Wicket and I used 'UploadProgressBar' to create an AJAX
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {

  ///fileupload form
  private class FileUploadForm extends FormVoid{

  private FileUploadField fileuploadField;
  public FileUploadForm(String name){
  super(name);
  setMultiPart(true);
  add(fileuploadField=new FileUploadField(fileInput));
  setMaxSize(Bytes.gigabytes(4));

  }
  @Override
  protected void onSubmit() {
   final FileUpload upload =  
fileuploadField.getFileUpload();

  if (upload != null)
  {

  File newFile = new File(getUploadFolder(),
upload.getClientFileName());

  try
  {
   newFile.createNewFile();
  upload.writeTo(newFile);

  UploadPage.this.info(saved file:  +
upload.getClientFileName());
  }
  catch (Exception e)
  {
  throw new IllegalStateException(Unable to  
write

file);
  }
  }
  }

  }


  public UploadPage(final PageParameters parameters) {
  final FeedbackPanel uploadFfeedback=new
FeedbackPanel(uploadFeedback);
  add(uploadFfeedback);

  final FileUploadForm fileUploadForm=new
FileUploadForm(ajaxupload);
  fileUploadForm.add(new UploadProgressBar(progress,
fileUploadForm));
  add(fileUploadForm);
  }


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


}


-
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





-
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



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

Re: Newbie question: fileupload AJAX progressbar ?

2009-08-19 Thread Ashika Umanga Umagiliya

Hi Robin,

Are you using Safari , I saw in following threads that its not working 
properly with Safari .


http://www.nabble.com/UploadProgressBar-in-firefox-and-ie6-tp24166616p24205091.html
http://www.nabble.com/UploadProgressBar-does-not-work-in-Safari-browser--to21571997.html#a24322943

Regards

Robin Sander wrote:


I've just copied the example upload page from  
http://www.wicket-library.com/wicket-examples/upload/single
into my application with the same result: upload works but the progess 
bar is NOT updated.


So, anything else needed besides overriding 'newWebRequest()' ?
I'm using wicket, wicket-datetime and wicket-extensions, all in 
version 1.4.0.

Do I need another wicket module? Maybe some kind of wicket-ajax ??



On 19.08.2009, at 12:25, Robin Sander wrote:



Hi,

are there any further requirements? I use Wicket 1.4.0, defined 
'newWebRequest' in
my Application class and though I do see a progress bar and the 
upload works perfectly

I do not see any progress! (the bar never changes)
Is the progress automatically reported by the server side or do I 
have to implement

something or add/modify some Javascript?

Robin.


On 19.08.2009, at 09:19, Stefan Lindner wrote:


Hi Ashika,

I pointed yopu tot he documentation because I was not sure if using 
UploadWebRequest has any side effects. Does not seem so.


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 09:10
An: users@wicket.apache.org
Betreff: Re: Newbie question: fileupload AJAX progressbar ?

Thanks Stefan,

That solved my problem.
Since UploadProgreeBar is a component of 'wicket-extensions', i refered
documentation at http://www.wicketframework.org/wicket-extensions/ 
which

is kind of updated (versoin 1.2) . I had to download documentation for
1.4 from the maven repository.

Thanks again.

Stefan Lindner wrote:

You need

@Override
protected WebRequest newWebRequest(HttpServletRequest 
servletRequest) {

return new UploadWebRequest(servletRequest);
}

In your Application's class. I think you should definitly read the 
APIdoc (see UploadProgressBar)!


Stefan

-Ursprüngliche Nachricht-
Von: Ashika Umanga Umagiliya [mailto:auma...@biggjapan.com]
Gesendet: Mittwoch, 19. August 2009 07:17
An: users@wicket.apache.org
Betreff: Newbie question: fileupload AJAX progressbar ?

Greetings all,

I am new to Wicket and I used 'UploadProgressBar' to create an AJAX
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no
activity nor incrementation of the bar
I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {

  ///fileupload form
  private class FileUploadForm extends FormVoid{

  private FileUploadField fileuploadField;
  public FileUploadForm(String name){
  super(name);
  setMultiPart(true);
  add(fileuploadField=new FileUploadField(fileInput));
  setMaxSize(Bytes.gigabytes(4));

  }
  @Override
  protected void onSubmit() {
   final FileUpload upload = fileuploadField.getFileUpload();
  if (upload != null)
  {

  File newFile = new File(getUploadFolder(),
upload.getClientFileName());

  try
  {
   newFile.createNewFile();
  upload.writeTo(newFile);

  UploadPage.this.info(saved file:  +
upload.getClientFileName());
  }
  catch (Exception e)
  {
  throw new IllegalStateException(Unable to write
file);
  }
  }
  }

  }


  public UploadPage(final PageParameters parameters) {
  final FeedbackPanel uploadFfeedback=new
FeedbackPanel(uploadFeedback);
  add(uploadFfeedback);

  final FileUploadForm fileUploadForm=new
FileUploadForm(ajaxupload);
  fileUploadForm.add(new UploadProgressBar(progress,
fileUploadForm));
  add(fileUploadForm);
  }


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


}


-
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





-
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

Newbie question: fileupload AJAX progressbar ?

2009-08-18 Thread Ashika Umanga Umagiliya

Greetings all,

I am new to Wicket and I used 'UploadProgressBar' to create an AJAX 
brogressbar for fileupload.(refered example at wicket-library.org )
But when uploading a file, eventhough progreebar showed,theres no 
activity nor incrementation of the bar

I have posted my code, what could be the problem?

Thanks in advance.




public class UploadPage extends WebPage {
  
   ///fileupload form

   private class FileUploadForm extends FormVoid{

   private FileUploadField fileuploadField;
   public FileUploadForm(String name){
   super(name);
   setMultiPart(true);
   add(fileuploadField=new FileUploadField(fileInput));
   setMaxSize(Bytes.gigabytes(4));
  
   }

   @Override
   protected void onSubmit() {
final FileUpload upload = fileuploadField.getFileUpload();
   if (upload != null)
   {

   File newFile = new File(getUploadFolder(), 
upload.getClientFileName());
  
   try

   {
newFile.createNewFile();
   upload.writeTo(newFile);

   UploadPage.this.info(saved file:  + 
upload.getClientFileName());

   }
   catch (Exception e)
   {
   throw new IllegalStateException(Unable to write 
file);

   }
   }
   }
  
   }
 
  
   public UploadPage(final PageParameters parameters) {  
   final FeedbackPanel uploadFfeedback=new 
FeedbackPanel(uploadFeedback);

   add(uploadFfeedback);
  
   final FileUploadForm fileUploadForm=new 
FileUploadForm(ajaxupload);
   fileUploadForm.add(new UploadProgressBar(progress, 
fileUploadForm));

   add(fileUploadForm);
   }
  
  
   private Folder getUploadFolder(){
   return 
((SVRWebApplication)Application.get()).getUploadFolder();   
   }
  


}


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



Fwd: NewBie question :Implementation of Collapsible Link

2009-03-31 Thread Ajayi Yinka
-- Forwarded message --
From: Ajayi Yinka iamstyaj...@googlemail.com
Date: Tue, Mar 31, 2009 at 9:01 AM
Subject: Re: NewBie question :Implementation of Collapsible Link
To: users@wicket.apache.org



Thanks so much.

I want a tree view (What I really want to implement is a collapsible list,
whereby a click on a link will display sublinks.)

I am afraid if you understand what I am trying to do now. I guess the
following html will give better insight.
ul
   liItem 1/li
   liItem 2/li
   liItem 3
ul
liItem 3.1/li
liItem 3.2
   ul
   liItem 3.2.1/li
   liItem 3.2.2/li
   liItem 3.2.3/li
  /ul
   /li
   liItem 3.3/li
   /ul
  /li
   liItem 4
  ul
  liItem 4.1/li
  liItem 4.2
  ul
  liItem 4.2.1/li
  liItem 4.2.2/li
  /ul
   /li
 /ul
 /li
liItem 5/li
   /ul

I will appreate your good indulgence concerning my request. Thanks

Reagard,
Yinka


On Tue, Mar 31, 2009 at 3:30 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 More details necessary.  An accordion panel or tree view?  Etc...

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Mar 30, 2009 at 3:19 AM, Ajayi Yinka iamstyaj...@googlemail.com
 wrote:

  I am trying to see if i can implement collapsible link in my page.
 
  i had tried to use Link Tree, but I was getting error which I could not
  even
  trace or decipher the cause.
 
  Please, can anyone give me insight on the best way to implement the
  collapsible link
 
  Thanks.
  Yinka
 



Re: NewBie question :Implementation of Collapsible Link

2009-03-31 Thread James Carman
Are you looking for a menu system?

On Tue, Mar 31, 2009 at 4:04 AM, Ajayi Yinka iamstyaj...@googlemail.com wrote:
 -- Forwarded message --
 From: Ajayi Yinka iamstyaj...@googlemail.com
 Date: Tue, Mar 31, 2009 at 9:01 AM
 Subject: Re: NewBie question :Implementation of Collapsible Link
 To: users@wicket.apache.org



 Thanks so much.

 I want a tree view (What I really want to implement is a collapsible list,
 whereby a click on a link will display sublinks.)

 I am afraid if you understand what I am trying to do now. I guess the
 following html will give better insight.
 ul
           liItem 1/li
           liItem 2/li
           liItem 3
                    ul
                    liItem 3.1/li
                    liItem 3.2
                               ul
                               liItem 3.2.1/li
                               liItem 3.2.2/li
                               liItem 3.2.3/li
                              /ul
                   /li
                   liItem 3.3/li
                   /ul
          /li
           liItem 4
                      ul
                      liItem 4.1/li
                      liItem 4.2
                                  ul
                                  liItem 4.2.1/li
                                  liItem 4.2.2/li
                                  /ul
                       /li
                     /ul
             /li
            liItem 5/li
       /ul

 I will appreate your good indulgence concerning my request. Thanks

 Reagard,
 Yinka


 On Tue, Mar 31, 2009 at 3:30 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 More details necessary.  An accordion panel or tree view?  Etc...

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Mar 30, 2009 at 3:19 AM, Ajayi Yinka iamstyaj...@googlemail.com
 wrote:

  I am trying to see if i can implement collapsible link in my page.
 
  i had tried to use Link Tree, but I was getting error which I could not
  even
  trace or decipher the cause.
 
  Please, can anyone give me insight on the best way to implement the
  collapsible link
 
  Thanks.
  Yinka
 



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



Re: NewBie question :Implementation of Collapsible Link

2009-03-31 Thread Ajayi Yinka
I think what I want to do is on this page
http://www.wicket-library.com/wicket-examples/ajax/tree/table/editable.1

Thanks for your indulgence.

On Tue, Mar 31, 2009 at 5:44 PM, James Carman
jcar...@carmanconsulting.comwrote:

 Are you looking for a menu system?

 On Tue, Mar 31, 2009 at 4:04 AM, Ajayi Yinka iamstyaj...@googlemail.com
 wrote:
  -- Forwarded message --
  From: Ajayi Yinka iamstyaj...@googlemail.com
  Date: Tue, Mar 31, 2009 at 9:01 AM
  Subject: Re: NewBie question :Implementation of Collapsible Link
  To: users@wicket.apache.org
 
 
 
  Thanks so much.
 
  I want a tree view (What I really want to implement is a collapsible
 list,
  whereby a click on a link will display sublinks.)
 
  I am afraid if you understand what I am trying to do now. I guess the
  following html will give better insight.
  ul
liItem 1/li
liItem 2/li
liItem 3
 ul
 liItem 3.1/li
 liItem 3.2
ul
liItem 3.2.1/li
liItem 3.2.2/li
liItem 3.2.3/li
   /ul
/li
liItem 3.3/li
/ul
   /li
liItem 4
   ul
   liItem 4.1/li
   liItem 4.2
   ul
   liItem 4.2.1/li
   liItem 4.2.2/li
   /ul
/li
  /ul
  /li
 liItem 5/li
/ul
 
  I will appreate your good indulgence concerning my request. Thanks
 
  Reagard,
  Yinka
 
 
  On Tue, Mar 31, 2009 at 3:30 AM, Jeremy Thomerson 
 jer...@wickettraining.com
  wrote:
 
  More details necessary.  An accordion panel or tree view?  Etc...
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Mon, Mar 30, 2009 at 3:19 AM, Ajayi Yinka 
 iamstyaj...@googlemail.com
  wrote:
 
   I am trying to see if i can implement collapsible link in my page.
  
   i had tried to use Link Tree, but I was getting error which I could
 not
   even
   trace or decipher the cause.
  
   Please, can anyone give me insight on the best way to implement the
   collapsible link
  
   Thanks.
   Yinka
  
 
 

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




NewBie question :Implementation of Collapsible Link

2009-03-30 Thread Ajayi Yinka
I am trying to see if i can implement collapsible link in my page.

i had tried to use Link Tree, but I was getting error which I could not even
trace or decipher the cause.

Please, can anyone give me insight on the best way to implement the
collapsible link

Thanks.
Yinka


Re: newbie question: HTTP 404 on the quickstart project

2009-03-25 Thread Martijn Dashorst
Pro Wicket has been written during Wicket 1.2 availability. Therefore
you should not expect everything to work directly. If you use the
wicket-quickstart download from Wicket 1.2 the example should match.

Instead of using this part from Pro Wicket, why don't you download the
free bonus chapter from Wicket in Action, and use that as your
starting point: it is up to date regarding Wicket 1.3, and has an
explanation for both ant and maven users.

You can download the bonus chapter (and 2 other free chapters) from
the official companion site to Wicket in Action:
http://wicketinaction.com/downloads/

Martijn

On Tue, Mar 24, 2009 at 9:57 PM, Chenini, Mohamed mchen...@geico.com wrote:
 OK! I guess I was mixing two examples scenarios:
 - One from the Wicket website (quickstart)
 - And the second from the Pro Wicket book, also (quickstart).

 I will work on it to make the example from the book works.

 Thanks for your feedback.

 Regards,
 Mohamed

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:44 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Because you're not using jetty-config.xml - look at Start.java - you are
 mounting the app on /

  WebAppContext bb = new WebAppContext();
               bb.setServer(server);
               bb.setContextPath(/);
               bb.setWar(src/main/webapp);

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:41 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 Why URL http://localhost:8081/quickstart

 Results on this error:

 HTTP ERROR: 404
 NOT_FOUND
 RequestURI=/QuickStart


 While jetty-config.xml has this entry:


 Call name=addWebApplication
    Arg/QuickStart/Arg
    Argsrc/webapp/Arg
 /Call

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:30 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Okay - you found it.  What's the question?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 
  Launching http://localhost:8081  produces this output:
 
  Wicket Quickstart Archetype Homepage
 
  If you see this message wicket is properly configured and running
 
 
 
  The jetty server is started and the console log shows this:
 
 
  INFO  - WebApplication             - [WicketApplication] Started
 Wicket
  version 1.4-rc2 in development mode
  
  *** WARNING: Wicket is running in DEVELOPMENT mode.              ***
  ***                               ^^^                    ***
  *** Do NOT deploy to your live server(s) without changing this.  ***
  *** See Application#getConfigurationType() for more information. ***
  
  INFO  - log                        - Started
  socketconnec...@0.0.0.0:8081
 
 
 
  The Start.java code is as follows:
 
 
  mport org.mortbay.jetty.Connector;
  import org.mortbay.jetty.Server;
  import org.mortbay.jetty.bio.SocketConnector;
  import org.mortbay.jetty.webapp.WebAppContext;
 
  public class Start {
 
         public static void main(String[] args) throws Exception {
                 Server server = new Server();
                 SocketConnector connector = new SocketConnector();
 
                 // Set some timeout options to make debugging easier.
                 connector.setMaxIdleTime(1000 * 60 * 60);
                 connector.setSoLingerTime(-1);
                 connector.setPort(8081);
                 server.setConnectors(new Connector[] { connector });
 
                 WebAppContext bb = new WebAppContext();
                 bb.setServer(server);
                 bb.setContextPath(/);
                 bb.setWar(src/main/webapp);
 
                 // START JMX SERVER
                 // MBeanServer mBeanServer =
  ManagementFactory.getPlatformMBeanServer();
                 // MBeanContainer mBeanContainer = new
  MBeanContainer(mBeanServer);
                 //
  server.getContainer().addEventListener(mBeanContainer);
                 // mBeanContainer.start();
 
                 server.addHandler(bb);
 
                 try {
                         System.out.println( STARTING EMBEDDED
 JETTY
  SERVER, PRESS ANY KEY TO STOP);
                         server.start();
                         System.in.read();
                         System.out.println( STOPPING EMBEDDED
 JETTY
  SERVER);
             // while (System.in.available() == 0) {
                         //   Thread.sleep(5000);
                         // }
                         server.stop();
                         server.join();
                 } catch (Exception e) {
                         e.printStackTrace();
                         System.exit(100

RE: newbie question: HTTP 404 on the quickstart project

2009-03-25 Thread Chenini, Mohamed
Thanks for this advice. I agree I should perhaps switch to Wicket in Action 
since I do have the entire book in addition to the chapter 15 bonus.

Regards,
Mohamed

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
Sent: Wednesday, March 25, 2009 9:29 AM
To: users@wicket.apache.org
Subject: Re: newbie question: HTTP 404 on the quickstart project

Pro Wicket has been written during Wicket 1.2 availability. Therefore
you should not expect everything to work directly. If you use the
wicket-quickstart download from Wicket 1.2 the example should match.

Instead of using this part from Pro Wicket, why don't you download the
free bonus chapter from Wicket in Action, and use that as your
starting point: it is up to date regarding Wicket 1.3, and has an
explanation for both ant and maven users.

You can download the bonus chapter (and 2 other free chapters) from
the official companion site to Wicket in Action:
http://wicketinaction.com/downloads/

Martijn

On Tue, Mar 24, 2009 at 9:57 PM, Chenini, Mohamed mchen...@geico.com wrote:
 OK! I guess I was mixing two examples scenarios:
 - One from the Wicket website (quickstart)
 - And the second from the Pro Wicket book, also (quickstart).

 I will work on it to make the example from the book works.

 Thanks for your feedback.

 Regards,
 Mohamed

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:44 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Because you're not using jetty-config.xml - look at Start.java - you are
 mounting the app on /

  WebAppContext bb = new WebAppContext();
               bb.setServer(server);
               bb.setContextPath(/);
               bb.setWar(src/main/webapp);

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:41 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 Why URL http://localhost:8081/quickstart

 Results on this error:

 HTTP ERROR: 404
 NOT_FOUND
 RequestURI=/QuickStart


 While jetty-config.xml has this entry:


 Call name=addWebApplication
    Arg/QuickStart/Arg
    Argsrc/webapp/Arg
 /Call

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:30 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Okay - you found it.  What's the question?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 
  Launching http://localhost:8081  produces this output:
 
  Wicket Quickstart Archetype Homepage
 
  If you see this message wicket is properly configured and running
 
 
 
  The jetty server is started and the console log shows this:
 
 
  INFO  - WebApplication             - [WicketApplication] Started
 Wicket
  version 1.4-rc2 in development mode
  
  *** WARNING: Wicket is running in DEVELOPMENT mode.              ***
  ***                               ^^^                    ***
  *** Do NOT deploy to your live server(s) without changing this.  ***
  *** See Application#getConfigurationType() for more information. ***
  
  INFO  - log                        - Started
  socketconnec...@0.0.0.0:8081
 
 
 
  The Start.java code is as follows:
 
 
  mport org.mortbay.jetty.Connector;
  import org.mortbay.jetty.Server;
  import org.mortbay.jetty.bio.SocketConnector;
  import org.mortbay.jetty.webapp.WebAppContext;
 
  public class Start {
 
         public static void main(String[] args) throws Exception {
                 Server server = new Server();
                 SocketConnector connector = new SocketConnector();
 
                 // Set some timeout options to make debugging easier.
                 connector.setMaxIdleTime(1000 * 60 * 60);
                 connector.setSoLingerTime(-1);
                 connector.setPort(8081);
                 server.setConnectors(new Connector[] { connector });
 
                 WebAppContext bb = new WebAppContext();
                 bb.setServer(server);
                 bb.setContextPath(/);
                 bb.setWar(src/main/webapp);
 
                 // START JMX SERVER
                 // MBeanServer mBeanServer =
  ManagementFactory.getPlatformMBeanServer();
                 // MBeanContainer mBeanContainer = new
  MBeanContainer(mBeanServer);
                 //
  server.getContainer().addEventListener(mBeanContainer);
                 // mBeanContainer.start();
 
                 server.addHandler(bb);
 
                 try {
                         System.out.println( STARTING EMBEDDED
 JETTY
  SERVER, PRESS ANY KEY TO STOP);
                         server.start();
                         System.in.read

RE: newbie question: HTTP 404 on the quickstart project

2009-03-25 Thread Chenini, Mohamed
Hi,

Can you, please, be more explicit when you said  Because you're not
using jetty-config.xml 

I changed   bb.setContextPath(/); to bb.setContextPath(/QuickStart);

And the result is the same.

But I do not see how can I refer to the jetty-config.xml in the
Start.java file.

Regards.
Mohamed


-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Tuesday, March 24, 2009 4:44 PM
To: users@wicket.apache.org
Subject: Re: newbie question: HTTP 404 on the quickstart project

Because you're not using jetty-config.xml - look at Start.java - you are
mounting the app on /

 WebAppContext bb = new WebAppContext();
   bb.setServer(server);
   bb.setContextPath(/);
   bb.setWar(src/main/webapp);

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:41 PM, Chenini, Mohamed
mchen...@geico.comwrote:

 Why URL http://localhost:8081/quickstart

 Results on this error:

 HTTP ERROR: 404
 NOT_FOUND
 RequestURI=/QuickStart


 While jetty-config.xml has this entry:


 Call name=addWebApplication
Arg/QuickStart/Arg
Argsrc/webapp/Arg
 /Call

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:30 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Okay - you found it.  What's the question?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 
  Launching http://localhost:8081  produces this output:
 
  Wicket Quickstart Archetype Homepage
 
  If you see this message wicket is properly configured and running
 
 
 
  The jetty server is started and the console log shows this:
 
 
  INFO  - WebApplication - [WicketApplication] Started
 Wicket
  version 1.4-rc2 in development mode
  
  *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
  ***   ^^^***
  *** Do NOT deploy to your live server(s) without changing this.  ***
  *** See Application#getConfigurationType() for more information. ***
  
  INFO  - log- Started
  socketconnec...@0.0.0.0:8081
 
 
 
  The Start.java code is as follows:
 
 
  mport org.mortbay.jetty.Connector;
  import org.mortbay.jetty.Server;
  import org.mortbay.jetty.bio.SocketConnector;
  import org.mortbay.jetty.webapp.WebAppContext;
 
  public class Start {
 
 public static void main(String[] args) throws Exception {
 Server server = new Server();
 SocketConnector connector = new SocketConnector();
 
 // Set some timeout options to make debugging easier.
 connector.setMaxIdleTime(1000 * 60 * 60);
 connector.setSoLingerTime(-1);
 connector.setPort(8081);
 server.setConnectors(new Connector[] { connector });
 
 WebAppContext bb = new WebAppContext();
 bb.setServer(server);
 bb.setContextPath(/);
 bb.setWar(src/main/webapp);
 
 // START JMX SERVER
 // MBeanServer mBeanServer =
  ManagementFactory.getPlatformMBeanServer();
 // MBeanContainer mBeanContainer = new
  MBeanContainer(mBeanServer);
 //
  server.getContainer().addEventListener(mBeanContainer);
 // mBeanContainer.start();
 
 server.addHandler(bb);
 
 try {
 System.out.println( STARTING EMBEDDED
JETTY
  SERVER, PRESS ANY KEY TO STOP);
 server.start();
 System.in.read();
 System.out.println( STOPPING EMBEDDED
JETTY
  SERVER);
 // while (System.in.available() == 0) {
 //   Thread.sleep(5000);
 // }
 server.stop();
 server.join();
 } catch (Exception e) {
 e.printStackTrace();
 System.exit(100);
  }
 }
  }
 
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Tuesday, March 24, 2009 4:23 PM
  To: users@wicket.apache.org
  Subject: Re: newbie question: HTTP 404 on the quickstart project
 
  Try http://localhost:8080 and http://localhost:8081
 
  The answer really will be in Start.java - see what port it is on and
  where
  the app is mounted.  Then make that into a URL.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Mar 24, 2009 at 3:19 PM, Chenini, Mohamed
  mchen...@geico.comwrote:
 
   I tried http://localhost:8081/quickstart
  
   And the content of web.xml

Re: newbie question: HTTP 404 on the quickstart project

2009-03-25 Thread Jeremy Thomerson
Why do you so badly want it to be on /QuickStart?  It was working for you
on / - now start learning Wicket with it - that was the intention of the
quickstart.

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Mar 25, 2009 at 4:01 PM, Chenini, Mohamed mchen...@geico.comwrote:

 Hi,

 Can you, please, be more explicit when you said  Because you're not
 using jetty-config.xml 

 I changed   bb.setContextPath(/); to bb.setContextPath(/QuickStart);

 And the result is the same.

 But I do not see how can I refer to the jetty-config.xml in the
 Start.java file.

 Regards.
 Mohamed


 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:44 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Because you're not using jetty-config.xml - look at Start.java - you are
 mounting the app on /

  WebAppContext bb = new WebAppContext();
   bb.setServer(server);
   bb.setContextPath(/);
   bb.setWar(src/main/webapp);

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:41 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

  Why URL http://localhost:8081/quickstart
 
  Results on this error:
 
  HTTP ERROR: 404
  NOT_FOUND
  RequestURI=/QuickStart
 
 
  While jetty-config.xml has this entry:
 
 
  Call name=addWebApplication
 Arg/QuickStart/Arg
 Argsrc/webapp/Arg
  /Call
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Tuesday, March 24, 2009 4:30 PM
  To: users@wicket.apache.org
  Subject: Re: newbie question: HTTP 404 on the quickstart project
 
  Okay - you found it.  What's the question?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
  mchen...@geico.comwrote:
 
  
   Launching http://localhost:8081  produces this output:
  
   Wicket Quickstart Archetype Homepage
  
   If you see this message wicket is properly configured and running
  
  
  
   The jetty server is started and the console log shows this:
  
  
   INFO  - WebApplication - [WicketApplication] Started
  Wicket
   version 1.4-rc2 in development mode
   
   *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
   ***   ^^^***
   *** Do NOT deploy to your live server(s) without changing this.  ***
   *** See Application#getConfigurationType() for more information. ***
   
   INFO  - log- Started
   socketconnec...@0.0.0.0:8081
  
  
  
   The Start.java code is as follows:
  
  
   mport org.mortbay.jetty.Connector;
   import org.mortbay.jetty.Server;
   import org.mortbay.jetty.bio.SocketConnector;
   import org.mortbay.jetty.webapp.WebAppContext;
  
   public class Start {
  
  public static void main(String[] args) throws Exception {
  Server server = new Server();
  SocketConnector connector = new SocketConnector();
  
  // Set some timeout options to make debugging easier.
  connector.setMaxIdleTime(1000 * 60 * 60);
  connector.setSoLingerTime(-1);
  connector.setPort(8081);
  server.setConnectors(new Connector[] { connector });
  
  WebAppContext bb = new WebAppContext();
  bb.setServer(server);
  bb.setContextPath(/);
  bb.setWar(src/main/webapp);
  
  // START JMX SERVER
  // MBeanServer mBeanServer =
   ManagementFactory.getPlatformMBeanServer();
  // MBeanContainer mBeanContainer = new
   MBeanContainer(mBeanServer);
  //
   server.getContainer().addEventListener(mBeanContainer);
  // mBeanContainer.start();
  
  server.addHandler(bb);
  
  try {
  System.out.println( STARTING EMBEDDED
 JETTY
   SERVER, PRESS ANY KEY TO STOP);
  server.start();
  System.in.read();
  System.out.println( STOPPING EMBEDDED
 JETTY
   SERVER);
  // while (System.in.available() == 0) {
  //   Thread.sleep(5000);
  // }
  server.stop();
  server.join();
  } catch (Exception e) {
  e.printStackTrace();
  System.exit(100);
   }
  }
   }
  
  
   -Original Message-
   From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
   Sent: Tuesday, March 24, 2009 4:23 PM
   To: users@wicket.apache.org
   Subject: Re: newbie question: HTTP 404

Re: newbie question: HTTP 404 on the quickstart project

2009-03-24 Thread Jeremy Thomerson
Have you tried going to http://localhost:8081/quickstart ? or simply
http://localhost:8081 ?

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:09 PM, Chenini, Mohamed mchen...@geico.comwrote:

 Hi,

 I setup the quickstart project using the imbedded jetty server and
 started the jetty server from inside Eclipse (Right-click on
 src/main/java and then click  on Run as Java Application

 But when I enter on the browser (IE) this URL:
 http://localhost:8081/QuickStart

 I got this error:


 HTTP ERROR: 404
 NOT_FOUND
 RequestURI=/QuickStart
 I can send pieces of the code I am using if necessary to help determine
 what is wrong.





 Thanks,
 Mohamed
 
 This email/fax message is for the sole use of the intended
 recipient(s) and may contain confidential and privileged information.
 Any unauthorized review, use, disclosure or distribution of this
 email/fax is prohibited. If you are not the intended recipient, please
 destroy all paper and electronic copies of the original message.



RE: newbie question: HTTP 404 on the quickstart project

2009-03-24 Thread Chenini, Mohamed

Launching http://localhost:8081  produces this output:

Wicket Quickstart Archetype Homepage 

If you see this message wicket is properly configured and running



The jetty server is started and the console log shows this:


INFO  - WebApplication - [WicketApplication] Started Wicket
version 1.4-rc2 in development mode

*** WARNING: Wicket is running in DEVELOPMENT mode.  ***
***   ^^^***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***

INFO  - log- Started
socketconnec...@0.0.0.0:8081



The Start.java code is as follows:


mport org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
import org.mortbay.jetty.webapp.WebAppContext;

public class Start {

public static void main(String[] args) throws Exception {
Server server = new Server();
SocketConnector connector = new SocketConnector();

// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8081);
server.setConnectors(new Connector[] { connector });

WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath(/);
bb.setWar(src/main/webapp);

// START JMX SERVER
// MBeanServer mBeanServer =
ManagementFactory.getPlatformMBeanServer();
// MBeanContainer mBeanContainer = new
MBeanContainer(mBeanServer);
//
server.getContainer().addEventListener(mBeanContainer);
// mBeanContainer.start();

server.addHandler(bb);

try {
System.out.println( STARTING EMBEDDED JETTY
SERVER, PRESS ANY KEY TO STOP);
server.start();
System.in.read();
System.out.println( STOPPING EMBEDDED JETTY
SERVER); 
// while (System.in.available() == 0) {
//   Thread.sleep(5000);
// }
server.stop();
server.join();
} catch (Exception e) {
e.printStackTrace();
System.exit(100);
}
}
}


-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Tuesday, March 24, 2009 4:23 PM
To: users@wicket.apache.org
Subject: Re: newbie question: HTTP 404 on the quickstart project

Try http://localhost:8080 and http://localhost:8081

The answer really will be in Start.java - see what port it is on and
where
the app is mounted.  Then make that into a URL.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:19 PM, Chenini, Mohamed
mchen...@geico.comwrote:

 I tried http://localhost:8081/quickstart

 And the content of web.xml is:


 filter
filter-namewicket.QuickStart/filter-name


filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
 
init-param
param-nameapplicationClassName/param-name

 param-valuecom.mycompany.app.WicketApplication/param-value
/init-param
 /filter

 filter-mapping
  filter-namewicket.QuickStart/filter-name
url-pattern/*/url-pattern
 /filter-mapping


 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:17 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Have you tried going to http://localhost:8081/quickstart ? or simply
 http://localhost:8081 ?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:09 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

  Hi,
 
  I setup the quickstart project using the imbedded jetty server and
  started the jetty server from inside Eclipse (Right-click on
  src/main/java and then click  on Run as Java Application
 
  But when I enter on the browser (IE) this URL:
  http://localhost:8081/QuickStart
 
  I got this error:
 
 
  HTTP ERROR: 404
  NOT_FOUND
  RequestURI=/QuickStart
  I can send pieces of the code I am using if necessary to help
 determine
  what is wrong.
 
 
 
 
 
  Thanks,
  Mohamed
  
  This email/fax message is for the sole use of the intended
  recipient(s) and may contain confidential and privileged
information.
  Any unauthorized review, use, disclosure or distribution of this
  email/fax is prohibited. If you are not the intended recipient

Re: newbie question: HTTP 404 on the quickstart project

2009-03-24 Thread Jeremy Thomerson
Okay - you found it.  What's the question?

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed mchen...@geico.comwrote:


 Launching http://localhost:8081  produces this output:

 Wicket Quickstart Archetype Homepage

 If you see this message wicket is properly configured and running



 The jetty server is started and the console log shows this:


 INFO  - WebApplication - [WicketApplication] Started Wicket
 version 1.4-rc2 in development mode
 
 *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
 ***   ^^^***
 *** Do NOT deploy to your live server(s) without changing this.  ***
 *** See Application#getConfigurationType() for more information. ***
 
 INFO  - log- Started
 socketconnec...@0.0.0.0:8081



 The Start.java code is as follows:


 mport org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.bio.SocketConnector;
 import org.mortbay.jetty.webapp.WebAppContext;

 public class Start {

public static void main(String[] args) throws Exception {
Server server = new Server();
SocketConnector connector = new SocketConnector();

// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8081);
server.setConnectors(new Connector[] { connector });

WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath(/);
bb.setWar(src/main/webapp);

// START JMX SERVER
// MBeanServer mBeanServer =
 ManagementFactory.getPlatformMBeanServer();
// MBeanContainer mBeanContainer = new
 MBeanContainer(mBeanServer);
//
 server.getContainer().addEventListener(mBeanContainer);
// mBeanContainer.start();

server.addHandler(bb);

try {
System.out.println( STARTING EMBEDDED JETTY
 SERVER, PRESS ANY KEY TO STOP);
server.start();
System.in.read();
System.out.println( STOPPING EMBEDDED JETTY
 SERVER);
// while (System.in.available() == 0) {
//   Thread.sleep(5000);
// }
server.stop();
server.join();
} catch (Exception e) {
e.printStackTrace();
System.exit(100);
 }
}
 }


 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:23 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Try http://localhost:8080 and http://localhost:8081

 The answer really will be in Start.java - see what port it is on and
 where
 the app is mounted.  Then make that into a URL.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:19 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

  I tried http://localhost:8081/quickstart
 
  And the content of web.xml is:
 
 
  filter
 filter-namewicket.QuickStart/filter-name
 
 
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
  
 init-param
 param-nameapplicationClassName/param-name
 
  param-valuecom.mycompany.app.WicketApplication/param-value
 /init-param
  /filter
 
  filter-mapping
   filter-namewicket.QuickStart/filter-name
 url-pattern/*/url-pattern
  /filter-mapping
 
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Tuesday, March 24, 2009 4:17 PM
  To: users@wicket.apache.org
  Subject: Re: newbie question: HTTP 404 on the quickstart project
 
  Have you tried going to http://localhost:8081/quickstart ? or simply
  http://localhost:8081 ?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Mar 24, 2009 at 3:09 PM, Chenini, Mohamed
  mchen...@geico.comwrote:
 
   Hi,
  
   I setup the quickstart project using the imbedded jetty server and
   started the jetty server from inside Eclipse (Right-click on
   src/main/java and then click  on Run as Java Application
  
   But when I enter on the browser (IE) this URL:
   http://localhost:8081/QuickStart
  
   I got this error:
  
  
   HTTP ERROR: 404
   NOT_FOUND
   RequestURI=/QuickStart
   I can send pieces of the code I am using if necessary to help
  determine
   what is wrong.
  
  
  
  
  
   Thanks,
   Mohamed
   
   This email/fax message

RE: newbie question: HTTP 404 on the quickstart project

2009-03-24 Thread Chenini, Mohamed
Why URL http://localhost:8081/quickstart

Results on this error:

HTTP ERROR: 404
NOT_FOUND
RequestURI=/QuickStart


While jetty-config.xml has this entry:


Call name=addWebApplication
Arg/QuickStart/Arg
Argsrc/webapp/Arg
/Call

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Tuesday, March 24, 2009 4:30 PM
To: users@wicket.apache.org
Subject: Re: newbie question: HTTP 404 on the quickstart project

Okay - you found it.  What's the question?

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
mchen...@geico.comwrote:


 Launching http://localhost:8081  produces this output:

 Wicket Quickstart Archetype Homepage

 If you see this message wicket is properly configured and running



 The jetty server is started and the console log shows this:


 INFO  - WebApplication - [WicketApplication] Started
Wicket
 version 1.4-rc2 in development mode
 
 *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
 ***   ^^^***
 *** Do NOT deploy to your live server(s) without changing this.  ***
 *** See Application#getConfigurationType() for more information. ***
 
 INFO  - log- Started
 socketconnec...@0.0.0.0:8081



 The Start.java code is as follows:


 mport org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.bio.SocketConnector;
 import org.mortbay.jetty.webapp.WebAppContext;

 public class Start {

public static void main(String[] args) throws Exception {
Server server = new Server();
SocketConnector connector = new SocketConnector();

// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8081);
server.setConnectors(new Connector[] { connector });

WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath(/);
bb.setWar(src/main/webapp);

// START JMX SERVER
// MBeanServer mBeanServer =
 ManagementFactory.getPlatformMBeanServer();
// MBeanContainer mBeanContainer = new
 MBeanContainer(mBeanServer);
//
 server.getContainer().addEventListener(mBeanContainer);
// mBeanContainer.start();

server.addHandler(bb);

try {
System.out.println( STARTING EMBEDDED JETTY
 SERVER, PRESS ANY KEY TO STOP);
server.start();
System.in.read();
System.out.println( STOPPING EMBEDDED JETTY
 SERVER);
// while (System.in.available() == 0) {
//   Thread.sleep(5000);
// }
server.stop();
server.join();
} catch (Exception e) {
e.printStackTrace();
System.exit(100);
 }
}
 }


 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:23 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Try http://localhost:8080 and http://localhost:8081

 The answer really will be in Start.java - see what port it is on and
 where
 the app is mounted.  Then make that into a URL.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:19 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

  I tried http://localhost:8081/quickstart
 
  And the content of web.xml is:
 
 
  filter
 filter-namewicket.QuickStart/filter-name
 
 

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
  
 init-param
 param-nameapplicationClassName/param-name
 
  param-valuecom.mycompany.app.WicketApplication/param-value
 /init-param
  /filter
 
  filter-mapping
   filter-namewicket.QuickStart/filter-name
 url-pattern/*/url-pattern
  /filter-mapping
 
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Tuesday, March 24, 2009 4:17 PM
  To: users@wicket.apache.org
  Subject: Re: newbie question: HTTP 404 on the quickstart project
 
  Have you tried going to http://localhost:8081/quickstart ? or simply
  http://localhost:8081 ?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Mar 24, 2009 at 3:09 PM, Chenini, Mohamed
  mchen...@geico.comwrote:
 
   Hi,
  
   I setup the quickstart project using the imbedded jetty server
and
   started the jetty server from

Re: newbie question: HTTP 404 on the quickstart project

2009-03-24 Thread Jeremy Thomerson
Because you're not using jetty-config.xml - look at Start.java - you are
mounting the app on /

 WebAppContext bb = new WebAppContext();
   bb.setServer(server);
   bb.setContextPath(/);
   bb.setWar(src/main/webapp);

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Mar 24, 2009 at 3:41 PM, Chenini, Mohamed mchen...@geico.comwrote:

 Why URL http://localhost:8081/quickstart

 Results on this error:

 HTTP ERROR: 404
 NOT_FOUND
 RequestURI=/QuickStart


 While jetty-config.xml has this entry:


 Call name=addWebApplication
Arg/QuickStart/Arg
Argsrc/webapp/Arg
 /Call

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Tuesday, March 24, 2009 4:30 PM
 To: users@wicket.apache.org
 Subject: Re: newbie question: HTTP 404 on the quickstart project

 Okay - you found it.  What's the question?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Mar 24, 2009 at 3:28 PM, Chenini, Mohamed
 mchen...@geico.comwrote:

 
  Launching http://localhost:8081  produces this output:
 
  Wicket Quickstart Archetype Homepage
 
  If you see this message wicket is properly configured and running
 
 
 
  The jetty server is started and the console log shows this:
 
 
  INFO  - WebApplication - [WicketApplication] Started
 Wicket
  version 1.4-rc2 in development mode
  
  *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
  ***   ^^^***
  *** Do NOT deploy to your live server(s) without changing this.  ***
  *** See Application#getConfigurationType() for more information. ***
  
  INFO  - log- Started
  socketconnec...@0.0.0.0:8081
 
 
 
  The Start.java code is as follows:
 
 
  mport org.mortbay.jetty.Connector;
  import org.mortbay.jetty.Server;
  import org.mortbay.jetty.bio.SocketConnector;
  import org.mortbay.jetty.webapp.WebAppContext;
 
  public class Start {
 
 public static void main(String[] args) throws Exception {
 Server server = new Server();
 SocketConnector connector = new SocketConnector();
 
 // Set some timeout options to make debugging easier.
 connector.setMaxIdleTime(1000 * 60 * 60);
 connector.setSoLingerTime(-1);
 connector.setPort(8081);
 server.setConnectors(new Connector[] { connector });
 
 WebAppContext bb = new WebAppContext();
 bb.setServer(server);
 bb.setContextPath(/);
 bb.setWar(src/main/webapp);
 
 // START JMX SERVER
 // MBeanServer mBeanServer =
  ManagementFactory.getPlatformMBeanServer();
 // MBeanContainer mBeanContainer = new
  MBeanContainer(mBeanServer);
 //
  server.getContainer().addEventListener(mBeanContainer);
 // mBeanContainer.start();
 
 server.addHandler(bb);
 
 try {
 System.out.println( STARTING EMBEDDED JETTY
  SERVER, PRESS ANY KEY TO STOP);
 server.start();
 System.in.read();
 System.out.println( STOPPING EMBEDDED JETTY
  SERVER);
 // while (System.in.available() == 0) {
 //   Thread.sleep(5000);
 // }
 server.stop();
 server.join();
 } catch (Exception e) {
 e.printStackTrace();
 System.exit(100);
  }
 }
  }
 
 
  -Original Message-
  From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
  Sent: Tuesday, March 24, 2009 4:23 PM
  To: users@wicket.apache.org
  Subject: Re: newbie question: HTTP 404 on the quickstart project
 
  Try http://localhost:8080 and http://localhost:8081
 
  The answer really will be in Start.java - see what port it is on and
  where
  the app is mounted.  Then make that into a URL.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Mar 24, 2009 at 3:19 PM, Chenini, Mohamed
  mchen...@geico.comwrote:
 
   I tried http://localhost:8081/quickstart
  
   And the content of web.xml is:
  
  
   filter
  filter-namewicket.QuickStart/filter-name
  
  
 
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
   
  init-param
  param-nameapplicationClassName/param-name
  
   param-valuecom.mycompany.app.WicketApplication/param-value
  /init-param
   /filter
  
   filter-mapping
filter-namewicket.QuickStart/filter-name
  url-pattern/*/url-pattern
   /filter-mapping
  
  
   -Original Message-
   From: Jeremy Thomerson

Newbie question

2008-12-09 Thread Mark Daniel
Hello all,

I'm following the wicket in action book. I'm trying the cheese store in
chapter 3. I was following along the code by reading a bit and coding a bit
on my own. The code defining the ListView for the cheese cart is originally:

add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }

The way I ended up coding it was:

add(new ListView(cart, getCart().getCheeses())) { ... }

Which seems to be working fine, but If I click repeatedly fast on the 'add
to cart' link, the ArrayList in session gets its size changed correctly when
adding elements, but the ListView element size doesnt change accordingly.
Basically, the list size keeps growing on each click,  but the number of
items in the ListView doesnt grow anymore.

Any ideas whats wrong?

Thanks.


Re: Newbie question

2008-12-09 Thread Mark Daniel
Hi,

Basically,  getCart().getCheeses().size() != cartListView.size()


On Wed, Dec 10, 2008 at 12:31 AM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I think you are talking about the 'viewSize' property of ListView.

 This indicates how many viewable items will be displayed within a
 ListView.



 -Original Message-
 From: Mark Daniel [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 09, 2008 6:23 PM
 To: users@wicket.apache.org
 Subject: Newbie question


 Hello all,

 I'm following the wicket in action book. I'm trying the cheese store in
 chapter 3. I was following along the code by reading a bit and coding a bit
 on my own. The code defining the ListView for the cheese cart is
 originally:

 add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }

 The way I ended up coding it was:

 add(new ListView(cart, getCart().getCheeses())) { ... }

 Which seems to be working fine, but If I click repeatedly fast on the 'add
 to cart' link, the ArrayList in session gets its size changed correctly
 when
 adding elements, but the ListView element size doesnt change accordingly.
 Basically, the list size keeps growing on each click,  but the number of
 items in the ListView doesnt grow anymore.

 Any ideas whats wrong?

 Thanks.

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel.

 ***


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




RE: Newbie question

2008-12-09 Thread Bruno Cesar Borges
Oh, yeah... size() is a method from MarkupContainer.

/**
 * Get the number of children in this container.
 * 
 * @return Number of children in this container
 */
public final int size()
{
return children_size();
}

I don't know if for Repeaters would make sense to return how many items they 
contain. Probably not.



-Original Message-
From: Mark Daniel [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2008 6:35 PM
To: users@wicket.apache.org
Subject: Re: Newbie question


Hi,

Basically,  getCart().getCheeses().size() != cartListView.size()


On Wed, Dec 10, 2008 at 12:31 AM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I think you are talking about the 'viewSize' property of ListView.

 This indicates how many viewable items will be displayed within a
 ListView.



 -Original Message-
 From: Mark Daniel [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 09, 2008 6:23 PM
 To: users@wicket.apache.org
 Subject: Newbie question


 Hello all,

 I'm following the wicket in action book. I'm trying the cheese store in
 chapter 3. I was following along the code by reading a bit and coding a bit
 on my own. The code defining the ListView for the cheese cart is
 originally:

 add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }

 The way I ended up coding it was:

 add(new ListView(cart, getCart().getCheeses())) { ... }

 Which seems to be working fine, but If I click repeatedly fast on the 'add
 to cart' link, the ArrayList in session gets its size changed correctly
 when
 adding elements, but the ListView element size doesnt change accordingly.
 Basically, the list size keeps growing on each click,  but the number of
 items in the ListView doesnt grow anymore.

 Any ideas whats wrong?

 Thanks.

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel.

 ***


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


***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


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



Re: Newbie question

2008-12-09 Thread Igor Vaynberg
you gave listview a list instance, but its probably not the same
instance of list you are adding items to. that is why the original
code uses a model to give listview the list. read the models
chapter...

-igor

On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel [EMAIL PROTECTED] wrote:
 Hello all,

 I'm following the wicket in action book. I'm trying the cheese store in
 chapter 3. I was following along the code by reading a bit and coding a bit
 on my own. The code defining the ListView for the cheese cart is originally:

 add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }

 The way I ended up coding it was:

 add(new ListView(cart, getCart().getCheeses())) { ... }

 Which seems to be working fine, but If I click repeatedly fast on the 'add
 to cart' link, the ArrayList in session gets its size changed correctly when
 adding elements, but the ListView element size doesnt change accordingly.
 Basically, the list size keeps growing on each click,  but the number of
 items in the ListView doesnt grow anymore.

 Any ideas whats wrong?

 Thanks.


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



Re: Newbie question

2008-12-09 Thread Mark Daniel
Hi Igor,

I just changed one line the original source (in my original post), and built
a war and deployed on tomcat, and got the behavior I mentioning. I think
they both point to the same list.

On Wed, Dec 10, 2008 at 1:12 AM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 you gave listview a list instance, but its probably not the same
 instance of list you are adding items to. that is why the original
 code uses a model to give listview the list. read the models
 chapter...

 -igor

 On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel [EMAIL PROTECTED] wrote:
  Hello all,
 
  I'm following the wicket in action book. I'm trying the cheese store in
  chapter 3. I was following along the code by reading a bit and coding a
 bit
  on my own. The code defining the ListView for the cheese cart is
 originally:
 
  add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }
 
  The way I ended up coding it was:
 
  add(new ListView(cart, getCart().getCheeses())) { ... }
 
  Which seems to be working fine, but If I click repeatedly fast on the
 'add
  to cart' link, the ArrayList in session gets its size changed correctly
 when
  adding elements, but the ListView element size doesnt change accordingly.
  Basically, the list size keeps growing on each click,  but the number of
  items in the ListView doesnt grow anymore.
 
  Any ideas whats wrong?
 
  Thanks.
 

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




Re: Newbie question

2008-12-09 Thread Mark Daniel
By original source, I meant I just tried it on the book source code
download.

On Wed, Dec 10, 2008 at 1:20 AM, Mark Daniel [EMAIL PROTECTED] wrote:

 Hi Igor,

 I just changed one line the original source (in my original post), and
 built a war and deployed on tomcat, and got the behavior I mentioning. I
 think they both point to the same list.


 On Wed, Dec 10, 2008 at 1:12 AM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 you gave listview a list instance, but its probably not the same
 instance of list you are adding items to. that is why the original
 code uses a model to give listview the list. read the models
 chapter...

 -igor

 On Tue, Dec 9, 2008 at 12:23 PM, Mark Daniel [EMAIL PROTECTED] wrote:
  Hello all,
 
  I'm following the wicket in action book. I'm trying the cheese store in
  chapter 3. I was following along the code by reading a bit and coding a
 bit
  on my own. The code defining the ListView for the cheese cart is
 originally:
 
  add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ...
 }
 
  The way I ended up coding it was:
 
  add(new ListView(cart, getCart().getCheeses())) { ... }
 
  Which seems to be working fine, but If I click repeatedly fast on the
 'add
  to cart' link, the ArrayList in session gets its size changed correctly
 when
  adding elements, but the ListView element size doesnt change
 accordingly.
  Basically, the list size keeps growing on each click,  but the number of
  items in the ListView doesnt grow anymore.
 
  Any ideas whats wrong?
 
  Thanks.
 

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





Newbie Question, Very Basic Model Use

2008-10-06 Thread walnutmon

After using property models, it's nice to have automatic binding to variables
in objects... However, I can't seem to get the same thing to work with local
variables... as an example...

new CheckBox(toggleSomething, new PropertyModel(someObject,
toggleableProperty));
works beautifully...

However, 
new CheckBox(toggleSomething, new Model(toggleableObject));
//toggleableObject is a Boolean

doesn't seem to change anything on form submit, that toggleable object only
dictates the initial state of the checkbox, but doesn't change with it
What am I missing?

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.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]



Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Serkan Camurcuoglu
Model assigns a new object as the model object, and I think 
java.lang.Boolean is immutable so it can't change after it's constructed 
anyway. So instead of checking the value of toggleableObject I think you 
can check myCheckbox.getModelObject() == Boolean.TRUE etc..




Ryan Gravener wrote:

If you would like the property model to work with local variables do
new propertymodel(this,property)

On 10/6/08, walnutmon [EMAIL PROTECTED] wrote:
  

After using property models, it's nice to have automatic binding to
variables
in objects... However, I can't seem to get the same thing to work with local
variables... as an example...

new CheckBox(toggleSomething, new PropertyModel(someObject,
toggleableProperty));
works beautifully...

However,
new CheckBox(toggleSomething, new Model(toggleableObject));
//toggleableObject is a Boolean

doesn't seem to change anything on form submit, that toggleable object only
dictates the initial state of the checkbox, but doesn't change with it
What am I missing?

--
View this message in context:
http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.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]






  



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



Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Ryan Gravener
If you would like the property model to work with local variables do
new propertymodel(this,property)

On 10/6/08, walnutmon [EMAIL PROTECTED] wrote:

 After using property models, it's nice to have automatic binding to
 variables
 in objects... However, I can't seem to get the same thing to work with local
 variables... as an example...

 new CheckBox(toggleSomething, new PropertyModel(someObject,
 toggleableProperty));
 works beautifully...

 However,
 new CheckBox(toggleSomething, new Model(toggleableObject));
 //toggleableObject is a Boolean

 doesn't seem to change anything on form submit, that toggleable object only
 dictates the initial state of the checkbox, but doesn't change with it
 What am I missing?

 --
 View this message in context:
 http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.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]




-- 
Ryan Gravener
http://twitter.com/ryangravener

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



Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Martijn Dashorst
see the models page on the wiki and read the javadoc for CompoundPropertyModel

Martijn

On Mon, Oct 6, 2008 at 3:26 PM, walnutmon [EMAIL PROTECTED] wrote:

 After using property models, it's nice to have automatic binding to variables
 in objects... However, I can't seem to get the same thing to work with local
 variables... as an example...

 new CheckBox(toggleSomething, new PropertyModel(someObject,
 toggleableProperty));
 works beautifully...

 However,
 new CheckBox(toggleSomething, new Model(toggleableObject));
 //toggleableObject is a Boolean

 doesn't seem to change anything on form submit, that toggleable object only
 dictates the initial state of the checkbox, but doesn't change with it
 What am I missing?

 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.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]





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread Jonathan Locke


also see wicket-rad if appropriate


igor.vaynberg wrote:
 
 have a look see here for an example
 
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-crud/
 
 -igor
 
 On Thu, Sep 11, 2008 at 6:29 PM, walnutmon [EMAIL PROTECTED]
 wrote:

 Very new to Wicket, I've been reading about it for a few days, I'm really
 excited now that I'm using it.

 The stuff I do requires that you be able to create dynamic form
 elements...
 as an example, how would I be able to create a form that has a radio
 button
 input, where the amount of radio buttons depends on a call to some other
 object?

 A quick example...

 form area

 /form area

 This will be an area that could have any number of radio button options
 based on a call to some psuedo function 'ListRadioButtonOption
 getRadioButtonSelectionOptions();'

 I am unable to just call 'add(optionIndex, listOfOptions.getNext());'
 because there is nothing mapped to it in HTML, however, I can't put it in
 HTML, because I don't know how many options there will be.

 Thanks!
 Justin
 --
 View this message in context:
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19447802.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]


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

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19450053.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]



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread wfaler


Jonathan Locke wrote:
 
 also see wicket-rad if appropriate
 
A  http://sites.google.com/site/wicketrad URL could be useful, so here it is
. :)

The org.wicketrad.propertyeditor package in the wicket-rad-core module has a
bunch of Panels you might want to look at for your problem.

The exact problem regarding Radio buttins you (Justin) are talking about can
be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class
(it uses an implementation of IChoiceSource to retrieve the number of radio
buttons).
-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread James Carman
Does this person really need a RAD tool for what they're trying to do?
 All they need to do is display a list of an arbitrary number of radio
buttons.  Wouldn't ListView suffice in this situation?  That's all
they asked for.  The XP folks would say, Do the simplest thing that
works.

On Fri, Sep 12, 2008 at 3:56 AM, wfaler [EMAIL PROTECTED] wrote:


 Jonathan Locke wrote:

 also see wicket-rad if appropriate

 A  http://sites.google.com/site/wicketrad URL could be useful, so here it is
 . :)

 The org.wicketrad.propertyeditor package in the wicket-rad-core module has a
 bunch of Panels you might want to look at for your problem.

 The exact problem regarding Radio buttins you (Justin) are talking about can
 be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class
 (it uses an implementation of IChoiceSource to retrieve the number of radio
 buttons).
 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]



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



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread wfaler

Nope, probably not, but he can take a look at the code for a sample on how to
achieve exactly what he wants.


jwcarman wrote:
 
 Does this person really need a RAD tool for what they're trying to do?
  All they need to do is display a list of an arbitrary number of radio
 buttons.  Wouldn't ListView suffice in this situation?  That's all
 they asked for.  The XP folks would say, Do the simplest thing that
 works.
 
 On Fri, Sep 12, 2008 at 3:56 AM, wfaler [EMAIL PROTECTED] wrote:


 Jonathan Locke wrote:

 also see wicket-rad if appropriate

 A  http://sites.google.com/site/wicketrad URL could be useful, so here it
 is
 . :)

 The org.wicketrad.propertyeditor package in the wicket-rad-core module
 has a
 bunch of Panels you might want to look at for your problem.

 The exact problem regarding Radio buttins you (Justin) are talking about
 can
 be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput
 class
 (it uses an implementation of IChoiceSource to retrieve the number of
 radio
 buttons).
 --
 View this message in context:
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]


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

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19453574.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]



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread Igor Vaynberg
did you also explain about setreuseitems(true) to them after
suggesting a listview?

-igor

On Fri, Sep 12, 2008 at 3:35 AM, James Carman
[EMAIL PROTECTED] wrote:
 Does this person really need a RAD tool for what they're trying to do?
  All they need to do is display a list of an arbitrary number of radio
 buttons.  Wouldn't ListView suffice in this situation?  That's all
 they asked for.  The XP folks would say, Do the simplest thing that
 works.

 On Fri, Sep 12, 2008 at 3:56 AM, wfaler [EMAIL PROTECTED] wrote:


 Jonathan Locke wrote:

 also see wicket-rad if appropriate

 A  http://sites.google.com/site/wicketrad URL could be useful, so here it is
 . :)

 The org.wicketrad.propertyeditor package in the wicket-rad-core module has a
 bunch of Panels you might want to look at for your problem.

 The exact problem regarding Radio buttins you (Justin) are talking about can
 be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class
 (it uses an implementation of IChoiceSource to retrieve the number of radio
 buttons).
 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]



 -
 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]



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread James Carman
Where's the fun in that? ;)  Sorry, I should have mentioned that you
need to setup your ListView to reuse the items if you're doing things
as you say.

On Fri, Sep 12, 2008 at 10:10 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 did you also explain about setreuseitems(true) to them after
 suggesting a listview?

 -igor

 On Fri, Sep 12, 2008 at 3:35 AM, James Carman
 [EMAIL PROTECTED] wrote:
 Does this person really need a RAD tool for what they're trying to do?
  All they need to do is display a list of an arbitrary number of radio
 buttons.  Wouldn't ListView suffice in this situation?  That's all
 they asked for.  The XP folks would say, Do the simplest thing that
 works.

 On Fri, Sep 12, 2008 at 3:56 AM, wfaler [EMAIL PROTECTED] wrote:


 Jonathan Locke wrote:

 also see wicket-rad if appropriate

 A  http://sites.google.com/site/wicketrad URL could be useful, so here it is
 . :)

 The org.wicketrad.propertyeditor package in the wicket-rad-core module has a
 bunch of Panels you might want to look at for your problem.

 The exact problem regarding Radio buttins you (Justin) are talking about can
 be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class
 (it uses an implementation of IChoiceSource to retrieve the number of radio
 buttons).
 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]



 -
 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]



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



Re: Newbie Question: Dynamically Building Form Elements

2008-09-12 Thread walnutmon

Haha, first off, thanks for all the responses, I'm glad the community is
active :)

I took a look at the Wicket Rad, it looks pretty cool, I think he referenced
it so that I can actually see how some of that stuff works, and get a handle
on what Wicket is capable of, it was a bit over my head.

I then took a look at ListView, and I saw the setReuseItems() function, used
to be setOptimizeSomething()... but they deprecated it, apparently they did
so just to make the name more meaningful, because it appears the two do the
same thing.

Thanks again!


jwcarman wrote:
 
 Where's the fun in that? ;)  Sorry, I should have mentioned that you
 need to setup your ListView to reuse the items if you're doing things
 as you say.
 
 On Fri, Sep 12, 2008 at 10:10 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 did you also explain about setreuseitems(true) to them after
 suggesting a listview?

 -igor

 On Fri, Sep 12, 2008 at 3:35 AM, James Carman
 [EMAIL PROTECTED] wrote:
 Does this person really need a RAD tool for what they're trying to do?
  All they need to do is display a list of an arbitrary number of radio
 buttons.  Wouldn't ListView suffice in this situation?  That's all
 they asked for.  The XP folks would say, Do the simplest thing that
 works.

 On Fri, Sep 12, 2008 at 3:56 AM, wfaler [EMAIL PROTECTED] wrote:


 Jonathan Locke wrote:

 also see wicket-rad if appropriate

 A  http://sites.google.com/site/wicketrad URL could be useful, so here
 it is
 . :)

 The org.wicketrad.propertyeditor package in the wicket-rad-core module
 has a
 bunch of Panels you might want to look at for your problem.

 The exact problem regarding Radio buttins you (Justin) are talking
 about can
 be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput
 class
 (it uses an implementation of IChoiceSource to retrieve the number of
 radio
 buttons).
 --
 View this message in context:
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.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]



 -
 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]


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

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19461052.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]



Newbie Question: Dynamically Building Form Elements

2008-09-11 Thread walnutmon

Very new to Wicket, I've been reading about it for a few days, I'm really
excited now that I'm using it.  

The stuff I do requires that you be able to create dynamic form elements...
as an example, how would I be able to create a form that has a radio button
input, where the amount of radio buttons depends on a call to some other
object?

A quick example...

form area

/form area

This will be an area that could have any number of radio button options
based on a call to some psuedo function 'ListRadioButtonOption
getRadioButtonSelectionOptions();'

I am unable to just call 'add(optionIndex, listOfOptions.getNext());'
because there is nothing mapped to it in HTML, however, I can't put it in
HTML, because I don't know how many options there will be.

Thanks!
Justin
-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19447802.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]



Re: Newbie Question: Dynamically Building Form Elements

2008-09-11 Thread James Carman
Take a look at ListView.

On Thu, Sep 11, 2008 at 9:29 PM, walnutmon [EMAIL PROTECTED] wrote:

 Very new to Wicket, I've been reading about it for a few days, I'm really
 excited now that I'm using it.

 The stuff I do requires that you be able to create dynamic form elements...
 as an example, how would I be able to create a form that has a radio button
 input, where the amount of radio buttons depends on a call to some other
 object?

 A quick example...

 form area

 /form area

 This will be an area that could have any number of radio button options
 based on a call to some psuedo function 'ListRadioButtonOption
 getRadioButtonSelectionOptions();'

 I am unable to just call 'add(optionIndex, listOfOptions.getNext());'
 because there is nothing mapped to it in HTML, however, I can't put it in
 HTML, because I don't know how many options there will be.

 Thanks!
 Justin
 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19447802.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]



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



Re: Newbie Question: Dynamically Building Form Elements

2008-09-11 Thread Igor Vaynberg
have a look see here for an example

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-crud/

-igor

On Thu, Sep 11, 2008 at 6:29 PM, walnutmon [EMAIL PROTECTED] wrote:

 Very new to Wicket, I've been reading about it for a few days, I'm really
 excited now that I'm using it.

 The stuff I do requires that you be able to create dynamic form elements...
 as an example, how would I be able to create a form that has a radio button
 input, where the amount of radio buttons depends on a call to some other
 object?

 A quick example...

 form area

 /form area

 This will be an area that could have any number of radio button options
 based on a call to some psuedo function 'ListRadioButtonOption
 getRadioButtonSelectionOptions();'

 I am unable to just call 'add(optionIndex, listOfOptions.getNext());'
 because there is nothing mapped to it in HTML, however, I can't put it in
 HTML, because I don't know how many options there will be.

 Thanks!
 Justin
 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19447802.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]



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



How does Wicket load an object and combine it with a user's web input? (newbie question)

2008-05-16 Thread David Wicket
I just started learning Wicket. I have some experience with JSP+Spring.
In Spring, based on a hidden id parameter from a form, I can use 
formBackingObject method to load the object. Spring combines a user's 
input in the form with the loaded object to form the latest version of this 
object and then I can save it.
I am not sure how to do the same thing in Wicket. I tried 
and I got errors.
In addition, how to let Wicket combine user input with the old version object 
loaded from the database?
Any pointers, examples, explanation?
Thanks you so much for your help!!!
Regards. input wicket:id=id type=hidden/


  

Re: How does Wicket load an object and combine it with a user's web input? (newbie question)

2008-05-16 Thread Maurice Marrink
You do not need a hidden form parameter, wicket automatically resolves
the form input with the component on the server side.
On submit the model of the component is loaded and set with the new
input. If you use a model such as LoadableDetachableModel, that knows
how to get the latest object from the database then the object is thus
updated and can be saved.
For example
Form form=new Form(form, new
CompoundPropertyModel(myLoadableDetachableUserModel))
form.add(new TextField(firstName);
form.add(new TextField(LastName);

We use a LoadableDetachableModel to get the user from the database on
each request.
We wrap it in a CompoundPropertyModel so we can then easy use other
components to set its fields.
Because we use a CompoundPropertyModel we do not have to specify
models for the textfields, instead the id of the textfields is used to
resolve the getter and setter on the user object.

For a more in depth example you should check out
http://www.theserverside.com/tt/articles/content/IntroducingApacheWicket/article.html
or one of the other tutorials floating around

Maurice

On Fri, May 16, 2008 at 11:59 AM, David Wicket [EMAIL PROTECTED] wrote:
 I just started learning Wicket. I have some experience with JSP+Spring.
 In Spring, based on a hidden id parameter from a form, I can use 
 formBackingObject method to load the object. Spring combines a user's input 
 in the form with the loaded object to form the latest version of this object 
 and then I can save it.
 I am not sure how to do the same thing in Wicket. I tried 
 and I got errors.
 In addition, how to let Wicket combine user input with the old version object 
 loaded from the database?
 Any pointers, examples, explanation?
 Thanks you so much for your help!!!
 Regards. input wicket:id=id type=hidden/




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



Re: [Newbie question] How to avoid empty boxes?

2008-03-15 Thread Kaspar Fischer

Another possibility:

/**
 * A panel whose visibility is on iff at least one of its  
subcomponents is visible.

 */
public class Envelope extends Panel
{
  private static final long serialVersionUID = -6422145787799831814L;

  public Envelope(String id)
  {
super(id);
  }

  public Envelope(String id, IModel model)
  {
super(id, model);
  }

  @Override
  public boolean isVisible()
  {
boolean visible = false;

for (IteratorComponent it = iterator(); it.hasNext();)
{
  Component child = it.next();
  if (child.isVisible())
visible = true;
}
return visible  super.isVisible();
  }
}

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



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-29 Thread Nino Saturnino Martinez Vazquez Wael

Could you show us some code?

regards

Karol Wrzesniewski wrote:

Thanks for all your help.

NonCachingImage is exacly what I wanted.

It works fine but only after I open modal window, call 
setImageResource, close modal and reopen it again.


After first call of modal window default image is created, when I'm 
trying to change it nothing happens exacly like with plain Image 
objects. But when I close modal and open it again everything works as 
intended to, pictures are refreshing using chosen resources.


regards,
Zyx




Dnia 28-02-2008 o 10:22:40 Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] napisał(a):


:) I think thats the point of noncaching image thats already there, 
it's just that people gets confused by this...


Bernard Niset wrote:

Hi,
I had the same issue yesterday and found a solution somewhere else 
in this mailing list. Adding some random query to the url forces the 
browser not to reuse a cached image. To achieve that you have to 
subclass Image and override onComponentTag like this:


   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   String src = (String) tag.getAttributes().get(src);
   src = src + rand= + Math.random();
   tag.getAttributes().put(src, src);
   }

Bernard.


Igor Vaynberg wrote:

most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:

Should nocachingImage be default, and then have a cachingImage? Or 
would

 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView 
containing Ajax

   links:
 
   --
   add(listaObrazow = new ListView(pics, obrazki) {
   public void populateItem(final ListItem listItem) {
   final String obr = 
(String)listItem.getModelObject();

   listItem.add(new Label(pic,new Model(obr)));
 
   listItem.add(new AjaxLink(picAjaxLink) {
   public void onClick(AjaxRequestTarget
   ajaxRequestTarget) {
 
   imgPreview.setImageResource(
   EbokTools.getImageResource(
   
(String)listItem.getModelObject()

   )
   );
 
   
ajaxRequestTarget.addComponent(imgPreview);

 
 
   
myModal.setObraz((String)listItem.getModelObject());
   
ajaxRequestTarget.addComponent(wyborObrazow);

   }});
   }
   });
   --
 
 
 
   imgPreview is an Image object, placed on the same modal 
Window. What Im
   trying to achieve is to refresh this image after the AjaxLink 
is clicked.
   Unfortunately it doesn't. After I click on AjaxLink content 
of form

   wyborObrazow is refreshed, but image stays unchanged.
 
   Image resource is being changed - i know that because after i 
close modal
   and open it again imgPreview is showing me  the right 
Resource.

 
   The problem is that calling 
ajaxRequestTarget.addComponent(imgPreview);

   after changing imageResource doesn't seem to be enough.
 
   I would be very grateful for some hints.
 
   best regards,
   Zyx
 
   --
 
   
-

   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]
 
 
 

 --
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684




 - 


 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]













--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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

Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-29 Thread Nino Saturnino Martinez Vazquez Wael

https://issues.apache.org/jira/browse/WICKET-1382

Igor Vaynberg wrote:

most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:
  

Should nocachingImage be default, and then have a cachingImage? Or would
 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView containing Ajax
   links:
 
   --
   add(listaObrazow = new ListView(pics, obrazki) {
   public void populateItem(final ListItem listItem) {
   final String obr = (String)listItem.getModelObject();
   listItem.add(new Label(pic,new Model(obr)));
 
   listItem.add(new AjaxLink(picAjaxLink) {
   public void onClick(AjaxRequestTarget
   ajaxRequestTarget) {
 
   imgPreview.setImageResource(
   EbokTools.getImageResource(
   (String)listItem.getModelObject()
   )
   );
 
   ajaxRequestTarget.addComponent(imgPreview);
 
 
   
myModal.setObraz((String)listItem.getModelObject());
   ajaxRequestTarget.addComponent(wyborObrazow);
   }});
   }
   });
   --
 
 
 
   imgPreview is an Image object, placed on the same modal Window. What Im
   trying to achieve is to refresh this image after the AjaxLink is clicked.
   Unfortunately it doesn't. After I click on AjaxLink content of form
   wyborObrazow is refreshed, but image stays unchanged.
 
   Image resource is being changed - i know that because after i close modal
   and open it again imgPreview is showing me  the right Resource.
 
   The problem is that calling ajaxRequestTarget.addComponent(imgPreview);
   after changing imageResource doesn't seem to be enough.
 
   I would be very grateful for some hints.
 
   best regards,
   Zyx
 
   --
 
   -
   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]
 
 
 

 --
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684




 -
 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]


  


--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-29 Thread Karol Wrzesniewski

ok - that's how it looks:


this is a ListView on the panels left side:

  add(listaObrazow = new ListView(pics, obrazki) {
public void populateItem(final ListItem listItem) {
final String obr = (String)listItem.getModelObject();

AjaxLink linka = new AjaxLink(picAjaxLink) {
public void onClick(AjaxRequestTarget  
ajaxRequestTarget) {


imgPreview.setImageResource(
EbokTools.getImageResource(
(String)listItem.getModelObject()
)
);

ajaxRequestTarget.addComponent(imgPreview);

myModal.setObraz((String)listItem.getModelObject());
ajaxRequestTarget.addComponent(wyborObrazow);
}};

linka.add(new Label(pic,new Model(obr)));
listItem.add(linka);
}
});


that's getImageResource method:

public static ByteArrayResource getImageResource(String picName) {
byte[] plik = null;
try {

  plik = EbokTools.fileToArray(
 new File(
EbokSettings.getImgDir()+/+picName));
} catch (IOException ex) {
ex.printStackTrace();
}

  return new ByteArrayResource(img,plik);
}



As I wrote before imgPreview is a NonCachingImage object placed on the  
same Modal Window as ListView. Its created in the panel constructor using  
method:


EbokTools.getImage(imgPreview, nopic.jpg);  



getImage looks like this:

public static NonCachingImage getImage(String wicketID, String  
picName) {

return new NonCachingImage(wicketID,getImageResource(picName));
}


-

To make it work I need to:
- open modal window
	- click on one of the AjaxLinks on listaObrazow (it doesn't trigger image  
refresh :\ )

- close modal
- open it again

After that images are changing on clicking AjaxLinks - as they should.



best regards,
Karol

Dnia 29-02-2008 o 10:15:55 Nino Saturnino Martinez Vazquez Wael  
[EMAIL PROTECTED] napisał(a):



Could you show us some code?

regards

Karol Wrzesniewski wrote:

Thanks for all your help.

NonCachingImage is exacly what I wanted.

It works fine but only after I open modal window, call  
setImageResource, close modal and reopen it again.


After first call of modal window default image is created, when I'm  
trying to change it nothing happens exacly like with plain Image  
objects. But when I close modal and open it again everything works as  
intended to, pictures are refreshing using chosen resources.


regards,
Zyx




Dnia 28-02-2008 o 10:22:40 Nino Saturnino Martinez Vazquez Wael  
[EMAIL PROTECTED] napisał(a):


:) I think thats the point of noncaching image thats already there,  
it's just that people gets confused by this...


Bernard Niset wrote:

Hi,
I had the same issue yesterday and found a solution somewhere else in  
this mailing list. Adding some random query to the url forces the  
browser not to reuse a cached image. To achieve that you have to  
subclass Image and override onComponentTag like this:


   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   String src = (String) tag.getAttributes().get(src);
   src = src + rand= + Math.random();
   tag.getAttributes().put(src, src);
   }

Bernard.


Igor Vaynberg wrote:
most people want stable urls for their images i would imagine, so  
they

can be cached by the browser.

in case of ajax this doesnt work because the url has to change so  
that

browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez  
Wael

[EMAIL PROTECTED] wrote:

Should nocachingImage be default, and then have a cachingImage? Or  
would

 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView  
containing Ajax

   links:
 
   --
   

Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-28 Thread Karol Wrzesniewski

Thanks for all your help.

NonCachingImage is exacly what I wanted.

It works fine but only after I open modal window, call setImageResource,  
close modal and reopen it again.


After first call of modal window default image is created, when I'm trying  
to change it nothing happens exacly like with plain Image objects. But  
when I close modal and open it again everything works as intended to,  
pictures are refreshing using chosen resources.


regards,
Zyx




Dnia 28-02-2008 o 10:22:40 Nino Saturnino Martinez Vazquez Wael  
[EMAIL PROTECTED] napisał(a):


:) I think thats the point of noncaching image thats already there, it's  
just that people gets confused by this...


Bernard Niset wrote:

Hi,
I had the same issue yesterday and found a solution somewhere else in  
this mailing list. Adding some random query to the url forces the  
browser not to reuse a cached image. To achieve that you have to  
subclass Image and override onComponentTag like this:


   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   String src = (String) tag.getAttributes().get(src);
   src = src + rand= + Math.random();
   tag.getAttributes().put(src, src);
   }

Bernard.


Igor Vaynberg wrote:

most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:

Should nocachingImage be default, and then have a cachingImage? Or  
would

 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView  
containing Ajax

   links:
 
   --
   add(listaObrazow = new ListView(pics, obrazki) {
   public void populateItem(final ListItem listItem) {
   final String obr =  
(String)listItem.getModelObject();

   listItem.add(new Label(pic,new Model(obr)));
 
   listItem.add(new AjaxLink(picAjaxLink) {
   public void onClick(AjaxRequestTarget
   ajaxRequestTarget) {
 
   imgPreview.setImageResource(
   EbokTools.getImageResource(
   (String)listItem.getModelObject()
   )
   );
 

ajaxRequestTarget.addComponent(imgPreview);

 
 

myModal.setObraz((String)listItem.getModelObject());

ajaxRequestTarget.addComponent(wyborObrazow);

   }});
   }
   });
   --
 
 
 
   imgPreview is an Image object, placed on the same modal Window.  
What Im
   trying to achieve is to refresh this image after the AjaxLink is  
clicked.
   Unfortunately it doesn't. After I click on AjaxLink content of  
form

   wyborObrazow is refreshed, but image stays unchanged.
 
   Image resource is being changed - i know that because after i  
close modal
   and open it again imgPreview is showing me  the right  
Resource.

 
   The problem is that calling  
ajaxRequestTarget.addComponent(imgPreview);

   after changing imageResource doesn't seem to be enough.
 
   I would be very grateful for some hints.
 
   best regards,
   Zyx
 
   --
 

-

   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]
 
 
 

 --
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684




 -
 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]











--
___
Karol Wrześniewski, pokój: SSE III F3.5, GG:3494610

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



[newbie question] How to refresh Image using an AjaxLink

2008-02-27 Thread Karol Wrzesniewski

Hi,

I'm having problems with refreshing an Image using AjaxLink.

I have a ModalWindow. On it's left side theres a ListView containing Ajax  
links:


--
add(listaObrazow = new ListView(pics, obrazki) {
public void populateItem(final ListItem listItem) {
final String obr = (String)listItem.getModelObject();
listItem.add(new Label(pic,new Model(obr)));

listItem.add(new AjaxLink(picAjaxLink) {
public void onClick(AjaxRequestTarget  
ajaxRequestTarget) {


imgPreview.setImageResource(
EbokTools.getImageResource(
(String)listItem.getModelObject()
)
);

ajaxRequestTarget.addComponent(imgPreview);


myModal.setObraz((String)listItem.getModelObject());
ajaxRequestTarget.addComponent(wyborObrazow);
}});
}
});
--



imgPreview is an Image object, placed on the same modal Window. What Im  
trying to achieve is to refresh this image after the AjaxLink is clicked.  
Unfortunately it doesn't. After I click on AjaxLink content of form  
wyborObrazow is refreshed, but image stays unchanged.


Image resource is being changed - i know that because after i close modal  
and open it again imgPreview is showing me  the right Resource.


The problem is that calling ajaxRequestTarget.addComponent(imgPreview);  
after changing imageResource doesn't seem to be enough.


I would be very grateful for some hints.

best regards,
Zyx

--

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



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-27 Thread Igor Vaynberg
use NonCachingImage

-igor


On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
[EMAIL PROTECTED] wrote:
 Hi,

  I'm having problems with refreshing an Image using AjaxLink.

  I have a ModalWindow. On it's left side theres a ListView containing Ajax
  links:

  --
  add(listaObrazow = new ListView(pics, obrazki) {
  public void populateItem(final ListItem listItem) {
  final String obr = (String)listItem.getModelObject();
  listItem.add(new Label(pic,new Model(obr)));

  listItem.add(new AjaxLink(picAjaxLink) {
  public void onClick(AjaxRequestTarget
  ajaxRequestTarget) {

  imgPreview.setImageResource(
  EbokTools.getImageResource(
  (String)listItem.getModelObject()
  )
  );

  ajaxRequestTarget.addComponent(imgPreview);


  myModal.setObraz((String)listItem.getModelObject());
  ajaxRequestTarget.addComponent(wyborObrazow);
  }});
  }
  });
  --



  imgPreview is an Image object, placed on the same modal Window. What Im
  trying to achieve is to refresh this image after the AjaxLink is clicked.
  Unfortunately it doesn't. After I click on AjaxLink content of form
  wyborObrazow is refreshed, but image stays unchanged.

  Image resource is being changed - i know that because after i close modal
  and open it again imgPreview is showing me  the right Resource.

  The problem is that calling ajaxRequestTarget.addComponent(imgPreview);
  after changing imageResource doesn't seem to be enough.

  I would be very grateful for some hints.

  best regards,
  Zyx

  --

  -
  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]



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-27 Thread Nino Saturnino Martinez Vazquez Wael
Should nocachingImage be default, and then have a cachingImage? Or would 
that result in the same amount of confusion? WDYT?


As a couple of people has been confused by this...

regards Nino

Igor Vaynberg wrote:

use NonCachingImage

-igor


On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
[EMAIL PROTECTED] wrote:
  

Hi,

 I'm having problems with refreshing an Image using AjaxLink.

 I have a ModalWindow. On it's left side theres a ListView containing Ajax
 links:

 --
 add(listaObrazow = new ListView(pics, obrazki) {
 public void populateItem(final ListItem listItem) {
 final String obr = (String)listItem.getModelObject();
 listItem.add(new Label(pic,new Model(obr)));

 listItem.add(new AjaxLink(picAjaxLink) {
 public void onClick(AjaxRequestTarget
 ajaxRequestTarget) {

 imgPreview.setImageResource(
 EbokTools.getImageResource(
 (String)listItem.getModelObject()
 )
 );

 ajaxRequestTarget.addComponent(imgPreview);


 myModal.setObraz((String)listItem.getModelObject());
 ajaxRequestTarget.addComponent(wyborObrazow);
 }});
 }
 });
 --



 imgPreview is an Image object, placed on the same modal Window. What Im
 trying to achieve is to refresh this image after the AjaxLink is clicked.
 Unfortunately it doesn't. After I click on AjaxLink content of form
 wyborObrazow is refreshed, but image stays unchanged.

 Image resource is being changed - i know that because after i close modal
 and open it again imgPreview is showing me  the right Resource.

 The problem is that calling ajaxRequestTarget.addComponent(imgPreview);
 after changing imageResource doesn't seem to be enough.

 I would be very grateful for some hints.

 best regards,
 Zyx

 --

 -
 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]


  


--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-27 Thread Igor Vaynberg
most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:
 Should nocachingImage be default, and then have a cachingImage? Or would
  that result in the same amount of confusion? WDYT?

  As a couple of people has been confused by this...

  regards Nino



  Igor Vaynberg wrote:
   use NonCachingImage
  
   -igor
  
  
   On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
   [EMAIL PROTECTED] wrote:
  
   Hi,
  
I'm having problems with refreshing an Image using AjaxLink.
  
I have a ModalWindow. On it's left side theres a ListView containing Ajax
links:
  
--
add(listaObrazow = new ListView(pics, obrazki) {
public void populateItem(final ListItem listItem) {
final String obr = (String)listItem.getModelObject();
listItem.add(new Label(pic,new Model(obr)));
  
listItem.add(new AjaxLink(picAjaxLink) {
public void onClick(AjaxRequestTarget
ajaxRequestTarget) {
  
imgPreview.setImageResource(
EbokTools.getImageResource(
(String)listItem.getModelObject()
)
);
  
ajaxRequestTarget.addComponent(imgPreview);
  
  

 myModal.setObraz((String)listItem.getModelObject());
ajaxRequestTarget.addComponent(wyborObrazow);
}});
}
});
--
  
  
  
imgPreview is an Image object, placed on the same modal Window. What Im
trying to achieve is to refresh this image after the AjaxLink is clicked.
Unfortunately it doesn't. After I click on AjaxLink content of form
wyborObrazow is refreshed, but image stays unchanged.
  
Image resource is being changed - i know that because after i close modal
and open it again imgPreview is showing me  the right Resource.
  
The problem is that calling ajaxRequestTarget.addComponent(imgPreview);
after changing imageResource doesn't seem to be enough.
  
I would be very grateful for some hints.
  
best regards,
Zyx
  
--
  
-
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]
  
  
  

  --
  Nino Martinez Wael
  Java Specialist @ Jayway DK
  http://www.jayway.dk
  +45 2936 7684




  -
  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]



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-27 Thread Bernard Niset

Hi,
I had the same issue yesterday and found a solution somewhere else in 
this mailing list. Adding some random query to the url forces the 
browser not to reuse a cached image. To achieve that you have to 
subclass Image and override onComponentTag like this:


   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   String src = (String) tag.getAttributes().get(src);
   src = src + rand= + Math.random();
   tag.getAttributes().put(src, src);
   }

Bernard.


Igor Vaynberg wrote:

most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:
  

Should nocachingImage be default, and then have a cachingImage? Or would
 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView containing Ajax
   links:
 
   --
   add(listaObrazow = new ListView(pics, obrazki) {
   public void populateItem(final ListItem listItem) {
   final String obr = (String)listItem.getModelObject();
   listItem.add(new Label(pic,new Model(obr)));
 
   listItem.add(new AjaxLink(picAjaxLink) {
   public void onClick(AjaxRequestTarget
   ajaxRequestTarget) {
 
   imgPreview.setImageResource(
   EbokTools.getImageResource(
   (String)listItem.getModelObject()
   )
   );
 
   ajaxRequestTarget.addComponent(imgPreview);
 
 
   
myModal.setObraz((String)listItem.getModelObject());
   ajaxRequestTarget.addComponent(wyborObrazow);
   }});
   }
   });
   --
 
 
 
   imgPreview is an Image object, placed on the same modal Window. What Im
   trying to achieve is to refresh this image after the AjaxLink is clicked.
   Unfortunately it doesn't. After I click on AjaxLink content of form
   wyborObrazow is refreshed, but image stays unchanged.
 
   Image resource is being changed - i know that because after i close modal
   and open it again imgPreview is showing me  the right Resource.
 
   The problem is that calling ajaxRequestTarget.addComponent(imgPreview);
   after changing imageResource doesn't seem to be enough.
 
   I would be very grateful for some hints.
 
   best regards,
   Zyx
 
   --
 
   -
   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]
 
 
 

 --
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684




 -
 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]


  


--
Cordialement,
Bernard Niset.

SmartObjects SPRL
Avenue Hergé, 21/14
1050 - Bruxelles
BELGIQUE

Tel: +32 (0)2 770 68 04
Fax: +32 (0)2 791 92 78
E-mail: [EMAIL PROTECTED]




[Newbie question] How to avoid empty boxes?

2008-02-26 Thread Kaspar Fischer

I have just started looking at Wicket and have a basic question.

My page displays an article with meta-data from the database. I  
display the
meta-data in a box (a div.../div). If no meta-information is  
present,

I don't want the box (the div) to appear at all. Is there a generic,
Wicket-style way for achieving this?

I struggle with two things here:

* How to do the conditional markup? (For instance, if the article has no
  author meta-information, I don't want to show Authors:  in the  
box.)

* How to avoid empty boxes? (The box component would have to buffer its
  markup and check, in the end, whether it is nothing but whitespace.)

Thanks for any pointers.
Kaspar

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



AW: [Newbie question] How to avoid empty boxes?

2008-02-26 Thread Bernd Mrohs
Dear Kaspar,

Just check in your Java code if the meta data is empty before adding the box (I 
guess, a Panel) to your page. If it is empty, add an EmptyPanel, or a 
WebMarkupContainer instead, and call .setRenderBodyOnly(true) on the 
EmptyPanel/WebMarkupContainer. This disables the printing of the Component's 
tag. Then, there is nothing left on your page...

Kind regards,
Bernd

-Ursprüngliche Nachricht-
Von: Kaspar Fischer [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 26. Februar 2008 10:47
An: users@wicket.apache.org
Betreff: [Newbie question] How to avoid empty boxes?

I have just started looking at Wicket and have a basic question.

My page displays an article with meta-data from the database. I  
display the
meta-data in a box (a div.../div). If no meta-information is  
present,
I don't want the box (the div) to appear at all. Is there a generic,
Wicket-style way for achieving this?

I struggle with two things here:

* How to do the conditional markup? (For instance, if the article has no
   author meta-information, I don't want to show Authors:  in the  
box.)
* How to avoid empty boxes? (The box component would have to buffer its
   markup and check, in the end, whether it is nothing but whitespace.)

Thanks for any pointers.
Kaspar

-
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]



Re: [Newbie question] How to avoid empty boxes?

2008-02-26 Thread Gerolf Seitz
hi,
if no ajax is involved, i suggest reading [0] about wicket:enclosure.
this should do the trick.

cheers,
  gerolf

[0] http://www.systemmobile.com/?page_id=253

On Tue, Feb 26, 2008 at 10:47 AM, Kaspar Fischer [EMAIL PROTECTED]
wrote:

 I have just started looking at Wicket and have a basic question.

 My page displays an article with meta-data from the database. I
 display the
 meta-data in a box (a div.../div). If no meta-information is
 present,
 I don't want the box (the div) to appear at all. Is there a generic,
 Wicket-style way for achieving this?

 I struggle with two things here:

 * How to do the conditional markup? (For instance, if the article has no
   author meta-information, I don't want to show Authors:  in the
 box.)
 * How to avoid empty boxes? (The box component would have to buffer its
   markup and check, in the end, whether it is nothing but whitespace.)

 Thanks for any pointers.
 Kaspar

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




Re: [Newbie question] How to avoid empty boxes?

2008-02-26 Thread Nino Saturnino Martinez Vazquez Wael
hmm why do it complicated, just create a panel, and if your rules decide 
it then call setvisible(false)... then no markup will be visible from 
that component...


Kaspar Fischer wrote:

I have just started looking at Wicket and have a basic question.

My page displays an article with meta-data from the database. I 
display the

meta-data in a box (a div.../div). If no meta-information is present,
I don't want the box (the div) to appear at all. Is there a generic,
Wicket-style way for achieving this?

I struggle with two things here:

* How to do the conditional markup? (For instance, if the article has no
  author meta-information, I don't want to show Authors:  in the box.)
* How to avoid empty boxes? (The box component would have to buffer its
  markup and check, in the end, whether it is nothing but whitespace.)

Thanks for any pointers.
Kaspar

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




--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: [Newbie question] How to avoid empty boxes?

2008-02-26 Thread Kaspar Fischer

Dear Bernd, Gerolf, Nino,

Thanks a lot for your replies: in two minutes I learnt a lot!

For my particular needs, wicket:enclosure is not the perfect solution:
I have several children,

  wicket:enclosure child='child1'
div wicket:id=child1/div
div wicket:id=child2/div
  /wicket:enclosure

but using the child='...' syntax, the visibility is coupled to a  
specific

child while I need child1.visible OR child2.visible OR ... .

So I'll go with Nino's setVisible(false) approach.

Thanks a lot for the feedback! Much appreciated. - Kaspar

On 26.02.2008, at 11:06, Nino Saturnino Martinez Vazquez Wael wrote:

hmm why do it complicated, just create a panel, and if your rules  
decide it then call setvisible(false)... then no markup will be  
visible from that component...


Kaspar Fischer wrote:

I have just started looking at Wicket and have a basic question.

My page displays an article with meta-data from the database. I  
display the
meta-data in a box (a div.../div). If no meta-information is  
present,
I don't want the box (the div) to appear at all. Is there a  
generic,

Wicket-style way for achieving this?

I struggle with two things here:

* How to do the conditional markup? (For instance, if the article  
has no
  author meta-information, I don't want to show Authors:  in the  
box.)
* How to avoid empty boxes? (The box component would have to  
buffer its
  markup and check, in the end, whether it is nothing but  
whitespace.)


Thanks for any pointers.
Kaspar

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




--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
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]



Newbie question. Override class attributes from a tabPanel component

2008-01-03 Thread Fernando Wermus
I am trying to use the themes from Drupal in a wicket app. I need then to
override the class tag attributes for the ones named in the themes. But I
don't know how to do it, for instance in tabpanel tags such as li and ul. I
imagine is pretty easy.


for instance,

li class=tab0 selected

to

li class=menu-1-2-2

Thanks in advance.




-- 
Fernando Wermus.


Re: Newbie question. Override class attributes from a tabPanel component

2008-01-03 Thread Martijn Dashorst
Take a look at AttributeAppender, AttributeModifier or
SImpleAttributeModifier. You can add them to a component and they
allow you to modify tag attributes.

Martijn

On Jan 3, 2008 10:45 PM, Fernando Wermus [EMAIL PROTECTED] wrote:
 I am trying to use the themes from Drupal in a wicket app. I need then to
 override the class tag attributes for the ones named in the themes. But I
 don't know how to do it, for instance in tabpanel tags such as li and ul. I
 imagine is pretty easy.


 for instance,

 li class=tab0 selected

 to

 li class=menu-1-2-2

 Thanks in advance.




 --
 Fernando Wermus.




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

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



Re: Newbie question. Override class attributes from a tabPanel component

2008-01-03 Thread Igor Vaynberg
if you update to trunk there is a new overridable protected LoopItem
newTabContainer(int tabIndex);

-igor


On Jan 3, 2008 2:19 PM, Fernando Wermus [EMAIL PROTECTED] wrote:
 Great! I will take a look at that. Thanks!

 It seems to be hardcoded the tabbedPanel class attribute :(

 Looking at the code tabbedPanel constructor,

 protected LoopItem newItem(int iteration)
 {
 return new LoopItem(iteration)
 {
 private static final long serialVersionUID = 1L;

 protected void onComponentTag(ComponentTag tag)
 {
 super.onComponentTag(tag);
 String cssClass = (String)tag.getString(class);
 if (cssClass == null)
 {
 cssClass =  ;
 }
 cssClass +=  tab + getIteration();

 if (getIteration() == getSelectedTab())
 {
 cssClass +=  selected;
 }
 if (getIteration() == getIterations() - 1)
 {
 cssClass +=  last;
 }
 tag.put(class, cssClass.trim());
 }

 };


 On Jan 3, 2008 8:05 PM, Martijn Dashorst [EMAIL PROTECTED] wrote:

  Take a look at AttributeAppender, AttributeModifier or
  SImpleAttributeModifier. You can add them to a component and they
  allow you to modify tag attributes.
 
  Martijn
 
  On Jan 3, 2008 10:45 PM, Fernando Wermus [EMAIL PROTECTED]
  wrote:
   I am trying to use the themes from Drupal in a wicket app. I need then
  to
   override the class tag attributes for the ones named in the themes. But
  I
   don't know how to do it, for instance in tabpanel tags such as li and
  ul. I
   imagine is pretty easy.
  
  
   for instance,
  
   li class=tab0 selected
  
   to
  
   li class=menu-1-2-2
  
   Thanks in advance.
  
  
  
  
   --
   Fernando Wermus.
  
 
 
 
  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.0 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Fernando Wermus.


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



Re: Newbie question. Override class attributes from a tabPanel component

2008-01-03 Thread Fernando Wermus
Great! I will take a look at that. Thanks!

It seems to be hardcoded the tabbedPanel class attribute :(

Looking at the code tabbedPanel constructor,

protected LoopItem newItem(int iteration)
{
return new LoopItem(iteration)
{
private static final long serialVersionUID = 1L;

protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
String cssClass = (String)tag.getString(class);
if (cssClass == null)
{
cssClass =  ;
}
cssClass +=  tab + getIteration();

if (getIteration() == getSelectedTab())
{
cssClass +=  selected;
}
if (getIteration() == getIterations() - 1)
{
cssClass +=  last;
}
tag.put(class, cssClass.trim());
}

};

On Jan 3, 2008 8:05 PM, Martijn Dashorst [EMAIL PROTECTED] wrote:

 Take a look at AttributeAppender, AttributeModifier or
 SImpleAttributeModifier. You can add them to a component and they
 allow you to modify tag attributes.

 Martijn

 On Jan 3, 2008 10:45 PM, Fernando Wermus [EMAIL PROTECTED]
 wrote:
  I am trying to use the themes from Drupal in a wicket app. I need then
 to
  override the class tag attributes for the ones named in the themes. But
 I
  don't know how to do it, for instance in tabpanel tags such as li and
 ul. I
  imagine is pretty easy.
 
 
  for instance,
 
  li class=tab0 selected
 
  to
 
  li class=menu-1-2-2
 
  Thanks in advance.
 
 
 
 
  --
  Fernando Wermus.
 



 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

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




-- 
Fernando Wermus.


Newbie question - how to create a Default Data Table with onmouseover row style changes + link per row

2007-10-22 Thread Chris Ainsley

Hi,

I'm new to Wicket but can see in principle that it is a very good approach
to the clean seperation between the presentation layer and the
model/controller layer. That said, I'm having a hard time.

I wish to create a simple table that lists the contents of a table in the
database. I have created my per-record PoJo using Ammentos as my lightweight
persistance layer. The table is now displaying successfully, but I wish to
add a per-row css-style change event + per-row link (if the user clicks
anywhere in the tr area, I wish to be redirected to a link corresponding
to the ID of the current row (assuming a field called keyId in my PoJo
per-row model).

Here is a snippet of sample code:


MyPanel.java

public class MyPanel extends Panel {
public MyPanel () {
ListIColumn columns = new ArrayListIColumn ();

// add my columns to the column list

// i implemented this fine
SortableDataProvider sortableDataProvider = 
getDataModel(status);

_dataTable = new DefaultDataTable(bondTable, columns,
sortableDataProvider, 100);
add(_dataTable);
}
}


MyPanel.html

wicket:panel
table class=tablestyle1 cellspacing=0 wicket:id=myTable
My Table Table
/table
/wicket:panel



Please can anyone give me the correct approach or tell me if this is not
possible with the DefaultDataTable component. Its very hard to know what is
possible and what is not possible in Wicket due to lack of detailed user
manual. I am currently using version 1.2.6.

If anyone can help then I will be extremely grateful.

Thanks,

Chris.
-- 
View this message in context: 
http://www.nabble.com/Newbie-question---how-to-create-a-Default-Data-Table-with-onmouseover-row-style-changes-%2B-link-per-row-tf4675145.html#a13357267
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: Newbie question - how to create a Default Data Table with onmouseover row style changes + link per row

2007-10-22 Thread Igor Vaynberg
create a subclass of defaultdatatable, override newrowitem to be like this:

component newrowitem(...) {
  return new clickableitem(...) { onclick() { // implement onclick } }
}

class clickableitem extends item implements iclicklistener {
  oncomponenttag(tag) {
  tag.put(onclick,window.location='+urlfor(this,
iclicklistener.interface)+';);
  }

  final void onLinkClicked() { onclick(); }
  abstract void onclick();
}

-igor

On 10/22/07, Chris Ainsley [EMAIL PROTECTED] wrote:

 Hi,

 I'm new to Wicket but can see in principle that it is a very good approach
 to the clean seperation between the presentation layer and the
 model/controller layer. That said, I'm having a hard time.

 I wish to create a simple table that lists the contents of a table in the
 database. I have created my per-record PoJo using Ammentos as my lightweight
 persistance layer. The table is now displaying successfully, but I wish to
 add a per-row css-style change event + per-row link (if the user clicks
 anywhere in the tr area, I wish to be redirected to a link corresponding
 to the ID of the current row (assuming a field called keyId in my PoJo
 per-row model).

 Here is a snippet of sample code:


 MyPanel.java

 public class MyPanel extends Panel {
 public MyPanel () {
 ListIColumn columns = new ArrayListIColumn ();

 // add my columns to the column list

 // i implemented this fine
 SortableDataProvider sortableDataProvider = 
 getDataModel(status);

 _dataTable = new DefaultDataTable(bondTable, columns,
 sortableDataProvider, 100);
 add(_dataTable);
 }
 }


 MyPanel.html

 wicket:panel
 table class=tablestyle1 cellspacing=0 
 wicket:id=myTable
 My Table Table
 /table
 /wicket:panel



 Please can anyone give me the correct approach or tell me if this is not
 possible with the DefaultDataTable component. Its very hard to know what is
 possible and what is not possible in Wicket due to lack of detailed user
 manual. I am currently using version 1.2.6.

 If anyone can help then I will be extremely grateful.

 Thanks,

 Chris.
 --
 View this message in context: 
 http://www.nabble.com/Newbie-question---how-to-create-a-Default-Data-Table-with-onmouseover-row-style-changes-%2B-link-per-row-tf4675145.html#a13357267
 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]



Re: Newbie Question Loading localization Resources from Database

2007-10-02 Thread marcus dickerhof
Hi Eleco,
I' sorry somehow the problem with the locale being null is solved. I cannot
reconstruct it.
But the problem with the locale passed to
IStringResourceLoader.loadStringResource(..) being DE remains.

I have the feeling that the SessionLocale is not used. I verified this by
putting a label on the page (contents: getLocale().toString().) and doing a
System.out.println(locale: + locale.toString()); in the loadStringResouce
method.

I need to load the String resources from a database because the customer
wants to make changes to the text without re-deploying the war-file.
Do you need more infos? Thank you very much. I think wicket is a great
product, so far.

Best regards from germany
Marcus



2007/10/2, Eelco Hillenius [EMAIL PROTECTED]:

  //funny effect locale.getLanguage() -- Nullpointer Exception
  //I have to call locale.clone().getLanguage(). Is that normal? ?

 Could you give us the full stack trace please?

 Eelco

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




Re: Newbie Question Loading localization Resources from Database

2007-10-02 Thread marcus dickerhof
Hi Cristina,
thanks for your reply.
The problem is, that the session locale is changed, but somehow
there seems to be another locale present which is then passed to the
IStringResourceLoader.loadStringResource implementation.
Have you got any ideas?

Thanks a lot
Marcus

2007/10/2, Cristina [EMAIL PROTECTED]:


 Hi Marcus,


 marcus dickerhof wrote:
 
  [...]
  Question: Can it be, that the Session-Locale is not used, because of the
  Localizer-Problem? Which locale is used instead?
 

 If you're setting the Locale in your Session (probably a class that
 extends
 WebSession) and then getting the Locale through the Session, the warning
 about the Localizer doesn't mean, as far as I know, that the Session
 Locale
 isn't being used. Otherwise, the default Locale, which is defined by your
 browser settings, will be used.


 marcus dickerhof wrote:
 
  Is there a better way to get database-resource-strings?
 

 I believe .properties files are a better way to get localized strings...
 Is
 there any reason why you can't/shouldn't use them?

 Hope this helps,

 Cristina

 --
 View this message in context:
 http://www.nabble.com/Newbie-Question-Loading-localization-Resources-from-Database-tf4548742.html#a12990188
 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: Newbie Question Loading localization Resources from Database

2007-10-02 Thread marcus dickerhof
So,
I looked at the sources of Localizer,
for Tried to retrieve a localized string for a component that has not yet
been added to the page.  which is the warning i get.

In this case the Localizer calls loader.loadStringResource(component, key);
without passing a locale. That's why I always get the german text :-) Sorry!
But now how can I avoid this component that has not yet been added to the
page. problem?
When I use a wicket:message tag, do I also have to add that message to the
page-tree in my Java class manually?

Thanks
Marcus




2007/10/2, marcus dickerhof [EMAIL PROTECTED]:

 Hi Cristina,
 thanks for your reply.
 The problem is, that the session locale is changed, but somehow
 there seems to be another locale present which is then passed to the
 IStringResourceLoader.loadStringResource implementation.
 Have you got any ideas?

 Thanks a lot
 Marcus

 2007/10/2, Cristina [EMAIL PROTECTED]:
 
 
  Hi Marcus,
 
 
  marcus dickerhof wrote:
  
   [...]
   Question: Can it be, that the Session-Locale is not used, because of
  the
   Localizer-Problem? Which locale is used instead?
  
 
  If you're setting the Locale in your Session (probably a class that
  extends
  WebSession) and then getting the Locale through the Session, the warning
  about the Localizer doesn't mean, as far as I know, that the Session
  Locale
  isn't being used. Otherwise, the default Locale, which is defined by
  your
  browser settings, will be used.
 
 
  marcus dickerhof wrote:
  
   Is there a better way to get database-resource-strings?
  
 
  I believe .properties files are a better way to get localized strings...
  Is
  there any reason why you can't/shouldn't use them?
 
  Hope this helps,
 
  Cristina
 
  --
  View this message in context: 
  http://www.nabble.com/Newbie-Question-Loading-localization-Resources-from-Database-tf4548742.html#a12990188
 
  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: Newbie Question Loading localization Resources from Database

2007-10-02 Thread marcus dickerhof
Hi I just found out that this issue should be fixed in wicket 1.3.0 beta 4
(wicket-issue 936). Where can I get that? Which is the current release, best
suited for a production environment?
Thanks!

Marcus



2007/10/2, marcus dickerhof [EMAIL PROTECTED]:

 So,
 I looked at the sources of Localizer,
 for Tried to retrieve a localized string for a component that has not yet
 been added to the page.  which is the warning i get.

 In this case the Localizer calls loader.loadStringResource(component,
 key); without passing a locale. That's why I always get the german text :-)
 Sorry!
 But now how can I avoid this component that has not yet been added to the
 page. problem?
 When I use a wicket:message tag, do I also have to add that message to the
 page-tree in my Java class manually?

 Thanks
 Marcus




 2007/10/2, marcus dickerhof  [EMAIL PROTECTED]:
 
  Hi Cristina,
  thanks for your reply.
  The problem is, that the session locale is changed, but somehow
  there seems to be another locale present which is then passed to the
  IStringResourceLoader.loadStringResource implementation.
  Have you got any ideas?
 
  Thanks a lot
  Marcus
 
  2007/10/2, Cristina  [EMAIL PROTECTED]:
  
  
   Hi Marcus,
  
  
   marcus dickerhof wrote:
   
[...]
Question: Can it be, that the Session-Locale is not used, because of
   the
Localizer-Problem? Which locale is used instead?
   
  
   If you're setting the Locale in your Session (probably a class that
   extends
   WebSession) and then getting the Locale through the Session, the
   warning
   about the Localizer doesn't mean, as far as I know, that the Session
   Locale
   isn't being used. Otherwise, the default Locale, which is defined by
   your
   browser settings, will be used.
  
  
   marcus dickerhof wrote:
   
Is there a better way to get database-resource-strings?
   
  
   I believe .properties files are a better way to get localized
   strings... Is
   there any reason why you can't/shouldn't use them?
  
   Hope this helps,
  
   Cristina
  
   --
   View this message in context: 
   http://www.nabble.com/Newbie-Question-Loading-localization-Resources-from-Database-tf4548742.html#a12990188
  
   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: Newbie Question Loading localization Resources from Database

2007-10-02 Thread Frank Bille
On 10/2/07, marcus dickerhof [EMAIL PROTECTED] wrote:

 Hi I just found out that this issue should be fixed in wicket 1.3.0 beta 4
 (wicket-issue 936). Where can I get that?


beta4 is not released yet. If nothing comes in the way I will release beta4
this weekend.


Frank


Newbie Question Loading localization Resources from Database

2007-10-01 Thread marcus dickerhof
Hi,
could you please help me with the following problem:
I use wicket 1.3.0 beta 3 + java 1.4.2 + tomcat 5.5

I wrote a small page that has a wicket:message key=helloWorld

when running tomcat I get:
[Localizer] Tried to retrieve a localized string for a component that has
not yet been added to the page. This can sometimes lead to an invalid or no
localized resource returned. Make sure you are not calling
Component#getString() inside your Component's constructor. Offending
component: [Page class = com.ppa.ubs.lbs.pages.Login, id = 0, version = 7,
ajax = 0]

Then I wrote a DatabaseResourceLoader implementing IStringResourceLoader

public String loadStringResource(Class clazz, String key, Locale locale,
String style) {

//funny effect locale.getLanguage() -- Nullpointer Exception
//I have to call locale.clone().getLanguage(). Is that normal? ?
... do some db lookup
}



Then I added some changeLocale-Links to the page constructor:

add( new Link(localeEN){
public void onClick() {
getSession().setLocale(new Locale(en, EN));
}
});
add( new Link(localeDE){
public void onClick() {
getSession().setLocale(new Locale(de, DE));
}
});


The problem: When I change the locale through the Links, the message still
remains the same. The locale passed to the DatabaseResourceLoader always is
DE (german).
Question: Can it be, that the Session-Locale is not used, because of the
Localizer-Problem? Which locale is used instead?
Is there a better way to get database-resource-strings?

Thanks for your help in advance

Best regards
Marcus


Re: Newbie Question Loading localization Resources from Database

2007-10-01 Thread Cristina

Hi Marcus,


marcus dickerhof wrote:
 
 [...]
 Question: Can it be, that the Session-Locale is not used, because of the
 Localizer-Problem? Which locale is used instead?
 

If you're setting the Locale in your Session (probably a class that extends
WebSession) and then getting the Locale through the Session, the warning
about the Localizer doesn't mean, as far as I know, that the Session Locale
isn't being used. Otherwise, the default Locale, which is defined by your
browser settings, will be used.


marcus dickerhof wrote:
 
 Is there a better way to get database-resource-strings?
 

I believe .properties files are a better way to get localized strings... Is
there any reason why you can't/shouldn't use them?

Hope this helps,

Cristina

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question-Loading-localization-Resources-from-Database-tf4548742.html#a12990188
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: Newbie Question Loading localization Resources from Database

2007-10-01 Thread Eelco Hillenius
 //funny effect locale.getLanguage() -- Nullpointer Exception
 //I have to call locale.clone().getLanguage(). Is that normal? ?

Could you give us the full stack trace please?

Eelco

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



  1   2   >