private DisclosurePanel addressDisclosurePanel(String nameId) {
final DisclosurePanel addressDisclosurePanel = new DisclosurePanel("Address");
//Get the Addresses
AsyncCallback<List<Address>> callback = new GetAddressHandler<List<Address>>(PersonalDetailsView.this);
rpc.getAddressList(nameId, callback);
//addressDisclosurePanel.add(addressHorizontalPanel);
return addressDisclosurePanel;
}
class GetAddressHandler<T> implements AsyncCallback<List<Address>> {
//Get the list of Addresses.
PersonalDetailsView view;
final HorizontalPanel addressHorizontalPanel = new HorizontalPanel();
public GetAddressHandler(PersonalDetailsView view) {
this.view = view;
}
public void onFailure(Throwable ex) {
System.out.println("RPC call failed - GetAddressHandler - Notify Administrator.");
Window.alert("Connection failed - please retry.");
}
public void onSuccess(List<Address> result) {
Window.alert("Render address.");
addressHorizontalPanel.add(view.renderAddresses(result));
}
}
private FlexTable renderAddresses(List<Address> addressList) {
//Load each TabPanel with Addresses
Window.alert("get address.");;
final FlexTable flexTableAddress = new FlexTable();
if (addressList == null || addressList.isEmpty()) {
//Add a place to add an address
//Address Type
final Label lblAddressType = new Label("Address Type:");
lblAddressType.setStyleName("gwt-Label-Login");
flexTableAddress.setWidget(0, 0, lblAddressType);
final TextBox textBoxAddressType = new TextBox();
textBoxAddressType.setStyleName("gwt-TextBox");
textBoxAddressType.setWidth("300px");
flexTableAddress.setWidget(0, 1, textBoxAddressType);
}else{
int row = 0;
//
//Create a place to display each Address and allow update
//
for (final Address eachAddress : addressList) {
//Store key
final String addId = eachAddress.getAddId();
Window.alert("addId = " + addId);
//Address Type
final Label lblAddressType = new Label("Address Type:");
lblAddressType.setStyleName("gwt-Label-Login");
flexTableAddress.setWidget(row, 0, lblAddressType);
final TextBox textBoxAddressType = new TextBox();
textBoxAddressType.setText(eachAddress.getAddType());
textBoxAddressType.setStyleName("gwt-TextBox");
textBoxAddressType.setWidth("300px");
flexTableAddress.setWidget(row, 1, textBoxAddressType);
row++;
}
}
return flexTableAddress;
}
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/taQlLOMZ3zw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Hi Jens,When I do this (in onSuccess) I get the error: addressDisclosurePanel cannot be resolvedAre you ale to provide me with code examples please as I am not a real programmer I am doing this for Scouts.Kind regards,Glyn
On 8 August 2016 at 18:31, Jens <jens.ne...@gmail.com> wrote:
Move
//addressDisclosurePanel.add(addressHorizontalPanel);
into your GetAddressHandler and pass in the newly created addressDisclosurePanel? Alternatively use an anonymous class as callback.-- J.
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/taQlLOMZ3zw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
Hi Jens,I have spent over three weeks trying to get this to work. I have tried to include your suggestion; however, I just can not get it to work. Any assistance you, or anyone else, can provide would be greatly appreciated.Kind regards,Glyn
On 8 August 2016 at 19:16, Glyndwr Bartlett <glyndwr....@gmail.com> wrote:
Hi Jens,When I do this (in onSuccess) I get the error: addressDisclosurePanel cannot be resolvedAre you ale to provide me with code examples please as I am not a real programmer I am doing this for Scouts.Kind regards,Glyn
On 8 August 2016 at 18:31, Jens <jens.ne...@gmail.com> wrote:
Move
//addressDisclosurePanel.add(addressHorizontalPanel);
into your GetAddressHandler and pass in the newly created addressDisclosurePanel? Alternatively use an anonymous class as callback.-- J.
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/taQlLOMZ3zw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
private DisclosurePanel addressDisclosurePanel(String nameId) {
final DisclosurePanel addressDisclosurePanel = new DisclosurePanel("Address");
//Get the Addresses
AsyncCallback<List<Address>> callback = new GetAddressHandler<List<Address>>(PersonalDetailsView.this, addressDisclosurePanel); rpc.getAddressList(nameId, callback);
return addressDisclosurePanel;
}
class GetAddressHandler<T> implements AsyncCallback<List<Address>> {
//Get the list of Addresses.
PersonalDetailsView view;
DisclosurePanel addressDisclosurePanel;
final HorizontalPanel addressHorizontalPanel = new HorizontalPanel();
public GetAddressHandler(PersonalDetailsView view, DisclosurePanel addressDisclosurePanel) { this.view = view;
this.addressDisclosurePanel = addressDisclosurePanel;
}
public void onFailure(Throwable ex) {
System.out.println("RPC call failed - GetAddressHandler - Notify Administrator.");
Window.alert("Connection failed - please retry.");
}
public void onSuccess(List<Address> result) {
Window.alert("Render address.");
addressHorizontalPanel.add(view.renderAddresses(result));
addressDisclosurePanel.add(addressHorizontalPanel);
}
}-- J.--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/taQlLOMZ3zw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.