WebObjects Help

Joined
Mar 19, 2009
Messages
1
Reaction score
0
Points
1
I would appreciate someone taking a look at this. The problem is that startDate and endDate (in Java program is always null). If I initialize them in the Java program the values correctly appear on the form, but I cannot get the values back if I change them in the form.

Action selected is "goCreateReports"

--------------------------------- START OF WOD ---------------------------------

OurWrapper: MainWrapper {}

ErrorMessagesFor: ERXErrorMessagesFor {
errorList = pageErrors;
}

StartDate : WOTextField {
value = startDate;
}

EndDate : WOTextField {
value = endDate;
}

CreateReportsLink: WOHyperlink {
action = goCreateReports;
class = "button wide9em";
otherTagString = "onclick='return confirmCreateReports();'";
}


--------------------------------- END OF WOD ---------------------------------

--------------------------------- START OF HTML ------------------------------

<webobject name="OurWrapper">
<script>
function confirmCreateReports()
{
msg = "Are you sure you want to create the reports now?";
return confirm(msg);
}
</script>
<h1> Fortnightly Reports </h1>
<h3> Select Payment Period </h3>
<p> Start Date </p>
<webobject name="StartDate" />
<p> End Date </p>
<webobject name="EndDate" />
<!-- <webobject name="FortnightlyPaymentPeriodPicker" /> -->
<br />
<div class="button-group">
<div class="button-spacer"> </div>
<webobject name="CreateReportsLink">
<span>
<center>Create Reports</center>
</span>
</webobject>
</div>
<div style="clear:both;"> </div>
</webobject>

------------------------------------- END OF HTML --------------------------

----------------------------------- START OF JAVA -------------------------

@SuppressWarnings("serial")
public class FRCreateOptionsPage extends BaseAppComponent
{
//public String dateString;

public FRCreateOptionsPage(WOContext context)
{
super(context);
}

// --------------------- keys ---------------------
public String startDate;
public String endDate;

// --------------------- actions ---------------------

public WOActionResults goCreateReports()
{
if (validateSubmit()) /* ALWAYS RETURNS FALSE */
{
FRCreateReportsPage nextPage = pageWithName(FRCreateReportsPage.class);
nextPage.setReporter(newFortnightlyReporter());
return nextPage;
}
return thisPage();
}

private boolean validateSubmit()
{
boolean ok = false;
if (session().paymentManager() == null)
{
addPageError("Select a Payment Manager to generate reports for.");
}
else if (startDate == null) /* IS ALWAYS NULL */
{
addPageError("Select a start date.");
}
else if (endDate == null) /* IS ALWAYS NULL */
{
addPageError("Select an end date.");
}
else
{
ok = true;
}
return ok;
}

}
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top