camptocamp / cgxp

22 stars 22 forks source link

Changing title maxLength in print plugin #1102

Closed svavoi closed 7 years ago

svavoi commented 8 years ago

The doc says that it should be possible to change the options given to the print panel: http://docs.camptocamp.net/cgxp/master/lib/plugins/Print.html

I changed the maxlength of the comment and title field of the print plugin to 95 resp. 70: https://github.com/camptocamp/baselstadt_mapbs/blob/master/mapbs/templates/viewer.js#L865-#L876

fieldsExtraClientConfiguration: {
    "A4 Hochformat": {
        "title": {
            fieldAttributes: {
                fieldLabel: "${_('Titel')}",
                emptyText: "${_('Kartentitel')}",
                autoCreate: {tag: "input", type: "text", size: "70", maxLength: "70"}
            }
        },
        "comment": {
            fieldAttributes: {
                fieldLabel: "${_('Untertitel')}",
                emptyText: "${_('Kartenuntertitel')}",
                autoCreate: {tag: "input", type: "text", size: "95", maxLength: "95"}

Now I have the weird behavior that on a first go I can enter more than 45 characters but as soon as I open the print panel a second time the text will be cut after 45 characters.

To reproduce it, do the following:

  1. Open the print panel
  2. Enter this text into the title and comment field: "Situationsnachführung, Rekonstruktion Lagefixpunkte + Grenzzeichen"
  3. print a pdf -- > everything works so far
  4. close the print panel and open it again
  5. Enter this text into the title and comment field: "Situationsnachführung, Rekonstruktion Lagefixpunkte + Grenzzeichen" --> the text gets cut after 45 characters. The maxlength seems to be put back to 45...

Am I doing something wrong?

sbrunner commented 8 years ago

Can you provide a permalink?

svavoi commented 8 years ago

It doesn't matter what you print. This is the URL to our production https://map.geo.bs.ch or development environment http://map.geo.dev.bs.ch