Re: Feedback Panel on Modal Window With Field Validation does not work

2008-10-28 Thread
try page not panel

2008/10/29 sureshram [EMAIL PROTECTED]


 Hello,

  I am trying to add auto validation in the modal window but I don't see any
 error messages. I added a feedback panel on a modal window which has a
 required text field.  When I try to submit, the modal window does not do
 any
 thing and I think what happens here is wicket does validation (which is
 failing) and does not submit the form. It does not show error messages in
 the feedbackpanel also.

 public class AddAccountModalWindow extends ModalWindow {

public AddAccountModalWindow(String id) throws Exception {
super(id);
setInitialHeight(450);
setInitialWidth(500);

setTitle(Add New Account);
AddAccountContentPanel newAccPanel = new
 AddAccountContentPanel(content)
 {
private static final long serialVersionUID = 1L;

void onCancel(AjaxRequestTarget target) {
close(target);
}

};
setContent(newAccPanel);

};

 }

 public abstract class AddAccountContentPanel extends Panel {

 public AddAccountContentPanel(String id) throws Exception {
Form accForm = new Form(accForm);
accForm.setOutputMarkupId(true);
setModel(new Model());
add(accForm);

feedbackPanel = new FeedbackPanel(feedback, new
 ContainerFeedbackMessageFilter(accForm));
accForm.add(feedbackPanel);

TextField  accName = new TextField(accName, new
 PropertyModel(clearingAccount, mnemonic));

   AjaxFallbackButton createAccount = new
 AjaxFallbackButton(createAccount, accForm){
 protected void onSubmit(AjaxRequestTarget target,
 Form form) {
//hidden code here.
 }
   }
  accForm.add(accName);
  accForm.add(createAccount);

 }

 }

 = AddAccountContentPanel.html

 html
 body style=background-color:#bbd1ef
 wicket:panel
 wicket:panel

 form wicket:id=accForm style=background-color:#bbd1ef
 div style= float:left; 
div style=margin: 20px 0 0 20px;float:left
 wicket:id=feedback/div
div style=clear:both/div
div style=margin: 20px 0 0 20px;float:left
 Account Name:
input style=font:16px Calibri; margin-left:10px;
 type=text
 wicket:id=accName/
/div
 div
input style=font: 16px Calibri; margin: 20px 0 0 120px;
 wicket:id=createAccount type=submit value=Add Account /

/div
 /div
 /form

 /wicket:panel

 = AddAccountModalWindow.html

 html

 body style=background-color:#bbd1ef
wicket:panel
div wicket:id=content style=background-color:#bbd1ef;
 width:100%;
 height: 100%/div
/wicket:panel
 /body
 /html



 /body
 /html

 I apprciate your help,

 Thanks
 Suresh


 --
 View this message in context:
 http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20216419.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]




How to use Menu component in wicket-yui stuff?

2008-10-23 Thread
Hello,
I want to konw how to use Menu component in wicket-yui stuff? Can anyone
give me a demo or example? I could ont find any javadoc or sourcecode.
Thanks!


Re: using Prototype.js and Scriptaculous with latest version of wicket

2008-10-05 Thread
I agree with Igor.

if you are looking to generate your ui purely in javascript
you will not be able to take advantage of a lot of wicket components.

And i think you should generate your ui purely in javascript only when the
ui dose not include in the standard Html components.

