"One or more fields in this block have been edited." is always displayed.

32 views
Skip to first unread message

Daniel Anechitoaie

unread,
Aug 7, 2017, 3:33:58 PM8/7/17
to Jenkins Developers
I have the following config.jelly file https://bitbucket.org/snippets/danechitoaie/EAgn4K
Which generates repeatable string textboxes but the problem is that each time I access the configuration page I get this "One or more fields in this block have been edited." without touching anything.

Any idea why this happens? And what I can do to not behave like this?

PrintScreen of how it looks: http://i.imgur.com/1estWLh.png


Another strange thing I noticed is that if I have just a "<f:checkbox" inside and if I have the "field" attribute it behaves the same (as in I get this "One or more fields in this block have been edited." icon without doing anything.) But if I replace the "field" attribute with "name" it still work sand aI don't get this icon and message.


Thank you.

Daniel Anechitoaie

unread,
Aug 7, 2017, 3:54:08 PM8/7/17
to Jenkins Developers
I think I figured it out. This actually seems to be a feature of Jenkins and not a bug in my code.
After looking trough Jenkins code I found in textbox.jelly the following.

  <j:if test="${customizedFields != null and attrs.field != null and value != default}">
    <j:mute>${customizedFields.add(name)}</j:mute>
  </j:if>

So it seems that this is normal, and this is to show that the data has been changed and it's no longer the default value.
I was actually thinking otherwise that it's a bug in my code as I haven't seen this "modified" icon in any other plugin that has an "advanced" section, that I've tested.

If anyone can please confirm my above findings are true it would be great.

Thanks.

Jesse Glick

unread,
Aug 8, 2017, 8:30:41 AM8/8/17
to Jenkins Dev
On Mon, Aug 7, 2017 at 3:54 PM, Daniel Anechitoaie
<danie...@gmail.com> wrote:
> So it seems that this is normal, and this is to show that the data has been
> changed and it's no longer the default value.

Yes. I am not sure if this is well tested with repeatable sections.
Definitely you should be using normal databinding, meaning
`f:repeatableProperty` with no body (`config.jelly` gets looked up on
the nested `Describable`); see `ui-samples-plugin`.

Daniel Anechitoaie

unread,
Aug 8, 2017, 9:08:12 AM8/8/17
to Jenkins Developers
Hi,

I have replaced now the 
<st:include
    page="config.jelly"
    class="org.jenkinsci.plugins.myplugin.deploy.SourcePath"
/>


with 

<f:repeatableProperty
field="sourcePaths">

<div align="right">
<f:repeatableDeleteButton />
</div>
</f:repeatableProperty>

and seems to be working fine.

Thank you.
Reply all
Reply to author
Forward
0 new messages