SlideShare a Scribd company logo
1 of 30
Download to read offline
DATA WIDGETS
           Colin Alworth, Sencha



colin.alworth@sencha.com       @ambisinister
Data Widget Design
Data
Data Widgets Work With

Bean-like POJOs
AutoBeans
RequestFactory Proxies
Reflection?

2.0 uses Map<String,Object>
3.0 generates accessors as needed
ValueProviders and
PropertyAccess
public interface Person {
	 String getFirstName();
	
	 String getLastName();
	
	 String getEmail();
	
	 String getFavoriteColor();
	 void setFavoriteColor(String color);
	
	 int getHeight();
	 void setHeight(int height);
}
ValueProvider and
PropertyAccess

public interface PersonProperties extends PropertyAccess<Person> {
	 	 @Path("email")
	 	 ModelKeyProvider<Person> key();
	 	
	 	 ValueProvider<Person, String> firstName();
	 	 ValueProvider<Person, String> lastName();
	 	 ValueProvider<Person, String> email();
	 	 ValueProvider<Person, String> favoriteColor();
	 	 ValueProvider<Person, Integer> height();
	 }

...
PersonProperties properties = GWT.create(PersonProperties.class);
Cell: ‘Widget Lite’
Cells
Lightweight and Reusable
Easy to Customize
Most Components backed by Cells
Field Cells
                 GWT AbstractInputCell


                 AbstractEventInputCell



                         FieldCell



                   ValueBaseFieldCell



CheckBoxCell   TextInputCell              TriggerFieldCell



                                ComboCell                    DateCell
Using Cells
Custom Cell<String>
public class MyEmailLinkCell extends AbstractCell<String> {
	
   interface Template extends XTemplates {
	 	 @XTemplate("<a href='mailto:{email}'>{email}</a>")
	 	 SafeHtml emailTemplate(String email);
	 }

	   private Template t = GWT.create(Template.class);

	   @Override
	   public void render(Context context, String value, SafeHtmlBuilder sb) {
	   	 sb.append(t.emailTemplate(value));
	   }
}
ListView<Person, String>

ListView<Person, String> email = new ListView<Person, String>(store,
      properties.email());

names.setCell(new MyEmailLinkCell());
Grid<Person>
ColumnConfig<Person, String> firstName = new ColumnConfig<Person,
      String>(properties.firstName(), 80, "First Name");



ColumnConfig<Person, String> lastName = new ColumnConfig<Person,
      String>(properties.lastName(), 80, "Last Name");
lastName.setCell(new TextInputCell());



ColumnConfig<Person, Integer> height = new ColumnConfig<Person,
      Integer>(properties.height(), 80, "Height");
height.setCell(new NumberCell<Integer>(new IntegerPropertyEditor()));
Design questions?
From Server to Screen
Stores

Rewritten from scratch
API Changes, more consistent with Java Collections
Constructors require a ModelKeyProvider
Loaders, Readers,
Proxies (and Writers)
Loader                DataProxy   Server
         DataReader
Purposes

Loader: Builds requests, sends to DataProxy
DataProxy: Makes request to server
DataReader: Translates wire-format to objects
DataWriter: Translates objects to wire-format
Readers and AutoBeans
All JSON and XML structures represented using AutoBeans

interface ContactCollection {       <?xml version="1.0" encoding="ISO-8859-1"?>
                                    <records>
  @PropertyName("records/record")
                                    	   <record>
  List<Contact> getValues();        	   	   <Name>Middleton, Wendy V.</Name>
}                                   	   	   <Email>morbi.tristique@iaculisquis.org</Email>
interface Contact {                 	   	   <Phone>5574291911</Phone>
  @PropertyName("Name")             	   </record>
                                    	   <record>
  String getName();
                                    	   	   <Name>Stark, Olivia P.</Name>
                                    	   	   <Email>urna.suscipit.nonummy@faucibusleo.edu</Email>
    @PropertyName("Email")          	   	   <Phone>1666312154</Phone>
    String getEmail();              	   </record>
                                    	   <record>
                                    	   	   <Name>Shannon, Rhea D.</Name>
    @PropertyName("Phone")
                                    	   	   <Email>Integer@nibhPhasellusnulla.org</Email>
    String getPhone();              	   	   <Phone>2413489010</Phone>
}                                   	   </record>
Generics
private Loader<String, List<Person>> getPersonLoader() {

	   JsonReader<List<Person>, JsonResults> reader
	   	 	 = new JsonReader<List<Person>, JsonResults>(abf, JsonResults.class) {
	   	 @Override
	   	 protected List<Person> createReturnData(Object loadConfig, JsonResults records){
	   	 	 return records.getPeople();
	   	 }
	   };

	   RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, "/people.json");
	   HttpProxy<String> proxy = new HttpProxy<String>(rb);
	   return new Loader<String, List<Person>>(proxy, reader);
}
Store contents can be
 efficiently replaced
   without Loader
Data Questions?
Customization
Rendering?

ValueProvider instance
With custom path
With LabelProvider
Configured Cell
Custom Cell
Extra Behavior?

Event Handlers
Subclass GridView/TreeView
Custom Cell
Questions?

More Related Content

What's hot

Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xquery
Amol Pujari
 
Parameterization is nothing but giving multiple input
Parameterization is nothing but giving multiple inputParameterization is nothing but giving multiple input
Parameterization is nothing but giving multiple input
uanna
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
Diaz Alfahrezy
 

What's hot (18)

JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)
 
PHP with MYSQL
PHP with MYSQLPHP with MYSQL
PHP with MYSQL
 
Building DSLs with Groovy
Building DSLs with GroovyBuilding DSLs with Groovy
Building DSLs with Groovy
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installation
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examples
 
Functional es6
Functional es6Functional es6
Functional es6
 
03DOM.ppt
03DOM.ppt03DOM.ppt
03DOM.ppt
 
Web 2 | CSS - Cascading Style Sheets
Web 2 | CSS - Cascading Style SheetsWeb 2 | CSS - Cascading Style Sheets
Web 2 | CSS - Cascading Style Sheets
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xquery
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
 
Parameterization is nothing but giving multiple input
Parameterization is nothing but giving multiple inputParameterization is nothing but giving multiple input
Parameterization is nothing but giving multiple input
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
 
The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210
 
The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185
 
Database handling with room
Database handling with roomDatabase handling with room
Database handling with room
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring Data
 

Viewers also liked (20)

Verbal Messages
Verbal MessagesVerbal Messages
Verbal Messages
 
Amniotes
AmniotesAmniotes
Amniotes
 
Internet UK Jihobist A
Internet UK Jihobist  AInternet UK Jihobist  A
Internet UK Jihobist A
 
Bird Book Illustrated, Free eBook
Bird Book Illustrated, Free eBookBird Book Illustrated, Free eBook
Bird Book Illustrated, Free eBook
 
Diane Troyer Laser MetaZtron HIVE
Diane Troyer Laser MetaZtron HIVE  Diane Troyer Laser MetaZtron HIVE
Diane Troyer Laser MetaZtron HIVE
 
Amerindian Civilizations in Latin America
Amerindian Civilizations in Latin AmericaAmerindian Civilizations in Latin America
Amerindian Civilizations in Latin America
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 
Anatomy of inner ear
Anatomy of inner earAnatomy of inner ear
Anatomy of inner ear
 
Sermon 12.05.10
Sermon 12.05.10Sermon 12.05.10
Sermon 12.05.10
 
NEURON SUPPORTIVE CELLS OR ANS
NEURON SUPPORTIVE CELLS OR ANSNEURON SUPPORTIVE CELLS OR ANS
NEURON SUPPORTIVE CELLS OR ANS
 
inner ear
 inner ear inner ear
inner ear
 
Arthropoda insecta
Arthropoda insectaArthropoda insecta
Arthropoda insecta
 
5 c 2007 ammine
5 c 2007 ammine5 c 2007 ammine
5 c 2007 ammine
 
Tuesdays powerpointmorrie
Tuesdays powerpointmorrieTuesdays powerpointmorrie
Tuesdays powerpointmorrie
 
Americanization
AmericanizationAmericanization
Americanization
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
 
Aminoacidurias
AminoaciduriasAminoacidurias
Aminoacidurias
 
Asteraceae
AsteraceaeAsteraceae
Asteraceae
 
Que Comen Los Animales
Que Comen Los AnimalesQue Comen Los Animales
Que Comen Los Animales
 
Ampere’s law
Ampere’s lawAmpere’s law
Ampere’s law
 

Similar to Ext GWT 3.0 Data Widgets

Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdf
meerobertsonheyde608
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
Mouli Chandira
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
Heiko Behrens
 

Similar to Ext GWT 3.0 Data Widgets (20)

Week 12 code
Week 12 codeWeek 12 code
Week 12 code
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
 
Session06 handling xml data
Session06  handling xml dataSession06  handling xml data
Session06 handling xml data
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
 
Android Architecure Components - introduction
Android Architecure Components - introductionAndroid Architecure Components - introduction
Android Architecure Components - introduction
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
Creating a Facebook Clone - Part X.pdf
Creating a Facebook Clone - Part X.pdfCreating a Facebook Clone - Part X.pdf
Creating a Facebook Clone - Part X.pdf
 
Requery overview
Requery overviewRequery overview
Requery overview
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
 
Painless Persistence with Realm
Painless Persistence with RealmPainless Persistence with Realm
Painless Persistence with Realm
 
Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdf
 