2008/10/3 Igor Vaynberg [EMAIL PROTECTED]

 there shouldnt be any problems using prototype with wicket.

 however, if you are looking to generate your ui purely in javascript
 you will not be able to take advantage of a lot of wicket components

 -igor

 On Thu, Oct 2, 2008 at 8:18 AM, ilanfox [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I am considering starting a new project (web app) with Wicket.
  This project will be based heavily on JavaScript with Prototype and
  Scriptaculous.
  Most of the UI will be generated via JavaScript and the also the new
 CANVAS
  tag will be used.
  I really need to know if I'm going the right direction. is it safe to
  combine the Prototype lib with Wicket?
  Do I need to fully understand how Wicket works before trying to combine
 it?
  my prior expropriate is mostly with struts1.
 
  Thanks in advance.
  Ilan F
 
 
  --
  View this message in context:
 http://www.nabble.com/using-Prototype.js-and-Scriptaculous-with-latest-version-of-wicket-tp19781402p19781402.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: Get object form Parameters

2008-09-26 Thread
pass id, and then get that object from that id

2008/9/27 Igor Vaynberg [EMAIL PROTECTED]

 pageparameters is used for passing parameters on the url, so it only
 supports strings or whatever you can convert to a string.

 -igor

 On Fri, Sep 26, 2008 at 9:35 PM, fish3934 [EMAIL PROTECTED] wrote:
   Hi All,
 I wanted to pass an object from one page to another page,so
 I set an object into a parameter:
 PageParameters  para=new PageParameters();
 para.put(result,resultList);//resultList is a List contains some
 pojo.
 //jump to another page
 setResponsePage(DeviceEnquiry.class,para);
 
 Then at DeviceEnquiry.java ,I want to get resultList:
 class DeviceEnquiry extends WebPage
 {
   public DeviceEnquiry (PageParameters  param)
   {
   List list = (List)param.get(result);
   //
 }
  }
 
   But I got an exception:
 
 
  WicketMessage: Can't instantiate page using constructor public
 com.hk.xportal.xseries.enquiry.DeviceEnquiry(org.apache.wicket.PageParameters)
 and argument result = [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 
  Root cause:
 
  java.lang.ClassCastException: [Ljava.lang.String;
  at
 com.hk.xportal.xseries.enquiry.DeviceEnquiry.init(DeviceEnquiry.java:16)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
  at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:147)
  at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
  at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:268)
  at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
  at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
  at
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
  at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1171)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
  at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387)
  at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199)
  at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
  at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
  at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  at
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  at
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
  at java.lang.Thread.run(Thread.java:595)
 
  Complete stack:
 
  org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public
 com.hk.xportal.xseries.enquiry.DeviceEnquiry(org.apache.wicket.PageParameters)
 and argument result = [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED]
  at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
  at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
  at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:268)
  at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
  at
 

Re: update dropdown with ajax

2008-09-23 Thread
Try ModalWindow instead of popup page.


 On Mon, Sep 22, 2008 at 3:06 PM, tbt [EMAIL PROTECTED] wrote:

 
  Hi
 
  I have a problem regarding how to update a dropdown with ajax when an
  option
  is added through a popup window. For example Page A has a dropdown and a
  link. When the link is clicked a popup opens and dropdown options can be
  added to the popup page. when the form is submitted by clicking 'add' the
  db
  is updated and the popup window is closed. but the dropdown in the parent
  window needs to be updated with ajax. how can this be done the wicket
 way.
  please provide an example.
 
  Thanks
  --
  View this message in context:
  http://www.nabble.com/update-dropdown-with-ajax-tp19606658p19606658.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]
 
 


 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P Save a tree. Please don't print this e-mail unless it's really necessary



Re: Hi, had anyone tried to read the source code?

2008-08-29 Thread
Hi,
  I also want to get some suggestion.


