Create a popup from an anchor in FlexTable
I am trying to retrofit the GWT Mail App to come up with an app for time entry myself - I am pretty new to GWT and am struggling to do certain things.
Here is my code that lays out the main page, which gets a list of dates that are anchors and I would like to pop-up a dialog box to let users put in their time. I designed the dialog box and the anchors but dont know how to get the popup when an anchor is clicked. Can anyone please help ? I am using the uiBinder to do this. The flexTable named 'table' will have the anchor as one of the columns. If my question is not clear, please let me know. As always, thanks a lot for your time.
<g:DockLayoutPanel styleName='{style.outer}' unit='EM'>
<g:开发者_如何学Cnorth size='8'>
<g:HorizontalPanel width="300">
<g:Label width="200" styleName='{style.labelStyle}'>Filter by Status : </g:Label>
<g:ListBox ui:field='listBox' width="100"></g:ListBox>
<mail:TimesheetEntryDialog ui:field='timesheetEntryDialog' />
</g:HorizontalPanel>
</g:north>
<g:north size='5'>
<g:VerticalPanel width="200">
<g:Label ui:field='numberOfRecords'></g:Label>
<g:FlexTable ui:field='header' styleName='{style.header}' cellSpacing='0' cellPadding='0'/>
</g:VerticalPanel>
</g:north>
<g:center>
<g:ScrollPanel>
<g:FlexTable ui:field='table' styleName='{style.table}' cellSpacing='0' cellPadding='0' width="100"/>
</g:ScrollPanel>
</g:center>
Popuplayout
<g:HTMLPanel width='24em' styleName='{style.panel}'>
<div style="width:100%;text-align:center" class='{style.aboutText}'>
<g:HTML ui:field="timesheetText"></g:HTML>
</div>
<div class='{style.buttons}'>
<g:Button text='Submit' ui:field='submitButton' />
</div>
<div class='{style.buttons}'>
<g:Button text='Close' ui:field='closeButton' />
</div>
your java file should look something like this:
public class MyFoo extends Composite {
@UiField Button submitButton;
public MyFoo() {
initWidget(submitButton);
}
@UiHandler("submitButton")
void handleClick(ClickEvent e) {
Label l = new Label("I am a dialog box");
DialogBox dialog = new DialogBox();
dialog.setWidget(l);
dialog.center();
dialog.show();
}
}
精彩评论