Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@99155 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9cdd6e67e0
commit
b2c4765953
|
@ -33,7 +33,7 @@ import com.sencha.gxt.widget.core.client.form.TextField;
|
|||
*/
|
||||
public class CSVTableDetailCard extends WizardCard {
|
||||
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
protected final String TABLEDETAILPANELWIDTH = "100%";
|
||||
protected final String TABLEDETAILPANELHEIGHT = "100%";
|
||||
protected final String FORMWIDTH = "538px";
|
||||
|
@ -96,23 +96,23 @@ public class CSVTableDetailCard extends WizardCard {
|
|||
|
||||
validFrom = new DateField();
|
||||
validFrom.setValue(new Date());
|
||||
p.add(new FieldLabel(validFrom, "Valid From"), new VerticalLayoutData(1, -1));
|
||||
p.add(new FieldLabel(validFrom, "Valid From"), new VerticalLayoutData(
|
||||
1, -1));
|
||||
|
||||
validUntilTo = new DateField();
|
||||
p.add(new FieldLabel(validUntilTo, "Valid Until To"), new VerticalLayoutData(1, -1));
|
||||
|
||||
p.add(new FieldLabel(validUntilTo, "Valid Until To"),
|
||||
new VerticalLayoutData(1, -1));
|
||||
|
||||
tableDetailPanel.add(form);
|
||||
|
||||
setContent(tableDetailPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
Command sayNextCard = new Command() {
|
||||
|
||||
|
||||
public void execute() {
|
||||
checkData();
|
||||
}
|
||||
|
@ -174,11 +174,29 @@ public class CSVTableDetailCard extends WizardCard {
|
|||
detail.setName(name.getCurrentValue());
|
||||
detail.setDescription(description.getCurrentValue());
|
||||
detail.setRight(rights.getCurrentValue());
|
||||
Date vFrom=validFrom.getCurrentValue();
|
||||
detail.setValidFrom(sdf.format(vFrom));
|
||||
Date vUntilTo=validUntilTo.getCurrentValue();
|
||||
detail.setValidUntilTo(sdf.format(vUntilTo));
|
||||
|
||||
Date vFrom = validFrom.getCurrentValue();
|
||||
if (vFrom == null) {
|
||||
Log.debug("Valid From is null");
|
||||
} else {
|
||||
try {
|
||||
detail.setValidFrom(sdf.format(vFrom));
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error parsing Valid From "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Date vUntilTo = validUntilTo.getCurrentValue();
|
||||
if (vUntilTo == null) {
|
||||
Log.debug("Valid Until To is null");
|
||||
} else {
|
||||
try {
|
||||
detail.setValidUntilTo(sdf.format(vUntilTo));
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error parsing Valid Until To "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
importSession.setTabResource(detail);
|
||||
|
||||
CSVOperationInProgressCard csvOperationInProgressCard = new CSVOperationInProgressCard(
|
||||
|
|
Loading…
Reference in New Issue