2008/8/29, shrimpywu [EMAIL PROTECTED]:


 Hi, had anyone tried to read the source code?

 i am very interesting with play around with wicket,
 so i really want to know how wicket do things

 but one thing i am stuck with is that, i check out the src code from svn, i
 don`t know how to start or where to start to read the code.

 can any body give me some hint how to have a clear mind of the project, and
 how to read the code?
 --
 View this message in context:
 http://www.nabble.com/Hi%2C-had-anyone-tried-to-read-the-source-code--tp19211288p19211288.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]




How to change the em tag proceduced by wicket:link

2008-08-29 Thread
Hello,
I am reading Wicket in action -- a very good book. In the book ,
authors explain the wicket:link tag with the following code
   wicket:link |#1
 ul |
lia href=package1/Page1.htmlPage1/a/li | #2
lia href=package2/Page2.htmlPage2/a/li | #3
/ul |
  /wicket:link
 Then authors say The link to the current page is rendered as disabled by
replacing the link tag  with a span, and rendering the text using an em-tag
(this is configurable).
 I take notice of this is configurable, and i want to know to to config
it?   Thank you


Re: How to change the em tag proceduced by wicket:link

2008-08-29 Thread
Thank you, Martijn

在08-8-29,Martijn Dashorst [EMAIL PROTECTED] 写道:

 see IMarkupSettings#setDefault*DisabledLink

 Martijn




Re: Popup from a link

2008-08-29 Thread
Louis, Thank you, nice examples.

2008/8/30, Louis Letourneau [EMAIL PROTECTED]:

 You can check out the example in wicket extensions:

 http://www.wicket-library.com/wicket-examples/ajax/modal-window.0;jsessionid=D48A81DCC881B0D8A11DAA7EE39C81B1

 http://www.wicketframework.org/wicket-extensions/apidocs/wicket/extensions/ajax/markup/html/modal/ModalWindow.html

 If you want to reuse the modal popup elsewere, there is an example on how
 to do this nicely here:

 http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup

 hope it helps.
 Louis

 askarzaidi wrote:

 Hi ,

 I have a link and what I want is that the user clicks the link so that a
 popup window appears. This popup will have a very simple page/form with a
 couple of fields and ok/cancel button. After the user hits ok, the popup
 disappears (the form submits).

 Are there any good examples on popups around ? Any leads would be helpful.

 thanks,
 Askar


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




Re: Override HeaderResponse' renderJavascript() method

2008-08-27 Thread
Yes,That can make it. But if i just want to modify it. Can I make it?

在08-8-27,Matej Knopp [EMAIL PROTECTED] 写道:

 Don't specify the id. Just put there null, the javascript will be
 always rendered.

 -Matej

 On Wed, Aug 27, 2008 at 3:20 AM, 张伟 [EMAIL PROTECTED] wrote:
  Hello,
 I use the renderJavascript(java.lang.CharSequence javascript,
  java.lang.String id) method in  HeaderResponse class to output the some
 js
  code in html header. This renderJavascript method will render javascript
  code to the response, if the javascript has not already been rendered.
 But
  i want to override  if the javascript has already been rendered. How can
 i
  make it? Thank you.  BTW, excuse my poor English.
 



Re: fileupload element checking filename existing before upload using ajax

2008-08-27 Thread
Mattom, Thank you for sharing code. Thank you .

2008/8/28, Mattom [EMAIL PROTECTED]:

 Found a different solution, in case somebody is interested:

 fileUploadField.add(new AjaxEventBehavior(onchange)
{
protected void onEvent(AjaxRequestTarget target) {
Request request = RequestCycle.get().getRequest();
String filename = request.getParameter(filename);
System.out.println(filename is [ + filename + ]);
}

public CharSequence getCallbackUrl(boolean
 onlyTargetActivePage) {
CharSequence callBackUrl
 =  super.getCallbackUrl(onlyTargetActivePage);
return callBackUrl + filename=' + this.value + ';
}

});

 not as beautiful as I'd like to have it, because I'm manually messing
 around with the callback url, but it works :-).

 :-),
 Thomas





Fwd: Override HeaderResponse' renderJavascript() method

2008-08-26 Thread
Hello,
I use the renderJavascript(java.lang.CharSequence javascript,
java.lang.String id) method in  HeaderResponse class to output the some js
code in html header. This renderJavascript method will render javascript
code to the response, if the javascript has not already been rendered. But
i want to override  if the javascript has already been rendered. How can i
make it? Thank you.  BTW, excuse my poor English.