Creating object array to pass in Constructor - java

Being a newbie to Java am finding it a bit difficult to come up with a neat code for my purpose.
The problem is,
class ElementID {
String name = "";
String value = "";
public ElementID (String name, String value) {
this.name = name;
this.value = value;
}
}
class HeaderID {
String ID = "";
Date cal;
ElementID[] elementID;
public HeaderID (String ID, Calender cal, ElementID[] elemID) {
this.ID = ID;
this.cal = cal;
this.elementID = elemID;
}
}
Now in another class inside a function i need to instantiate the HeaderID class.
And this is what i did so far and it doesn't work. The problem am facing is with regard to creating a single array of ElementID.
ElementID[] e = new ElementID[1];
e[0] = new ElementID("NAME", "VALUE");
// Error at this line
HeaderID ht = new HeaderID("ID", new Date(), e);

You cannot cast direct from Date to Calendar:
You declared:
public HeaderID (String ID, Calender cal, ElementID[] elemID) {
and you try to call:
HeaderID ht = new HeaderID("ID", new Date(), e); //Error at this line
// ^ this is expecting a Calendar Instance
OPTION A: You can change you declaration
public HeaderID (String ID, Date date, ElementID[] elemID) {
If you do this use your actual call:
HeaderID ht = new HeaderID("ID", new Date(), e);
OPTION B: change what you send to your actual declaration:
// create new calendar instance
Calendar cal = Calendar.getInstance();
// put desired Date
cal.setTime(new Date());
// make call with correct variable types
HeaderID ht = new HeaderID("ID", cal, e);

Related

Calling a class without using Classname X = new Classname();

I have a class with set and get, and In another class.
However, if I use Classname X = new Classname(); I'll not be able to use previous information set before.
Here's part of the code:
public void BuscarID () throws Exception {
//THIS VOID IS FOR SEARCH
ConsumirWS2 http = new ConsumirWS2();
Gson g = new GsonBuilder().setDateFormat("dd-MM-yyyy").create();
Cliente2 u = new Cliente2();
Type ClienteType = new TypeToken<Cliente2>() {
}.getType();
int i = Integer.parseInt(InterfaceConsu2.jTextFieldID.getText());
u.setCad_pes_id(i);
String s = Integer.toString(u.getcad_pes_id());
String url = "http://localhost:8080/clienteWebService/webresources/CadastroCliente/Clienteid/get/"+s;
String json = http.sendGet(url, "GET");
u = g.fromJson(json, ClienteType);
System.out.println(json + ("\n"));
System.out.println(u.getcad_pes_nome() +("\n") + u.getCad_pes_apelido() +("\n") + u.getCad_pes_cpf() +("\n") + u.getCad_pes_data()+("\n"));
String Date1 = new SimpleDateFormat("dd-MM-yyyy").format(u.getCad_pes_data());
System.out.println(Date1);
InterfaceConsu2.jTextFieldNOME.setText(u.getcad_pes_nome());
InterfaceConsu2.jTextFieldAPELIDO.setText(u.getCad_pes_apelido());
InterfaceConsu2.jFormattedTextFieldCPF.setText(u.getCad_pes_cpf());
InterfaceConsu2.jFormattedTextFieldDATA.setText(Date1);
InterfaceConsu2.jTextFieldID.setText(s);
}
public void alterar () throws Exception {
//THIS VOID IS FOR EDITING THE INFORMATION GET BEFORE
ConsumirWS2 http = new ConsumirWS2();
Gson g = new GsonBuilder().setDateFormat("dd-MM-yyyy").create();
Cliente2 u = new Cliente2();
Type ClienteType = new TypeToken<Cliente2>() {
}.getType();
u.setCad_pes_nome(InterfaceConsu2.jTextFieldNOME.getText());
u.setCad_pes_cpf(InterfaceConsu2.jFormattedTextFieldCPF.getText());
u.setCad_pes_apelido(InterfaceConsu2.jTextFieldAPELIDO.getText());
int i = Integer.parseInt(InterfaceConsu2.jTextFieldID.getText());
u.setCad_pes_id(i);
//u.setCad_pes_id(InterfaceConsu2.jTextFieldID.getText());
SimpleDateFormat formatter = new SimpleDateFormat ("dd-MM-yyyy");
java.util.Date utilDate = null;
try {
utilDate = formatter.parse(InterfaceConsu2.jFormattedTextFieldDATA.getText());
} catch (ParseException ex) {
Logger.getLogger(InterfaceConsu2.class.getName()).log(Level.SEVERE, null, ex);
}
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
u.setCad_pes_data(sqlDate);
String json = g.toJson(u, ClienteType);
String url = "http://localhost:8080/clienteWebService/webresources/CadastroCliente/Cliente/alterar";
http.sendPost(url, json, "PUT");
}
and then I have the set and get class:
public class Cliente2 {
public String cad_pes_nome;
public String cad_pes_apelido;
private String cad_pes_cpf;
public int cad_pes_id;
public Date cad_pes_data;
public String getcad_pes_nome() {
return cad_pes_nome;
}
public void setCad_pes_nome(String cad_pes_nome) {
this.cad_pes_nome = cad_pes_nome;
}
public String getCad_pes_apelido() {
return cad_pes_apelido;
}
public void setCad_pes_apelido(String cad_pes_apelido) {
this.cad_pes_apelido = cad_pes_apelido;
}
public String getCad_pes_cpf() {
return cad_pes_cpf;
}
public void setCad_pes_cpf(String cad_pes_cpf) {
this.cad_pes_cpf = cad_pes_cpf;
}
public int getcad_pes_id() {
return cad_pes_id;
}
public void setCad_pes_id(int cad_pes_id) {
this.cad_pes_id = cad_pes_id;
}
public Date getCad_pes_data() {
return cad_pes_data;
}
public void setCad_pes_data(Date cad_pes_data) {
this.cad_pes_data = cad_pes_data;
}
}
Because I'm using Classname X = new Classname();, when I try to print my u.getcad_pes_nome or any other get, It's empty, There's a way to call Cliente2 without using Cliente2 u = new Cliente2(); or what I have to change in my classes?

MS ExchangeService - get custom calendar (OR calendars list)

Using ExchangeService I need to get Calendar folder and retrieve all events there
It's done by this piece of code
private List getRoomCalendar() throws Exception {
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
ExchangeCredentials credentials = new WebCredentials(username, password);
service.setCredentials(credentials);
service.setUrl(new URI(msExchangeUrl));
FolderView fv = new FolderView(100);
fv.setTraversal(FolderTraversal.Deep);
FolderId confRoomFolderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(username));
System.out.println(confRoomFolderId.getFolderName());
List events = new ArrayList();
Date date = new Date();
try {
CalendarFolder calendarFolder = CalendarFolder.bind(service, confRoomFolderId);
CalendarView cView = new CalendarView(new DateTime(date).minusDays(1).toDate(),
new DateTime(date).plusDays(1).toDate(), 100);
cView.setPropertySet(new PropertySet(AppointmentSchema.Subject,
AppointmentSchema.Start,
AppointmentSchema.End));
// we can set other properties as well depending upon our need.
FindItemsResults appointments = calendarFolder.findAppointments(cView);
List<Appointment> appList = appointments.getItems();
for (Appointment appointment : appList) {
Map event = readEvent(appointment);
events.add(event);
}
} catch (Exception e) {
e.printStackTrace();
}
return events;
}
private Map readEvent(Appointment appointment) {
Map appointmentData = new HashMap();
try {
DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
appointmentData.put("appointmentSubject", appointment.getSubject());
appointmentData.put("appointmentStartTime", df.format(appointment.getStart()));
appointmentData.put("appointmentEndTime", df.format(appointment.getEnd()));
} catch (ServiceLocalException e) {
e.printStackTrace();
}
return appointmentData;
}
Cool, it's working and returns these data
default MS Calendar
The question is: how can I get events for MY CUSTOM CALENDAR called name
see here
custom MS calendar
The solution is to create the folderView first. Afterwards, apply a search filter, find it using FindFolderResults.
PropertySet psPropset = new PropertySet(BasePropertySet.FirstClassProperties);
FolderView fvFolderView = new FolderView(1);
fvFolderView.setPropertySet(psPropset);
SearchFilter SfSearchFilter = new SearchFilter.IsEqualTo(FolderSchema.DisplayName,"name");
FindFoldersResults findFoldersResults = service.findFolders(confRoomFolderId, SfSearchFilter, fvFolderView);
System.out.println(findFoldersResults.getFolders().get(0).getDisplayName());

Get And Set return Null

My Get and Set return null.
I think it's missing something on my Set method.
My Authen.java :
public class Authen {
String sessionID;
public void setSessionID(String sessionID) {
this.sessionID = sessionID;
}
public String getSessionID(){
return this.sessionID;
}
}
My Set method :
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
My Get method returns null when I log sID
Authen at = new Authen();
String sID = at.getSessionID();
You're redeclaring at which is going to remove any values you set.
After you set the id, don't create a new Authen object
So change this:
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
Authen at = new Authen(); // This is where you create a new EMPTY authen
String sID = at.getSessionID();
to:
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
String sID = at.getSessionID();
You should use at like below...
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
String sID = at.getSessionID();
No need to renew at.
The reason why your sID is null is that you 'new' a brand new object as you declare 'at' object in the second time Authen at = new Authen();.
You do not need to initianite Authen again if you want to get the sID correctly.
Just do:
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
String sID = at.getSessionID();
You can transfer the Authen instance from class A to B if it is needed there (assuming class A creates the instance of B):
class A {
private void aMethod() {
String id="1234";
Authen at = new Authen();
at.setSessionID(id);
...
B b = new B(at);
}
}
class B {
private Authen authen;
public B(Authen at) {
this.authen = at;
...
}
private void anotherMethod() {
String sID = this.authen.getSessionID();
...
}
}
obviously this code is not complete, just to show the main idea - and just one of many possibilities.

Requesting for JSON using Volley and serializing

I have a JSON file placed in the server which describes one academic week schedule of a class. I have to request for it using Volley. Later I need to serialize the returned JSON object individually and create multiple events for that particular month.
But when I run the application, Volley returns onErrorResponse. When I try doing the same with Retrofit, it worked fine but the output is not as expected.
IT-3-2.json
[{"schedule_of":"IT-3-2","day":"1","from_time":"09:55","to_time":"10:45","subject":"CC","details":"manasa"},
{"schedule_of":"IT-3-2","day":"1","from_time":"10:45","to_time":"11:35","subject":"CC","details":"manasa"},
{"schedule_of":"IT-3-2","day":"1","from_time":"11:35","to_time":"12:25","subject":"WT","details":"asha"},
{"schedule_of":"IT-3-2","day":"1","from_time":"12:25","to_time":"13:15","subject":"WT","details":"asha"},
{"schedule_of":"IT-3-2","day":"1","from_time":"14:15","to_time":"15:05","subject":"ACS lab","details":"gouthami"},
{"schedule_of":"IT-3-2","day":"1","from_time":"15:05","to_time":"15:55","subject":"ACS lab","details":"gouthami"},
{"schedule_of":"IT-3-2","day":"1","from_time":"15:55","to_time":"16:45","subject":"ACS lab","details":"gouthami"},
{"schedule_of":"IT-3-2","day":"2","from_time":"09:55","to_time":"10:45","subject":"IPR","details":"samreen"},
{"schedule_of":"IT-3-2","day":"2","from_time":"10:45","to_time":"11:35","subject":"IPR","details":"samreen"},
{"schedule_of":"IT-3-2","day":"2","from_time":"11:35","to_time":"12:25","subject":"WT","details":"asha"},
{"schedule_of":"IT-3-2","day":"2","from_time":"12:25","to_time":"13:15","subject":"WT","details":"asha"},
{"schedule_of":"IT-3-2","day":"2","from_time":"14:15","to_time":"15:05","subject":"WT lab","details":"rajesh"},
{"schedule_of":"IT-3-2","day":"2","from_time":"15:05","to_time":"15:55","subject":"WT lab","details":"rajesh"},
{"schedule_of":"IT-3-2","day":"2","from_time":"15:55","to_time":"16:45","subject":"WT lab","details":"rajesh"},
{"schedule_of":"IT-3-2","day":"3","from_time":"09:55","to_time":"10:45","subject":"DWDM","details":"shashikanth"},
{"schedule_of":"IT-3-2","day":"3","from_time":"10:45","to_time":"11:35","subject":"DWDM","details":"shashikanth"},{"schedule_of":"IT-3-2","day":"3","from_time":"11:35","to_time":"12:25","subject":"OOAD","details":"madhukar"},{"schedule_of":"IT-3-2","day":"3","from_time":"12:25","to_time":"13:15","subject":"OOAD","details":"madhukar"},{"schedule_of":"IT-3-2","day":"4","from_time":"09:55","to_time":"10:45","subject":"STM","details":"harikrishna"},{"schedule_of":"IT-3-2","day":"4","from_time":"10:45","to_time":"11:35","subject":"STM","details":"harikrishna"},{"schedule_of":"IT-3-2","day":"4","from_time":"11:35","to_time":"12:25","subject":"OOAD","details":"shashikanth"},{"schedule_of":"IT-3-2","day":"4","from_time":"12:25","to_time":"13:15","subject":"OOAD","details":"shashikanth"},{"schedule_of":"IT-3-2","day":"4","from_time":"14:15","to_time":"15:05","subject":"DWDM","details":"shashikanth"},{"schedule_of":"IT-3-2","day":"4","from_time":"15:05","to_time":"15:55","subject":"DWDM","details":"shashikanth"},{"schedule_of":"IT-3-2","day":"5","from_time":"09:55","to_time":"10:45","subject":"IPR","details":"samreen"},{"schedule_of":"IT-3-2","day":"5","from_time":"10:45","to_time":"11:35","subject":"IPR","details":"samreen"},{"schedule_of":"IT-3-2","day":"5","from_time":"11:35","to_time":"12:25","subject":"STM","details":"harikrishna"},{"schedule_of":"IT-3-2","day":"5","from_time":"12:25","to_time":"13:15","subject":"STM","details":"harikrishna"},{"schedule_of":"IT-3-2","day":"5","from_time":"14:15","to_time":"15:05","subject":"CC","details":"manasa"},{"schedule_of":"IT-3-2","day":"5","from_time":"15:05","to_time":"15:55","subject":"CC","details":"manasa"}]
AsynchronousActivity.java
#Override
public List<? extends WeekViewEvent> onMonthChange(int newYear, int newMonth) {
visibleMonth = newMonth;
visibleYear = newYear;
Log.d(TAG, "month changed - "+newMonth);
final String URL = "http://192.168.0.5/practice/schedule/jsons/IT-3-2.json";
// Post params to be sent to the server
HashMap<String, String> params = new HashMap<String, String>();
params.put("token", "AbCdEfGh123456");
JsonObjectRequest req = new JsonObjectRequest(URL,null /*new JSONObject(params)*/,
new Response.Listener<JSONObject>() {
#Override
public void onResponse(JSONObject response) {
Gson gson = new Gson();
VolleyLog.v("Response:%n %s", response);
makeWeeklyEvents((List<WeeklyEvent>) gson.fromJson(response.toString(),WeeklyEvent.class) );
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
// add the request object to the queue to be executed
//AppController.getInstance().addToRequestQueue(req);
RequestQueue queue = Volley.newRequestQueue(this);
queue.add(req);
// Return only the events that matches newYear and newMonth.
List<WeekViewEvent> matchedEvents = new ArrayList<WeekViewEvent>();
for (WeekViewEvent event : events) {
if (eventMatches(event, newYear, newMonth)) {
matchedEvents.add(event);
}
}
return matchedEvents;
}
public void makeWeeklyEvents(List<WeeklyEvent> events){
this.events.clear();
for (WeeklyEvent event : events) {
this.events.addAll(event.toWeekViewEvent());
Log.d(TAG, "size of events : "+this.events.size());
}
getWeekView().notifyDatasetChanged();
}
weeklyEvent.java
public class WeeklyEvent {
private static final String TAG = WeeklyEvent.class.getSimpleName();
#Expose
#SerializedName("subject")
private String mName;
#Expose #SerializedName("day")
private int mDay;
#Expose #SerializedName("from_time")
private String mStartTime;
#Expose #SerializedName("to_time")
private String mEndTime;
public String getName() {
return mName;
}
public void setName(String name) {
this.mName = name;
}
public int getDay() {
return mDay;
}
public void setDay(int day) {
this.mDay = day;
}
public String getStartTime() {
return mStartTime;
}
public void setStartTime(String startTime) {
this.mStartTime = startTime;
}
public String getEndTime() {
return mEndTime;
}
public void setEndTime(String endTime) {
this.mEndTime = endTime;
}
#SuppressLint("SimpleDateFormat")
public ArrayList<WeekViewEvent> toWeekViewEvent(){
// Parse time.
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Date start = new Date();
Date end = new Date();
try {
start = sdf.parse(getStartTime());
} catch (ParseException e) {
e.printStackTrace();
}
try {
end = sdf.parse(getEndTime());
} catch (ParseException e) {
e.printStackTrace();
}
// Initialize start and end time.
Calendar now = Calendar.getInstance();
// Create an week view event.
ArrayList<WeekViewEvent> list = new ArrayList<WeekViewEvent>();
// Create a WeekViewEvent holder
WeekViewEvent weekViewEvent = new WeekViewEvent();
for(int i= getFirstDay(1,AsynchronousActivity.visibleMonth,AsynchronousActivity.visibleYear) - getDay(); i<now.getActualMaximum(Calendar.DAY_OF_MONTH);i+=7 ){
Calendar startTime = (Calendar) now.clone();
startTime.setTimeInMillis(start.getTime());
startTime.set(Calendar.YEAR, AsynchronousActivity.visibleYear);
startTime.set(Calendar.MONTH, AsynchronousActivity.visibleMonth);
startTime.set(Calendar.DAY_OF_MONTH, i);
Calendar endTime = (Calendar) startTime.clone();
endTime.setTimeInMillis(end.getTime());
endTime.set(Calendar.YEAR, AsynchronousActivity.visibleYear);
endTime.set(Calendar.MONTH, AsynchronousActivity.visibleMonth);
endTime.set(Calendar.DAY_OF_MONTH, i);
// Set values into event.
weekViewEvent.setName(getName());
weekViewEvent.setStartTime(startTime);
weekViewEvent.setEndTime(endTime);
weekViewEvent.setColor(Color.GREEN);
Log.d(TAG, "weekly event recieved : "+getName()+", time : "+weekViewEvent.getStartTime().getTimeInMillis() +" - "+weekViewEvent.getEndTime().getTimeInMillis());
// Append WeekViewEvent to the list.
list.add(weekViewEvent);
}
Log.d(TAG, "list is updating "+list.size()+" events.");
return list;
}
public int getFirstDay(int day, int month, int year)
{
Calendar cal = new GregorianCalendar();
cal.set(Calendar.DATE, day);
cal.set(Calendar.MONTH, month);
cal.set(Calendar.YEAR, year);
cal.set(Calendar.DAY_OF_MONTH, 1);
switch (cal.get(Calendar.DAY_OF_WEEK)) {
case Calendar.MONDAY:
return 0;
case Calendar.TUESDAY:
return 1;
case Calendar.WEDNESDAY:
return 2;
case Calendar.THURSDAY:
return 3;
case Calendar.FRIDAY:
return 4;
case Calendar.SATURDAY:
return 5;
case Calendar.SUNDAY:
return 6;
}
return -1;
}
}
Running the application, it returns the follow Volley error: screenshot of logcat
JSON file is accessible when I try the same URL link from the device browser.
When I tried doing the same with Retrofit, it successfully retrieved and processed the JSON but the output was not as expected.
if (!calledNetwork) {
RestAdapter retrofit = new RestAdapter.Builder()
.setEndpoint("http://192.168.0.5")
.build();
MyJsonService service = retrofit.create(MyJsonService.class);
service.listWeekEvents(this);
calledNetwork = true;
MyJsonService.java
public interface MyJsonService {
#GET("/practice/schedule/jsons/IT-3-2.json")
//http://192.168.0.5/practice/schedule/jsons/IT-3-2.json
void listWeekEvents(Callback<List<WeeklyEvent>> weeklyEventsCallback);
}
The functionality is that, I need to duplicate the input event- JsonObject (it contains "day"-day_of_week which represents that event occurs every week on that day) to all that particular day of every week in one month.
for(int i= getFirstDay(1,AsynchronousActivity.visibleMonth,AsynchronousActivity.visibleYear) - getDay(); i<now.getActualMaximum(Calendar.DAY_OF_MONTH);i+=7 ){
Calendar startTime = (Calendar) now.clone();
startTime.setTimeInMillis(start.getTime());
startTime.set(Calendar.YEAR, AsynchronousActivity.visibleYear);
startTime.set(Calendar.MONTH, AsynchronousActivity.visibleMonth);
startTime.set(Calendar.DAY_OF_MONTH, i);
Calendar endTime = (Calendar) startTime.clone();
endTime.setTimeInMillis(end.getTime());
endTime.set(Calendar.YEAR, AsynchronousActivity.visibleYear);
endTime.set(Calendar.MONTH, AsynchronousActivity.visibleMonth);
endTime.set(Calendar.DAY_OF_MONTH, i);
// Set values into event.
weekViewEvent.setName(getName());
weekViewEvent.setStartTime(startTime);
weekViewEvent.setEndTime(endTime);
weekViewEvent.setColor(Color.GREEN);
Log.d(TAG, "weekly event recieved : "+getName()+", time : "+weekViewEvent.getStartTime().getTimeInMillis() +" - "+weekViewEvent.getEndTime().getTimeInMillis());
// Append WeekViewEvent to the list.
list.add(weekViewEvent);
}
When the application is runned (on 14th Feb,2017), the events are shown only from 24th Feb,2017 - 28th Feb,2017. and that to all the duplicate events generated are shown in one day itself.
screenshot of the application showing 26th Feb,2017 while runned with retrofit
I have been using alamkanak/Android-Week-View (link will be posted in answers section if wanted, as more then 2 links can't be posted for now) library to display the events.
Please, help me to solve this problem. Thanks in advance.

Setting attribute to the option of DropDownChoice

I have a DropDownChoice:
DropDownChoice dateSpanChoice = new DropDownChoice("dateSpan", new PropertyModel(getModel(), "dateSpan"), dateSpans, new IChoiceRenderer() {
private static final long serialVersionUID = 10105L;
#Override
public String getIdValue(Object object, int index) {
return ((DateSpan) object).getId() + "";
}
#Override
public Object getDisplayValue(Object object) {
DateTime today = new DateTime();
DateTime currentDate = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth(), 0, 0, 0, 0);
DateSpan dateSpan = (DateSpan) object;
DateTime fromDate = dateSpan.getFromDate();
DateTime toDate = dateSpan.getToDate();
boolean currentDateIsEqualOrAfterFromDate = currentDate.isEqual(fromDate) | currentDate.isAfter(fromDate);
boolean currentDateIsEqualOrBeforeToDate = currentDate.isEqual(toDate) | currentDate.isBefore(toDate);
boolean currentDateBelongsToCurrentRange = currentDateIsEqualOrAfterFromDate & currentDateIsEqualOrBeforeToDate;
if (currentDateBelongsToCurrentRange) {
return ((DateSpan) object).getDisplayValue() + " *";
} else {
return ((DateSpan) object).getDisplayValue();
}
}
}) {
private static final long serialVersionUID = 10106L;
protected CharSequence getDefaultChoice(final Object selected) {
CharSequence charSequence = super.getDefaultChoice(selected);
System.out.println("=============================================================");
//System.out.println(charSequence);
//THIS CHARSEQUENCE IS RENRING EMPTY STRING
if(StringUtils.isBlank(charSequence.toString())) {
System.out.println("CHARSEQUENCE IS BLANK");
} else {
System.out.println("CHARSEQUENCE IS NOT BLANK");
}
return charSequence;
}
};
dateSpanChoice.setNullValid(false);
I am trying to add style="background-color: red" to the selected option. So I am overriding getDefaultChoice() but as you can see it is commented in code the CharSequence is empty.
Is there any way to set an attribute to a particular option of DropDownChoice?
Thanks and Regards.
Note: the DateTime is Joda time
You need Select/SelectOption instead of DropDownChoice for more complex uses of element.
Have a look at the behavior package in Wicket.
You can use the AttributeAppender-class for instance.

Categories