Trigger client machine program

2007-11-22 Thread raybristol

Hi, 

I need to trigger a program which installed on client machine when use press
a button from a web page, I wonder what's the best way to do it? Any links?

Many thanks,
Ray
-- 
View this message in context: 
http://www.nabble.com/Trigger-client-machine-program-tf4855543.html#a13894375
Sent from the Wicket - User mailing list archive at Nabble.com.


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



how to call a javascript function?

2007-11-15 Thread raybristol

Hi, I have a form in a page, after user fill some data in and press 'Save' I
want to call/or not to call a javascript function, in my code I was try to
do like:

Form form = new Form(form, new CompoundPropertyModel(this)){
protected void onSubmit(){
activity.setReference(reference);

(new ActivityManager()).storeActivity(activity);
//setResponsePage(new ActivityTypesMenu());
}};

TextField activityDateTF = new TextField(activityDate, new
PropertyModel(this,reference));
activityDateTF.setRequired(true);
form.add(activityDateTF);
Button saveBtn = new Button(save);
saveBtn.add(
new SimpleAttributeModifier(
onclick, something();));


form.add(saveBtn);

add(form);

However I don't think I am doing it right, one thing that javascript
function not be called so I am asking help again here...

Many thanks again.
-- 
View this message in context: 
http://www.nabble.com/how-to-call-a-javascript-function--tf4813502.html#a13771231
Sent from the Wicket - User mailing list archive at Nabble.com.


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



working with JSP problem, thanks!

2007-11-14 Thread raybristol

Hi, my wicket pages need to be worked with some other jsp pages, and for some
reason I need two startup place so in xml conf files I got:

  servlet
servlet-nameAdminPagesApplication/servlet-name
   
servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
  param-nameapplicationClassName/param-name
 
param-valueapto.umbrella.wicketInterface.AdminPagesApplication/param-value
/init-param
  /servlet

  
  servlet-mapping
servlet-nameAdminPagesApplication/servlet-name
url-pattern/Admin/*/url-pattern
  /servlet-mapping


so I was try to put more something like:

  servlet
servlet-nameAdminPagesApplication/servlet-name
   
servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
  param-nameapplicationClassName/param-name
 
param-valueapto.umbrella.wicketInterface.AdminPagesApplication/param-value
 
param-valueapto.umbrella.wicketInterface.AdminPagesApplication2/param-value
/init-param
  /servlet

  
  servlet-mapping
servlet-nameAdminPagesApplication/servlet-name
url-pattern/Admin/*/url-pattern
servlet-nameAdminPagesApplication2/servlet-name
url-pattern/Admin2/*/url-pattern
  /servlet-mapping

But then it won't work, I think it probably something really simple to
change, sorry to bother again for those newbie questions!

Many thanks,
Ray
-- 
View this message in context: 
http://www.nabble.com/working-with-JSP-problem%2C-thanks%21-tf4804711.html#a13745657
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: required field in a form, help :)

2007-11-14 Thread raybristol

Thansk very much, I finally use a Link instead, much better.





Martijn Dashorst wrote:
 
 Read the JavaDoc of Button:
 
 One other option you should know of is the 'defaultFormProcessing'
 property of Button components.
 When you set this to false (default is true), all validation and
 formupdating is bypassed and the
 onSubmit method of that button is called directly, and the onSubmit
 method of the parent form is
 not called. A common use for this is to create a cancel button.
 
 Or search the archives:
 
 http://www.nabble.com/forum/Search.jtp?query=skip+form+validation+buttonlocal=yforum=13974
 
 Martijn
 
 On 11/14/07, raybristol [EMAIL PROTECTED] wrote:

 Hi, I have some inputs in a form, some are required field, they work fine
 when I press 'submit' button, however, I also include a cancel button, in
 which onclick event my code is like:

  add(new Button(cancel){
 public void onClick() {
 setResponsePage(new ActivityTypeList());
 }
 });


 But I think it's probably button 'cancel' has attribute type='submit' in
 html page, but I can't put reset, so I don't know what to do to avoid the
 validation when user press 'cancel' ?

 Many thanks,
 Ray
 --
 View this message in context:
 http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13744215
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.0-rc1 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13745654
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: working with JSP problem, thanks!

2007-11-14 Thread raybristol

Thanks, it was quite obvious sorry 




Dipu Seminlal wrote:
 
 i think you should be doing this
 
 servlet
   servlet-nameAdminPagesApplication/servlet-name
 
 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
   param-nameapplicationClassName/param-name
   
 param-valueapto.umbrella.wicketInterface.AdminPagesApplication/param-value
   /init-param
 /servlet
 
 servlet
   servlet-nameAdminPagesApplication2/servlet-name
 
 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
   param-nameapplicationClassName/param-name
   
 param-valueapto.umbrella.wicketInterface.AdminPagesApplication2/param-value
   /init-param
 /servlet
 
 
  servlet-mapping
servlet-nameAdminPagesApplication/servlet-name
url-pattern/Admin/*/url-pattern
  /servlet-mapping
 
  servlet-mapping
 servlet-nameAdminPagesApplication2/servlet-name
 url-pattern/Admin2/*/url-pattern
  /servlet-mapping
 
 -dipu
 
 On Nov 14, 2007 12:23 PM, raybristol [EMAIL PROTECTED] wrote:

 Hi, my wicket pages need to be worked with some other jsp pages, and for
 some
 reason I need two startup place so in xml conf files I got:

   servlet
 servlet-nameAdminPagesApplication/servlet-name

 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
 init-param
   param-nameapplicationClassName/param-name

 param-valueapto.umbrella.wicketInterface.AdminPagesApplication/param-value
 /init-param
   /servlet


   servlet-mapping
 servlet-nameAdminPagesApplication/servlet-name
 url-pattern/Admin/*/url-pattern
   /servlet-mapping


 so I was try to put more something like:

   servlet
 servlet-nameAdminPagesApplication/servlet-name

 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
 init-param
   param-nameapplicationClassName/param-name

 param-valueapto.umbrella.wicketInterface.AdminPagesApplication/param-value

 param-valueapto.umbrella.wicketInterface.AdminPagesApplication2/param-value
 /init-param
   /servlet


   servlet-mapping
 servlet-nameAdminPagesApplication/servlet-name
 url-pattern/Admin/*/url-pattern
 servlet-nameAdminPagesApplication2/servlet-name
 url-pattern/Admin2/*/url-pattern
   /servlet-mapping

 But then it won't work, I think it probably something really simple to
 change, sorry to bother again for those newbie questions!

 Many thanks,
 Ray
 --
 View this message in context:
 http://www.nabble.com/working-with-JSP-problem%2C-thanks%21-tf4804711.html#a13745657
 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]
 
 
 
:blush:
-- 
View this message in context: 
http://www.nabble.com/working-with-JSP-problem%2C-thanks%21-tf4804711.html#a13746468
Sent from the Wicket - User mailing list archive at Nabble.com.


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



DataView question, please help, thanks!

2007-11-08 Thread raybristol

I am using DataView to show a list, in my html page, I got: 
table border='1' class=ms-prof-main
tr
th 
class=ms-prof-topBox ID/th
th 
class=ms-prof-topClient name/th
th 
class=ms-prof-topJob profile/th
th 
class=ms-prof-topBox status/th
th 
class=ms-prof-topStore Location/th
th 
class=ms-prof-topTime in prep/th
th 
class=ms-prof-topTime in scan/th
th 
class=ms-prof-topDelete/th
/tr
tr wicket:id=boxList
td wicket:id 
=boxID class=ms-prof-evenboxID/td
td wicket:id 
=clientName class=ms-prof-evenclientName/td
td wicket:id 
=JobProfileName
class=ms-prof-evenJobProfileName/td
td wicket:id 
=BoxStatus class=ms-prof-evenBoxStatus/td
td wicket:id 
=StoreLocation
class=ms-prof-evenStoreLocation/td
td wicket:id 
=PreppedTime class=ms-prof-evenPreppedTime/td
td wicket:id 
=ScannedTime class=ms-prof-evenScannedTime/td
td 
class=ms-prof-even Delete /td
/tr
/table 

