QCMagritte and MAJQDateInputComponent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

QCMagritte and MAJQDateInputComponent

pdigonzelli1
Hi, i am using QCMagritte and I like it. The problem I found is in using custom components.
For example I have this description

<magritteDescription>
^ MADateDescription new
    priority: 200;
    beRequired ;
    label: 'Vencimiento';
    accessor: #vencimiento;
    default: ( Date today + 30 ) ;
    componentClass: MAJQDateInputComponent ;
    comment: 'Fecha de vencimiento de la lista de precios';
    yourself


But no MAJDateInputComponent is using by description.
Can anyone help me?

TIA

Ing. Pablo Digonzelli
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: [hidden email]
[hidden email]
Cel: 5493815982714


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: QCMagritte and MAJQDateInputComponent

Stephan Eggermont-3

On Sep 11, 2014, at 0:36 , Pablo R. Digonzelli wrote:

Hi, i am using QCMagritte and I like it. The problem I found is in using custom components.
For example I have this description

<magritteDescription>
^ MADateDescription new
    priority: 200;
    beRequired ;
    label: 'Vencimiento';
    accessor: #vencimiento;
    default: ( Date today + 30 ) ;
    componentClass: MAJQDateInputComponent ;
    comment: 'Fecha de vencimiento de la lista de precios';
    yourself

But no MAJDateInputComponent is using by description.
Can anyone help me?

Are you using the bootstrap application template?
Do you use a builder that overrides the component?

Stephan

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: QCMagritte and MAJQDateInputComponent

pdigonzelli1
Yes, i am using an my aplication class wich is a subclass of QCBootstrapApplication .
I don't use custom builder other than QCmagritte's.


Ing. Pablo Digonzelli
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: [hidden email]
[hidden email]
Cel: 5493815982714


De: "Stephan Eggermont" <[hidden email]>
Para: "Pier and Related Tools Magritte ..." <[hidden email]>
Enviados: MiƩrcoles, 10 de Septiembre 2014 20:15:01
Asunto: Re: QCMagritte and MAJQDateInputComponent


On Sep 11, 2014, at 0:36 , Pablo R. Digonzelli wrote:

Hi, i am using QCMagritte and I like it. The problem I found is in using custom components.
For example I have this description

<magritteDescription>
^ MADateDescription new
    priority: 200;
    beRequired ;
    label: 'Vencimiento';
    accessor: #vencimiento;
    default: ( Date today + 30 ) ;
    componentClass: MAJQDateInputComponent ;
    comment: 'Fecha de vencimiento de la lista de precios';
    yourself

But no MAJDateInputComponent is using by description.
Can anyone help me?

Are you using the bootstrap application template?
Do you use a builder that overrides the component?

Stephan

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: QCMagritte and MAJQDateInputComponent

Stephan Eggermont-3
In reply to this post by pdigonzelli1
If I add it to a QCTutorial (and make it editable), it works for me. On the QCTutorialModel it doesn't.
It needs some css though.

Stephan

On Sep 11, 2014, at 0:36 , Pablo R. Digonzelli wrote:

<magritteDescription>
^ MADateDescription new
    priority: 200;
    beRequired ;
    label: 'Vencimiento';
    accessor: #vencimiento;
    default: ( Date today + 30 ) ;
    componentClass: MAJQDateInputComponent ;
    comment: 'Fecha de vencimiento de la lista de precios';
    yourself


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: QCMagritte and MAJQDateInputComponent

pdigonzelli1

Stephan , I solved this specific problem doing this.


QCGroupedFormRenderer renderControl:id: is used.
renderContentOn:ajaxScript: and then renderEditorOn:ajaxScript; and renderInputOn:ajaxScript: are in the message chain .


What i did was create renderInputOn:ajaxScript: into MAJQDateInputComponent


renderInputOn: html ajaxScript: aScript
    self renderInputOn: html.


It works very well now.

I am newbie to develop Seaside , Magritte and QCMagritte apps then i hope everyone express their opinion about this workaround.


TIA



Ing. Pablo Digonzelli
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: [hidden email]
[hidden email]
Cel: 5493815982714


De: "Stephan Eggermont" <[hidden email]>
Para: "Pier and Related Tools Magritte ..." <[hidden email]>
Enviados: MiƩrcoles, 10 de Septiembre 2014 21:17:43
Asunto: Re: QCMagritte and MAJQDateInputComponent

If I add it to a QCTutorial (and make it editable), it works for me. On the QCTutorialModel it doesn't.
It needs some css though.

Stephan

On Sep 11, 2014, at 0:36 , Pablo R. Digonzelli wrote:

<magritteDescription>
^ MADateDescription new
    priority: 200;
    beRequired ;
    label: 'Vencimiento';
    accessor: #vencimiento;
    default: ( Date today + 30 ) ;
    componentClass: MAJQDateInputComponent ;
    comment: 'Fecha de vencimiento de la lista de precios';
    yourself


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: QCMagritte and MAJQDateInputComponent

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Indeed, if you want the ajax support to work, you might need to change
some components. Good that you could make it work.

Some details that might be helpful:

1 If you have more date input fields that should use
this component, the builder is your friend.
Take a look at

QCBootstrapComponentBuilder>>visitBooleanDescription: aDescription
        (aDescription componentClass = MACheckboxComponent)
                ifTrue: [ aDescription
                        componentClass: TBSMagritteCheckboxComponent ].
        super visitBooleanDescription: aDescription

You can do the same:

 QCMyBootstrapComponentBuilder>>visitDateDescription: aDescription
        (aDescription componentClass = MADateInputComponent)
                ifTrue: [ aDescription
                        componentClass: MAJQDateInputComponent ].
        super visitDateDescription: aDescription

and then in your QCBootstrapApplicationModel subclass override
the defaultLayoutBuilder to ^QCMyBootstrapComponentBuilder.

2 The MAJQDateInputComponent is not styled to fit in
with Bootstrap. There it would make sense to use
an input-group-addon/btn and the glyphicon-calendar

3 Please let me know if you want to be added as committer
to the QCMagritte repo. A clean way to add this would be to
add a package
  QC-Magritte-Addons
and put the extension method in method category
  *QC-Magritte-Addons
So you can save it independently without having to change
  Magritte-JQuery

4 The application model only shows the fields where
a relationdescription (subclass) responds true to isRoot.
Override it, or depend on

MARelationDescription>>defaultIsRoot
        self classes ifEmpty: [ ^false ].
        ^self commonClass canBeRoot

Stephan


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki