asked
2016-03-25 02:58:02 +0800
DMH 35 ● 6 I'm trying to expand a Grid in Java but I'm being unsuccessful.
I've crated a zul template that looks like this:
<zk>
<columns>
<column hflex="min" vflex="min" label="" />
<column hflex="1" vflex="min" label="" />
</columns>
<rows>
<row>
<label id="vaccineLabel" value="" />
<textbox id="vaccineName" style="resize:none;"
readonly="true" rows="3" type="text" />
</row>
<row>
<label id="lotLabel" value="" />
<textbox id="lotValue" style="resize:none;" readonly="true"
rows="3" type="text" />
</row>
<row>
<label id="dateLabel" value="" />
<textbox id="dateValue" style="resize:none;" readonly="true"
rows="3" type="text" />
</row>
<row>
<label id="reactionsLabel" value="" />
<textbox id="reactionsText" style="resize:none;"
readonly="true" rows="3" type="text" />
</row>
<row>
<label id="observationsLabel" value="" />
<textbox id="observationsText" style="resize:none;"
readonly="true" rows="3" type="text" />
</row>
</rows>
</zk>
and my Java class looks like this:
public class ShotDescriptionGrid extends Grid implements IdSpace {
/**
*
*/
private static final long serialVersionUID = 1L;
@Wire
Label vaccineLabel;
@Wire
Textbox vaccineName;
@Wire
Label lotLabel;
@Wire
Textbox lotValue;
@Wire
Label dateLabel;
@Wire
Textbox dateValue;
@Wire
Label reactionsLabel;
@Wire
Textbox reactionsText;
@Wire
Label observationsLabel;
@Wire
Textbox observationsText;
/**
*
*/
public ShotDescriptionGrid(String vaccineLabel, String vaccineName, String lotLabel, String lotValue,
String dateLabel, String dateValue, String reactionsLabel, String reactionsText,
String observationsLabel, String observationsText) {
Executions.createComponents("/WEB-INF/grids/descriptionShots.zul", this, null);
Selectors.wireVariables(this, this, null);
Selectors.wireEventListeners(this, this);
setHeight("100%");setWidth("100%");
setStyle("overflow:auto;");
this.vaccineLabel.setValue(vaccineLabel);
this.vaccineName.setValue(vaccineName);
this.lotLabel.setValue(lotLabel);
this.lotValue.setValue(lotValue);
this.dateLabel.setValue(dateLabel);
this.dateValue.setValue(dateValue);
this.reactionsLabel.setValue(reactionsLabel);
this.reactionsText.setValue(reactionsText);
this.observationsLabel.setValue(observationsLabel);
this.observationsText.setValue(observationsText);
}
Besides the obvious extensive parameters in the constructor (this was a basic approach to see if it'd work) problem my variables aren't being wired in the component.
Am I doing something wrong or I can't extend a Grid in Java?
Thanks for help.
why don't you just create the whole zul in Java and add eventlisteners where you need them? Much easier then what you are trying now.
chillworld ( 2016-03-25 18:18:08 +0800 )editBtw, implementatie aftercompose and out your code there. This will make already a big difference.
chillworld ( 2016-03-25 21:55:25 +0800 )edit