then in code behind I use protected void populateItem(Item item) to
specified each table cell's data, because I can put any String in td tag so
I can easily put any javascript function call, however, I want to do that
for each row as well, so the tr tag, such as when use click on a row,
something happen, but I can't find where I can put this ability from the
code behind?

Many thanks for your help!
-- 
View this message in context: 
http://www.nabble.com/DataView-question%2C-please-help%2C-thanks%21-tf4770079.html#a13644400
Sent from the Wicket - User mailing list archive at Nabble.com.


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



problem of updating a panel

2007-11-06 Thread raybristol

Hi chaps, I am using a panel in a page, and I actually using a DataView with
paging enable in the panel for show some data, I pass the datasource from
the webpage to that panel, something Like final Panel p = new
BoxListPanel(boxListView,boxList);, everything is fine, but now the data
getting too much so I decide to use lazy_loading like the repeater in wicket
example: http://www.wicketstuff.org/wicket13/repeater/ so I only get the
data I actully need for the page, and it was working fine, however, in my
page user can customize the data source, so I need to update the panel after
user click on some ajaxLink, I can do this in previous way but after I use
the IDataProvider like the example in repeater, I can't update the panel, in
my page I define the panel like:

final Panel p = new myPanel(boxListView,new
BoxDataProvider(selectContion));

so I actully then pass a selectContion for the panel instead the actualy
data source, but it only working at the first load, if I change the
selectContion, the data is not changing, but if I pass in the actully data
then it's fine.

I hope this make sense... or is there any other good lazy-data loading
examples?
-- 
View this message in context: 
http://www.nabble.com/problem-of-updating-a-panel-tf4758150.html#a13606873
Sent from the Wicket - User mailing list archive at Nabble.com.


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



how to add a confirm window to a Link button?

2007-10-26 Thread raybristol

I use PageableListView to make a table and there is a column called 'delete',
which works fine but I want to add a confirm window so when people click
'delete' a window will pop up asking 'yes' or 'no', in html, this can be
done use javascript, but with wicket control link button, how to add to it?


