Wednesday, 1 April 2015

Form in SAP UI5

How to do Simple form in SAP UI5 ?

1. To create a form in SAP UI5 first  we should take sample Table from SAP UI5 Demo Kit
2. For source code click show code button on top right
3. copy the source code and also libraries (xmlns:l="sap.ui.layout", xmlns:f="sap.ui.layout.form") paste these code in your "view.xml" and include your libraries in <core:View>

 Check below screen shot of form :


Check below view code:

         <l:Grid
    defaultSpan="L12 M6 S12"
    width="auto">
    <l:content>
      <f:SimpleForm id="SimpleFormChange354"
        minWidth="1024"
        maxContainerCols="2"
        editable="true"
        layout="ResponsiveGridLayout"
        title=""
        labelSpanL="3"
        labelSpanM="3"
        emptySpanL="4"
        emptySpanM="4"
        columnsL="1"
        columnsM="1"
        class="editableForm">
        <f:content>
          <Label text="Name"  />
          <Input value="" id="name" />
         
          <Label text="Address" />
          <Input value="" id="adr">
          </Input>
         
           <Label text="Group" />
          <Select width="100%" id="group">
            <items>
              <core:Item text="Select" key="1"/>
              <core:Item text="B.Tech" key="2"/>
              <core:Item text="M.C.A" key="3"/>
              <core:Item text="M.Tech" key="4"/>
            </items>
          </Select>
          
            <Label text="Sex" />
              <HBox >
                      
     
      <RadioButton groupName="sex" id="gender_male"   text="Male"  />
      <RadioButton groupName="sex" id="gender_female" text="Female" />
 
    </HBox>

          <Label text="Phone" />
          <Input value="" id="phone" maxLength="10"></Input>
         
         
            <Label text="Email Id" />
          <Input value="" id="emailid"/>
         
  
          <Label/>
         <Button type="Accept" press="submit" text="Submit" ></Button>
        
        </f:content>
      </f:SimpleForm>
    </l:content>
  </l:Grid>
       
Note - For Submit event is "press" to know more Events and Properties for Table  go to Explored

SAP UI5 Installation in Kepler

  • SAP UI5 is an new tool to make SAP Application Mobile compatible.
  • SAP UI5 is based on JavaScript and JQuery library 
  • SAP UI5 has demo kit which has 125 controls in it to make SAP Application user friendly https://sapui5.hana.ondemand.com/sdk
  • SAP UI5 is an User Interface Framework.
How to install SAP UI5?
SAP UI5 works on Eclipse tools
To install a SAP UI5 in Eclipse please follow below steps:
  1. Download Eclipse Kepler based on your O.S bit
  2. To run SAP UI5 application we need Tomcat Server
  3. After installing Eclipse and Tomcat Server successfully we should check weather Eclipse installed with SAP UI5 or not to check that click help->About Eclipse in Eclipse Kepler
  4. To install a SAP UI5 click tools -> Install New Software ->in Work with section type https://tools.hana.ondemand.com/kepler
Congo!! Now we successfully installed SAP UI5 in Eclipse Kepler