Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified
Accepted Solution

Customized List

1.jpgHow to design this  Screen For TabletOs

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Customized List

[ Edited ]

If you want the horizontal lines too, I would (pseudo code - has not been tested ):

 

 

class Rowfield extends UIComponent
{ private var _label : Label = new Label(); private var _value : TextInput = new TextInput(); /////////////////////////////////////////////////// public function RowField( label : String ) {   
    this.addChild( this._label );
    this.addChild( this._value );

this._label.text = label + ':'; this._label.width = this._label.textWidth + 5; this._label.height = this._label.textHeight + 5; } ////////////////////////////////////////////////// override protected function draw() : void { this._label.x = 5; this._label.y = 2; this._value.x = 200; this._value.y = 2; this._value.width = this.width - 200 - 10; this.graphics.clear(); this.graphics.lineStyle( 1, 0x666666 ); this.moveTo( 0, this.height ); this.lineTo( this.width, this.height ); this.endFill(); }
  /////////////////////////////////////////////////
  public function set value( txt : String ) : void
  {
    this._value.text = txt;
  }

  /////////////////////////////////////////////////////
  public function get value() : String
  {
    return this._value.text;
  } }

 In parent control:

 

 

private var _name : RowField = new RowField( 'Name' );
private var _address : RowField = new RowField( 'Address' );
...

// in constructor

this.addChild( this._name );
this.addChild( this._address );

// in draw
this._name.y = 0;
this._name.width = this.width;

this._address.y = this._name.y + this._name.height;
this._address.width = this.width;
// there are various ways to position the controls
// would also look into container with vertical positioning of children

 Looks like your parent control has a rounded rectangle that can be done in its draw() method.

Hope I understood your question.

 

NO GUARANTEE THE ABOVE CODE COMPILES SINCE IT WAS WRITTEN ON THE FLY.  (Normally I would validate what I post).

 

Please use plain text.
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified

Re: Customized List

nice...... But i want add the both Label and TextInput in a List

Please use plain text.
Developer
gluth
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Customized List

You can do it, as I sad in one of previous post you can use CellRenderer (it is weird, but they can have active elements, like buttons and edit fields - double crazy), you can also use a ScrollPane to which you will put all labels and textinputs. Your choice.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
Please use plain text.
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified

Re: CellRander

how to add cellRander in a list..........

Please use plain text.
New Developer
jjackson
Posts: 18
Registered: ‎11-14-2010
My Device: Not Specified

Re: CellRander

I found it easier to ignore cellRender and make my own custom list.

 

Extend a scrollpane, and put a extended container in it as a child. create your own additem and removeitem methods to the scrollpane that just calls the same methods to the container.  Have your container add and remove children that are list items. Have another extended container that has a text input and label in it with whatever your layout is. Attach a listener to the list object your just created. Have it bubble a custom event such as onListItemSelected to your main parent where you intercept it act on it.

 

This is basic oop programming.   The predefined classes are just for convenience when they suit your purposes, you shouldn't completely rely on them to make an app.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: CellRander

Once you define your renderer, you set it to the control for the given state (if the control has more than one state).

Please use plain text.
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified

Re: CellRander

send me any sudocode for understasing

Please use plain text.
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified

Re: Customized List

in list how can i add this filds..........

Please use plain text.
Contributor
razzlakki
Posts: 11
Registered: ‎11-20-2010
My Device: Not Specified

Re: CellRander

send  sudocode....................for ur explanation

Please use plain text.