final PageableListView listView = new PageableListView(boxList,
thisBoxList, 10) {
protected void populateItem(ListItem item) {
final Box box = (Box)item.getModelObject();

final int index = item.getIndex();
item.add(new Label(boxID, String.valueOf(box.getBarcode(;
item.add(new Label(JobProfileName, box.getJobProfileName()));

item.add(new Link(Delete) {
public void
onClick() {

mpm.deleteBox(box.getBarcode());
thisBoxList.remove(index);
}
});
}
};


Many thanks!
-- 
View this message in context: 
http://www.nabble.com/how-to-add-a-confirm-window-to-a-Link-button--tf4696906.html#a13425883
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: how to add a confirm window to a Link button?

2007-10-26 Thread raybristol

That's great sample, thanks so much Jan, I will try that soon!




Jan Kriesten wrote:
 
 
 just add a behavior to the link which ads a javascript 'onclick':
 
 public class JavascriptEventConfirmation
 extends AttributeModifier
 {
   private static final long serialVersionUID = 1L;
 
   public JavascriptEventConfirmation( final String event, final String msg
 )
   {
 super( event, true, new Model( msg ) );
   }
 
   @Override
   protected String newValue( final String currentValue, final String
 replacementValue )
   {
 if( currentValue != null  currentValue.length() != 0 )
 {
   StringBuilder result = new StringBuilder( 256 );
   result.append( if( confirm(' );
   result.append( escape( replacementValue ) );
   result.append( ') ){ );
   result.append( currentValue );
   result.append( } else return false; );
   return (result.toString());
 }
 else
 {
   return (return confirm(' + escape( replacementValue ) + '));
 }
   }
 
   private String escape( final String text )
   {
 if( text == null )
 {
   return (null);
 }
 
 return (text.replaceAll( \, quot; ));
   }
 
 }
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/how-to-add-a-confirm-window-to-a-Link-button--tf4696906.html#a13427749
Sent from the Wicket - User mailing list archive at Nabble.com.


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



question about 'isInstantiationAuthorized' method, thanks!

2007-10-23 Thread raybristol

Hi, I am using isInstantiationAuthorized method in a application class for
some simply security check, which is working fine, if the user doesn't have
the right to access a page, page display:

Access Denied
You do not have access to the page you requested.

Return to home page


However, I can't change the url for 'Return to home page' link, as the
homepage is a jsp page but 'Return to home page' link just send me to the
default wicket homepage which specifed in xml file right? I wonder is there
a way to change it as I am working with some jsp pages.

Many thanks!
-- 
View this message in context: 
http://www.nabble.com/question-about-%27isInstantiationAuthorized%27-method%2C-thanks%21-tf4676368.html#a13360843
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: question about 'isInstantiationAuthorized' method, thanks!

2007-10-23 Thread raybristol

Thanks everyone, I will try it now :)



Gerolf Seitz wrote:
 
 you can set your own AccessDeniedPage in Application.init():
 
 getApplicationSettings.setAccessDeniedPage(
 MyAccessDeniedPageWithLinkToJspPage.class);
 
   Gerolf
 
 On 10/23/07, raybristol [EMAIL PROTECTED] wrote:


 Hi, I am using isInstantiationAuthorized method in a application class
 for
 some simply security check, which is working fine, if the user doesn't
 have
 the right to access a page, page display:

 Access Denied
 You do not have access to the page you requested.

 Return to home page


 However, I can't change the url for 'Return to home page' link, as the
 homepage is a jsp page but 'Return to home page' link just send me to the
 default wicket homepage which specifed in xml file right? I wonder is
 there
 a way to change it as I am working with some jsp pages.

 Many thanks!
 --
 View this message in context:
 http://www.nabble.com/question-about-%27isInstantiationAuthorized%27-method%2C-thanks%21-tf4676368.html#a13360843
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/question-about-%27isInstantiationAuthorized%27-method%2C-thanks%21-tf4676368.html#a13361043
Sent from the Wicket - User mailing list archive at Nabble.com.


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



dummy question, how to set wicket in Deloyment mode?

2007-10-23 Thread raybristol

dummy question, how to set wicket in Deloyment mode? There is a
Application#getConfigurationType() but I expect something like
Application#setConfigurationType() which does not exist so I thing I must
miss something here...

Many thanks
-- 
View this message in context: 
http://www.nabble.com/dummy-question%2C-how-to-set-wicket-in-Deloyment-mode--tf4677449.html#a13364304
Sent from the Wicket - User mailing list archive at Nabble.com.


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



how to change format in DateTimeField?

2007-10-18 Thread raybristol

there is a good example about use DateTextfield in :
http://www.wicketstuff.org/wicket13/dates/?wicket:bookmarkablePage=sources%3Aorg.apache.wicket.examples.dates.DatesPage

however, I want to add the time field as well, so I found DateTimeField
which is working, however i don't know how to change the format of the date
it displayed,  in DateTextfield I believe I can do that with using its
constructor: new DateTextField(dateTextField, new
PropertyModel(this,date), new StyleDateConverter(S-, true)), but
DateTimeField only has a constructor: new
DateTimeField(dateTimeFromTextField, new PropertyModel(this, date)) so I
don't know how to change its format, also I want to prevent user to type in
invalid date in the text field as well, becuase if user type some letters in
the textfield next to the date picker then the date picker won't start
properly as well.

I might asking dump question becuase I am too new to wicket (I use asp.net
before).


Many thanks!

-- 
View this message in context: 
http://www.nabble.com/how-to-change-format-in-DateTimeField--tf4646276.html#a13272285
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: how to change format in DateTimeField?

2007-10-18 Thread raybristol

Thanks for your reply, I actually mean DateTimeField and I want to do the
same thing as in DateTextField, because I need no only the date but the time
as well.

Many thanks
Ray




Alex Objelean wrote:
 
 You mean DateTextField (instead of DateTimeField). It has also this
 constructor:
 DateTextField(String id, IModel model, String datePattern)
 where datePattern can be: dd/MM/.
 
 Alex
 
 
 raybristol wrote:
 
 there is a good example about use DateTextfield in :
 http://www.wicketstuff.org/wicket13/dates/?wicket:bookmarkablePage=sources%3Aorg.apache.wicket.examples.dates.DatesPage
 
 however, I want to add the time field as well, so I found DateTimeField
 which is working, however i don't know how to change the format of the
 date it displayed,  in DateTextfield I believe I can do that with using
 its constructor: new DateTextField(dateTextField, new
 PropertyModel(this,date), new StyleDateConverter(S-, true)), but
 DateTimeField only has a constructor: new
 DateTimeField(dateTimeFromTextField, new PropertyModel(this, date))
 so I don't know how to change its format, also I want to prevent user to
 type in invalid date in the text field as well, becuase if user type some
 letters in the textfield next to the date picker then the date picker
 won't start properly as well.
 
 I might asking dump question becuase I am too new to wicket (I use
 asp.net before).
 
 
 Many thanks!
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/how-to-change-format-in-DateTimeField--tf4646276.html#a13276631
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: hi questions about DateField, thanks!

2007-10-17 Thread raybristol

Thanks very much, I was looking at the log files in tomcat, but I don't think
I found anything but in the console (I am using eclipse), I saw:

17-Oct-2007 10:53:41 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet NiceUrlApplication threw exception
javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)




Eelco Hillenius wrote:
 
 Your code looks fine to me. We really need to see that stack trace.
 
 Eelco
 
 
 On 10/16/07, raybristol [EMAIL PROTECTED] wrote:

 Hi, I try to add a datefield to my page, accroding to the examples in
 http://www.wicketstuff.org/wicket13/index.html

 but I get a error and then I try to do it on a sperate page just for
 testing
 but getting the same error:

 type Exception report

 message

 description The server encountered an internal error () that prevented it
 from fulfilling this request.

 exception

 javax.servlet.ServletException: Servlet execution threw an exception


 note The full stack trace of the root cause is available in the Apache
 Tomcat/6.0.14 logs.


 However about error message doesn't tell me anything, and the code is
 really
 simple:

 java code:

 public class DateFieldTest extends WebPage{
 private Date date = new Date();

 public DateFieldTest(){
 Form form = new Form(form);
 DateTextField dateTextField = new DateTextField(dateTextField,
 new
 PropertyModel(this,
 date), new StyleDateConverter(S-, true));
 form.add(dateTextField);
 dateTextField.add(new DatePicker());
 add(form);
 }

 }

 Html code:
 ?xml version=1.0 encoding=UTF-8?
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 titleWicket Examples - dates/title

 /head
 body

 form wicket:id=form
 input type=text wicket:id=dateTextField /
 input type=submit value=submit /
 /form

 /body
 /html


 Thanks for this forum, I am getting lots help from here, many many thanks
 again!

 Ray


 --
 View this message in context:
 http://www.nabble.com/hi-questions-about-DateField%2C-thanks%21-tf4635435.html#a13237803
 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/hi-questions-about-DateField%2C-thanks%21-tf4635435.html#a13250347
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: hi questions about DateField, thanks!

2007-10-17 Thread raybristol

I found the problem, it's because my Tomcat has confict severlet jar files...
thanks very much!




raybristol wrote:
 
 Hi, I try to add a datefield to my page, accroding to the examples in
 http://www.wicketstuff.org/wicket13/index.html
 
 but I get a error and then I try to do it on a sperate page just for
 testing but getting the same error:
 
 type Exception report
 
 message 
 
 description The server encountered an internal error () that prevented it
 from fulfilling this request.
 
 exception 
 
 javax.servlet.ServletException: Servlet execution threw an exception
 
 
 note The full stack trace of the root cause is available in the Apache
 Tomcat/6.0.14 logs.
 
 
 However about error message doesn't tell me anything, and the code is
 really simple:
 
 java code:
 
 public class DateFieldTest extends WebPage{
   private Date date = new Date();
 
   public DateFieldTest(){
   Form form = new Form(form);
   DateTextField dateTextField = new DateTextField(dateTextField, new
 PropertyModel(this,
 date), new StyleDateConverter(S-, true));
   form.add(dateTextField);
 dateTextField.add(new DatePicker());
 add(form);
   }
 
 }
 
 Html code:
 ?xml version=1.0 encoding=UTF-8?
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 titleWicket Examples - dates/title
 
 /head
 body
 
 form wicket:id=form
 input type=text wicket:id=dateTextField / 
 input type=submit value=submit /
 /form
 
 /body
 /html
 
 
 Thanks for this forum, I am getting lots help from here, many many thanks
 again!
 
 Ray
 
 
 

-- 
View this message in context: 
http://www.nabble.com/hi-questions-about-DateField%2C-thanks%21-tf4635435.html#a13254937
Sent from the Wicket - User mailing list archive at Nabble.com.


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



hi questions about DateField, thanks!

2007-10-16 Thread raybristol

Hi, I try to add a datefield to my page, accroding to the examples in
http://www.wicketstuff.org/wicket13/index.html

but I get a error and then I try to do it on a sperate page just for testing
but getting the same error:

type Exception report

message 

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception 

javax.servlet.ServletException: Servlet execution threw an exception


note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.14 logs.


However about error message doesn't tell me anything, and the code is really
simple:

java code:

public class DateFieldTest extends WebPage{
private Date date = new Date();

public DateFieldTest(){
Form form = new Form(form);
DateTextField dateTextField = new DateTextField(dateTextField, new
PropertyModel(this,
date), new StyleDateConverter(S-, true));
form.add(dateTextField);
dateTextField.add(new DatePicker());
add(form);
}

}

Html code:
?xml version=1.0 encoding=UTF-8?
html xmlns=http://www.w3.org/1999/xhtml;
head
titleWicket Examples - dates/title

/head
body

form wicket:id=form
input type=text wicket:id=dateTextField / 
input type=submit value=submit /
/form

/body
/html


Thanks for this forum, I am getting lots help from here, many many thanks
again!

Ray


-- 
View this message in context: 
http://www.nabble.com/hi-questions-about-DateField%2C-thanks%21-tf4635435.html#a13237803
Sent from the Wicket - User mailing list archive at Nabble.com.


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



DropDownChoice - how to get the current selected value and I can't use OnSelected event as well :(

2007-10-15 Thread raybristol

Hi, I am quite new to wicket and got 2 questions about DropDownChoice don't
know how to solve even after some googling as well from this forum so need
some helps again:

1. I want to get the current selected item's value from DropDownChoice, I
was looking for something like 

DropDownChoiceObject.selectedValueOrID() - something equitvalent, I saw the
example from wicket website, it's using:

DropDownChoice ddc = 
new DropDownChoice(name, 
new PropertyModel(employee, managedBy),
new LoadableDetachableModel() {
   ...
}
);

so do I have to pass in a PropertyModel to achieve what I want? mine is:

final MapString, String choiceMap = new HashMapString, 
String(); 
final ListString jpNameString = new ArrayList();
for (JobProfile j : jobProfiles){
choiceMap.put(String.valueOf(j.getId()), j.getName());
jpNameString.add(String.valueOf(j.getId()));
}
IChoiceRenderer renderer = new ChoiceRenderer() {
public Object getDisplayValue(Object object) {
return choiceMap.get(object);}
public String getIdValue(Object object, int index) { 
return object.toString(); 
} 

};

final DropDownChoice ddc = new DropDownChoice(
filterByJobProfileName, jpNameString, renderer)


2. my second question is how to use event OnSelectionChange, I saw two
events from the API, one is final so I can't overide, one is pretected:

final void onSelectionChanged()
protected  void onSelectionChanged(java.lang.Object newSelection) 

I can't use either like:

  final DropDownChoice ddc = new DropDownChoice( filterByJobProfileName,
jpNameString, renderer){
   void onSeclectionChanged(){
//I want to do somethign here if this is working :(
   }
};



Many thanks for your help!

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice---how-to-get-the-current-selected-value-and-I-can%27t-use-OnSelected-event-as-well-%3A%28-tf4627230.html#a13212219
Sent from the Wicket - User mailing list archive at Nabble.com.


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



hi questions about Wizard again, thanks!

2007-09-26 Thread raybristol

Hi, sorry to ask questions again

I have a WizardPage, got 2 questions don't really know how to solve, 

My WizardPage is like

public class AddDeliveryWizardPage extends AbstractExamplePage{

public AddDeliveryWizardPage(){

super();

WizardModel model = new WizardModel();
  int numberOfBoxes = 0;
  ListBox boxesList = new ArrayListBox();

  //variable 'numberOfBoxes' will be set in this
step
model.add(new SetNumberOfBoxesWizardStep());

  //set box entity objects according to variable
'numberOfBoxes' set from last step
model.add(new SetBoxEntityWizardStep(int numberOfBoxes));

Wizard wizard = new Wizard(wizard, model)
this.add(wizard);
}

}

question 1: as model step is added at compile time, so I don't know how to
get the value of variable 'numberOfBoxes' after it got set from the 1st
step, in the 2nd step 'numberOfBoxes''s value is default value 0.

question 2: in the 2nd step I probably need user to input multiple box
object's details, for a single model, I can use somthign like setModel(new
CompoundPropertyModel(box)), but what about for multiple objects? is it
something like setModel(new CompoundPropertyModel(boxeslist))  - boxeslist
is a arraylist of box objects.


Many thanks for your guys help, this is the best forum I can find for wicket
:)

-- 
View this message in context: 
http://www.nabble.com/hi-questions-about-Wizard-again%2C-thanks%21-tf4521282.html#a12897888
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: hi questions about Wizard again, thanks!

2007-09-26 Thread raybristol

Thansk very much, love this forum! got a reply so prompt!



Andrew Klochkov wrote:
 
 raybristol wrote:
 My WizardPage is like

 public class AddDeliveryWizardPage extends AbstractExamplePage{
  
  public AddDeliveryWizardPage(){
  
  super();

  WizardModel model = new WizardModel();
   int numberOfBoxes = 0;
   ListBox boxesList = new ArrayListBox();

   //variable 'numberOfBoxes' will be set in this
 step
  model.add(new SetNumberOfBoxesWizardStep());
  
   //set box entity objects according to variable
 'numberOfBoxes' set from last step
  model.add(new SetBoxEntityWizardStep(int numberOfBoxes));
  
  Wizard wizard = new Wizard(wizard, model)
  this.add(wizard);
  }

 }

 question 1: as model step is added at compile time, so I don't know how
 to
 get the value of variable 'numberOfBoxes' after it got set from the 1st
 step, in the 2nd step 'numberOfBoxes''s value is default value 0.
   
 You should make numberOfBoxes variable accessible in both the steps. One 
 way to do it:
 
 public class AddDeliveryWizardPage extends AbstractExamplePage{
   
   private int numberOfBoxes;
 private final ListBox boxesList = new ArrayListBox();
 
   public AddDeliveryWizardPage(){
   
   super();
 
   IModel boxesAmountModel = new PropertyModel(this, 
 numberOfBoxes);
   WizardModel model = new WizardModel();
 
   //variable 'numberOfBoxes' will be set in this step
   model.add(new SetNumberOfBoxesWizardStep(boxesAmountModel) {
   public void applyState() {
   for (int i = 0; i  numberOfBoxes; i++)
   boxesList.add(new Box());
   }
   });
   
   //set box entity objects according to variable 'numberOfBoxes' 
 set from
 last step
   model.add(new SetBoxEntityWizardStep(boxesAmountModel, 
 boxesList));
   
   Wizard wizard = new Wizard(wizard, model)
   this.add(wizard);
   }
 
 }
 
 question 2: in the 2nd step I probably need user to input multiple box
 object's details, for a single model, I can use somthign like
 setModel(new
 CompoundPropertyModel(box)), but what about for multiple objects? is it
 something like setModel(new CompoundPropertyModel(boxeslist))  -
 boxeslist
 is a arraylist of box objects.
   
 Notice that I added a boxesList parameter for the second step in the 
 code above. So then in the SexBoxEntityWizardStep you could use some 
 repeater to generate html inputs for every box. For example here is a 
 ListView example:
 
 add(new ListView(boxes, boxesList) {
 protected void populateItem(final ListItem item) {
 item.add(new TextField(name, new 
 PropertyModel(item.getModelObject(), name));
 }
 });

 Many thanks for your guys help, this is the best forum I can find for
 wicket
 :)

   
 +1 :)
 
 
 -- 
 Andrew Klochkov
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/hi-questions-about-Wizard-again%2C-thanks%21-tf4521282.html#a12899730
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 about using WizardStep, help! thanks!

2007-09-25 Thread raybristol

Great! that's what I want, thanks so much and sorry for my stupid questions
:)



Eelco Hillenius wrote:
 
 Hi experts,

 I want to implement a wizard, user need to input some data, I can do it
 with
 a single page using form, but I don't know how to do it in wizard, I put
 a
 couple of input textfield etc. then I get a error:

 java.lang.IllegalStateException: Attempt to set model object on null
 model
 of component: wizard:form:view:expectedNumberOfBoxes

 Note: expectedNumberOfBoxes is the first textfield I declared in the java
 class, after googling a few hours(not too much information) I think I
 need
 to setup a 'model'? but I probably need more details how... my code is
 like:

 public class DeliveryDetails extends WizardStep {


 public DeliveryDetails(Delivery delivery, String title, String
 content){
 super(title, content);

 RequiredTextField expectedNumberOfBoxesTextField = new
 RequiredTextField(expectedNumberOfBoxes, Integer.class);
 add(expectedNumberOfBoxesTextField);

 RequiredTextField receivedNumberOfBoxesTextField = new
 RequiredTextField(receivedNumberOfBoxes, Integer.class);
 add(receivedNumberOfBoxesTextField);

 }
 
 Yep, you need to work with models. For instance:
 
 RequiredTextField receivedNumberOfBoxesTextField = new
 RequiredTextField(receivedNumberOfBoxes, Integer.class, new
 PropertyModel(delivery, receivedNumberOfBoxes));
 add(receivedNumberOfBoxesTextField);
 
 or:
 
 setModel(new CompoundPropertyModel(delivery));
 RequiredTextField receivedNumberOfBoxesTextField = new
 RequiredTextField(receivedNumberOfBoxes, Integer.class);
 add(receivedNumberOfBoxesTextField);
 
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/newbie-question-about-using-WizardStep%2C-help%21-thanks%21-tf4509850.html#a12878125
Sent from the Wicket - User mailing list archive at Nabble.com.


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