What's new in Liferay Mobile SDK 2.0 for Android
What's new in Liferay Mobile SDK 2.0 for AndroidWhat's new in Liferay Mobile SDK 2.0 for Android
What's new in Liferay Mobile SDK 2.0 for Android
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkit
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Php sql-android
Php sql-androidPhp sql-android
Php sql-android
 
GTR-Python-Using Web Services notesgtr.ppt
GTR-Python-Using Web Services notesgtr.pptGTR-Python-Using Web Services notesgtr.ppt
GTR-Python-Using Web Services notesgtr.ppt
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 

More from Sencha

More from Sencha (20)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Ext GWT 3.0 Data Widgets

  • 1.
  • 2. DATA WIDGETS Colin Alworth, Sencha colin.alworth@sencha.com @ambisinister
  • 5. Data Widgets Work With Bean-like POJOs AutoBeans RequestFactory Proxies
  • 6. Reflection? 2.0 uses Map<String,Object> 3.0 generates accessors as needed
  • 7. ValueProviders and PropertyAccess public interface Person { String getFirstName(); String getLastName(); String getEmail(); String getFavoriteColor(); void setFavoriteColor(String color); int getHeight(); void setHeight(int height); }
  • 8. ValueProvider and PropertyAccess public interface PersonProperties extends PropertyAccess<Person> { @Path("email") ModelKeyProvider<Person> key(); ValueProvider<Person, String> firstName(); ValueProvider<Person, String> lastName(); ValueProvider<Person, String> email(); ValueProvider<Person, String> favoriteColor(); ValueProvider<Person, Integer> height(); } ... PersonProperties properties = GWT.create(PersonProperties.class);
  • 10. Cells Lightweight and Reusable Easy to Customize Most Components backed by Cells
  • 11. Field Cells GWT AbstractInputCell AbstractEventInputCell FieldCell ValueBaseFieldCell CheckBoxCell TextInputCell TriggerFieldCell ComboCell DateCell
  • 13. Custom Cell<String> public class MyEmailLinkCell extends AbstractCell<String> { interface Template extends XTemplates { @XTemplate("<a href='mailto:{email}'>{email}</a>") SafeHtml emailTemplate(String email); } private Template t = GWT.create(Template.class); @Override public void render(Context context, String value, SafeHtmlBuilder sb) { sb.append(t.emailTemplate(value)); } }
  • 14. ListView<Person, String> ListView<Person, String> email = new ListView<Person, String>(store, properties.email()); names.setCell(new MyEmailLinkCell());
  • 15. Grid<Person> ColumnConfig<Person, String> firstName = new ColumnConfig<Person, String>(properties.firstName(), 80, "First Name"); ColumnConfig<Person, String> lastName = new ColumnConfig<Person, String>(properties.lastName(), 80, "Last Name"); lastName.setCell(new TextInputCell()); ColumnConfig<Person, Integer> height = new ColumnConfig<Person, Integer>(properties.height(), 80, "Height"); height.setCell(new NumberCell<Integer>(new IntegerPropertyEditor()));
  • 16.
  • 18. From Server to Screen
  • 19. Stores Rewritten from scratch API Changes, more consistent with Java Collections Constructors require a ModelKeyProvider
  • 21. Loader DataProxy Server DataReader
  • 22. Purposes Loader: Builds requests, sends to DataProxy DataProxy: Makes request to server DataReader: Translates wire-format to objects DataWriter: Translates objects to wire-format
  • 23. Readers and AutoBeans All JSON and XML structures represented using AutoBeans interface ContactCollection { <?xml version="1.0" encoding="ISO-8859-1"?> <records> @PropertyName("records/record") <record> List<Contact> getValues(); <Name>Middleton, Wendy V.</Name> } <Email>morbi.tristique@iaculisquis.org</Email> interface Contact { <Phone>5574291911</Phone> @PropertyName("Name") </record> <record> String getName(); <Name>Stark, Olivia P.</Name> <Email>urna.suscipit.nonummy@faucibusleo.edu</Email> @PropertyName("Email") <Phone>1666312154</Phone> String getEmail(); </record> <record> <Name>Shannon, Rhea D.</Name> @PropertyName("Phone") <Email>Integer@nibhPhasellusnulla.org</Email> String getPhone(); <Phone>2413489010</Phone> } </record>
  • 24. Generics private Loader<String, List<Person>> getPersonLoader() { JsonReader<List<Person>, JsonResults> reader = new JsonReader<List<Person>, JsonResults>(abf, JsonResults.class) { @Override protected List<Person> createReturnData(Object loadConfig, JsonResults records){ return records.getPeople(); } }; RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, "/people.json"); HttpProxy<String> proxy = new HttpProxy<String>(rb); return new Loader<String, List<Person>>(proxy, reader); }
  • 25. Store contents can be efficiently replaced without Loader
  • 28. Rendering? ValueProvider instance With custom path With LabelProvider Configured Cell Custom Cell
  • 29. Extra Behavior? Event Handlers Subclass GridView/TreeView Custom Cell