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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Daniel Anechitoaie
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.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/849e38cf-2082-4a4f-8684-cd16cb204c27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Daniel Anechitoaie
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.



On Monday, August 7, 2017 at 10:33:58 PM UTC+3, Daniel Anechitoaie wrote:
I have the following config.jelly file <a href="https://bitbucket.org/snippets/danechitoaie/EAgn4K" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fsnippets%2Fdanechitoaie%2FEAgn4K\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFATzAlkgslZTUNPsGG4Y-CGCIyJg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fsnippets%2Fdanechitoaie%2FEAgn4K\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFATzAlkgslZTUNPsGG4Y-CGCIyJg&#39;;return true;">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: <a href="http://i.imgur.com/1estWLh.png" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fi.imgur.com%2F1estWLh.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHkFnpNzkwtacIH2i5X2cnQp2UMxA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fi.imgur.com%2F1estWLh.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHkFnpNzkwtacIH2i5X2cnQp2UMxA&#39;;return true;">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.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/82b7f4f8-5ee8-4f09-9f38-775b140505ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Jesse Glick-4
On Mon, Aug 7, 2017 at 3:54 PM, Daniel Anechitoaie
<[hidden email]> 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`.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2tENFbbBQNak6F5xc2jC68grFZ2Uqd2%2BGp_h-HW1iH4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Daniel Anechitoaie
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.




On Tuesday, August 8, 2017 at 3:30:41 PM UTC+3, Jesse Glick wrote:
On Mon, Aug 7, 2017 at 3:54 PM, Daniel Anechitoaie
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UGNQLx78BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">danie...@...> 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`.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/12acabdf-266e-489b-bb05-5e81c178ada9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...