• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

issue with datetimepicker & autocompleter in struts 2

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am currently working on an application with Struts2 and stuck up in 2 issues .

1) Issue with datetimepicker tag:

I have a date field in my jsp with the below syntax.

<sx:datetimepicker name="incidentdate" label="Incident Date" displayFormat="MM-dd-yyyy"/>

And the action class has the same field Date incidentdate; ( with getters and setter methods as well)

When I am selecting a date from the datetimepicker tag and trying to submit, i am getting a pop up error message " [Ojbect Error]".



2) Issue with autocompleter tag


I am using an autocompleter tag to select a reason, but I want to make this as a mandatory field, but when i am writing validation rule then i am getting the same error message "[Object Error]".

<sx:autocompleter name="issue" label="Issue" list="{'Login','Help','New Request','Edit request'}" autoComplete="true" showDownArrow="false" />

So can someone help me how to get these things fixed.

I want to select a date from datetimepicker and be able to submit my form
and able to validate the autocompleter tag and make sure that the user should not be able to leave that empty.


Thanks,
Pawan Kalyan

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi you have to follow simple steps





functions gfnDisableKeys() and gfnDisableControls() are optional that is written for not allow any char other than date








action code








reply if your prblem not rsolved


take care of this things:
NOTE-you need to specify head tag like this i gusss your problem resolve when you do this

<head>
<title>l</title>
<s:head/>
<sx:head/>
</head>


and you need to add struts2-dojo-plugin-2.1.6.jar to your application.

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't quote your own text--it's a bit misleading, and unnecessarily difficult to read.
 
Pawan Kalyan
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey.

It seems that the date filed in my action class should be as a String.
And its getting in the format as "2009-12-01T00:00:00-05:00"

I need that in MM/dd/yyyy format.
I am doing a simpledate format but receiving java.text.ParseException: Unparseable date: "2009-12-01"

I am using :

String temp=inc.substring(0,10);
SimpleDateFormat sdfOutput = new SimpleDateFormat ( "yyyy/MM/dd" ) ;
Date date = (Date) sdfOutput.parse (temp) ;

Can someone help me in this.


Thanks,
pawan

Thanks.
Pawan
 
I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic