IForm and custom object

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

IForm and custom object

Deisss
I have (i guess) a simple question :

I'm creating a SelectBox with a "+" icon on the right to add listItem to it...

Doing a simple extend of SingleBox with that button, I get that result :

http://i.imm.io/R0Z4.png


Which is of course not what I want because the button "+" should not be inside select box.


My question is : which way is the "best practice" :
-Should I change the template and make a specific one (I don't know if it's possible btw in this case) ?
-Should I create a Widget with two sub-widget inside (the button and select) ?


In case of creating a widget (which was my first idea, but I forgot it because of manual binding to selectBox iForm implements) how to redirect all the IForm constraint to the child control selectbox without typying all redirection manually ?


PS : the original code is available here (quite simple) : http://pastebin.com/LiDiZ42R

Thanks for reply ! Cheers and happy new year !
Reply | Threaded
Open this post in threaded view
|

Re: IForm and custom object

Alexander Steitz
Hi,

in this specific case I would simply add the "+" button to a container containing the selectbox widget. I would not create an own widget to avoid the redirection implementation.

The "+" button is simply a way how to add an item to the selectbox - so it does "only" use the public API of the selectbox and offers a nice graphical interface. From my point of view it is not necessary to create an own widget out of these two elements. It's more a composition of existing widgets.

In the end you want to have a selectbox and a graphical helper button. The public API of the selectbox and all its features with the IForm should stay as they are, right?

Regards,
  Alex

-----Original Message-----
From: Deisss [mailto:[hidden email]]
Sent: Sunday, December 30, 2012 3:25 PM
To: [hidden email]
Subject: [qooxdoo-devel] IForm and custom object

I have (i guess) a simple question :

I'm creating a SelectBox with a "+" icon on the right to add listItem to it...

Doing a simple extend of SingleBox with that button, I get that result :

http://i.imm.io/R0Z4.png


Which is of course not what I want because the button "+" should not be inside select box.


My question is : which way is the "best practice" :
-Should I change the template and make a specific one (I don't know if it's possible btw in this case) ?
-Should I create a Widget with two sub-widget inside (the button and select) ?


In case of creating a widget (which was my first idea, but I forgot it because of manual binding to selectBox iForm implements) how to redirect all the IForm constraint to the child control selectbox without typying all redirection manually ?


PS : the original code is available here (quite simple) :
http://pastebin.com/LiDiZ42R

Thanks for reply ! Cheers and happy new year !



--
View this message in context: http://qooxdoo.678.n2.nabble.com/IForm-and-custom-object-tp7582381.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: IForm and custom object

Deisss
From what you said the best i can achieve is this :

http://tinyurl.com/aaqlmqg

I completely lost the form renderer doing so (I can't do more than that without crash), because the form is not able to recognize the container as an element with a IForm implements inside. So i can only manually add the container to the content, and add the selectbox into the form. In this can't I can't use renderer anymore because it will duplicates graphically system.

When using renderer (that's why I want a way to get IForm running) I get this as I said i lost "+" button, or if I add container, it just don't run :
http://tinyurl.com/aygmdx5

So i finally did it by extending an object which is basically an empty IForm implements, transfering IForm interface requests to selectbox inside. This was the only way i found to keep the form and renderer and have both buttons and selectbox on same line...
Reply | Threaded
Open this post in threaded view
|

Re: IForm and custom object

Alexander Steitz
Hi,

in your particular case I think it is necessary to write an own form renderer. The interface for a renderer is simply - you only need to implement two methods.
-> http://demo.qooxdoo.org/current/apiviewer/#qx.ui.form.renderer.IFormRenderer

Using the "options" you can easily create your own custom form with the renderer without loosing all the other cool features of the forms.

Regards,
  Alex


-----Original Message-----
From: Deisss [mailto:[hidden email]]
Sent: Wednesday, January 02, 2013 8:27 PM
To: [hidden email]
Subject: Re: [qooxdoo-devel] IForm and custom object

>From what you said the best i can achieve is this :

http://tinyurl.com/aaqlmqg

I completely lost the form renderer doing so (I can't do more than that without crash), because the form is not able to recognize the container as an element with a IForm implements inside. So i can only manually add the container to the content, and add the selectbox into the form. In this can't I can't use renderer anymore because it will duplicates graphically system.

When using renderer (that's why I want a way to get IForm running) I get this as I said i lost "+" button, or if I add container, it just don't run :
http://tinyurl.com/aygmdx5

So i finally did it by extending an object which is basically an empty IForm implements, transfering IForm interface requests to selectbox inside. This was the only way i found to keep the form and renderer and have both buttons and selectbox on same line...



--
View this message in context: http://qooxdoo.678.n2.nabble.com/IForm-and-custom-object-tp7582381p7582388.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: IForm and custom object

Deisss
Great idea I was focusing too much on IForm side thanks !

I will post it later if it can help people to figure that specific system ;)

Cheers !