Search code examples
javagoogle-app-enginegwtuibinder

FlexTable with Uibinder or alternatives


What's the best way to use flextable in corperation with uiBinder, I already know that I have to provide it and initiate it befor initWidget

@UiField(provided = true) FlexTable contentTable;

But I simply need a table with as an input matrix like:

pseudo:

 Label."Name: " TextBox() 
 Label."Password: " TextBox() 

Know is it a good idea to even consider FlexTable or is there a better Alternativ? Thanks for any help.


Solution

  • I'll pass on the fact that using a table for a form layout is not your best option nor a good practice.

    You can just use an HTMLPanel with UiBinder, and do everything in HTML like you would with a "normal" page, with some additional GWT tags for widgets :

    <g:HTMLPanel>
       <div class="formInput">
          <g:Label text="First Name - W3C style : ">
          <g:TextBox ui:field="firstNameTextBox">
       </div>
    
    
       <table>
         <tbody>
            <tr>
                <td>Last name - table style :</td>
                <td><g:TextBox ui:field="lastNameTextBox" /></td>
            </tr>
            <tr>
                <!-- Other form fields -->
            </tr>
         </tbody>
       </table>
    </g:HTMLPanel>