hi,
maybe you didn't add the get for the myID,the jelly will default to
invoke this method to get the item's value
public class ViewProjectProperties extends ViewProperty{
public final String myID;
* public String getMyID()*
* {*
* return this.myID;*
* }*
@DataBoundConstructor
public ViewProjectProperties(final String myID) {
//store it in a file
}
@Extension
public static class DescriptorImpl extends ViewPropertyDescriptor {
@Override
public String getDisplayName() {
return "My Id";
}
@Override
public boolean isEnabledFor(View view) {
return true;
}
}
public String getMyID() {
return myID;
}
}
在 2014年2月25日星期二UTC+8上午2时33分34秒,swastb写道:
>
> Bruno thanks again for the reply. The invisibleEntry worked for me very
> well when I added a JobPropertyDescriptor , however the same thing is not
> working for me in ViewPropertyDescriptor.
>
> Here is my ViewPropertyDescriptor.java
>
> public class ViewProjectProperties extends ViewProperty{
>
> public final String myID;
>
> @DataBoundConstructor
> public ViewProjectProperties(final String myID) {
> //store it in a file
> }
>
> @Extension
> public static class DescriptorImpl extends ViewPropertyDescriptor {
>
> @Override
> public String getDisplayName() {
> return "My Id";
> }
>
> @Override
> public boolean isEnabledFor(View view) {
> return true;
> }
>
> }
> public String getMyID() {
>
> return myID;
> }
>
> }
>
>
> the config jelly present in ViewProjectProperties folder
>
>
> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
> xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
> xmlns:f="/lib/form">
> <!-- // didnt work
> <f:invisibleEntry field="myID">
> <input type="hidden" value="${instance.myID}" />
> </f:invisibleEntry>
> -->
> <input type="hidden" value="${instance.myID}" name="myID"/>
> </j:jelly>
>
>
在 2014年2月7日星期五UTC+8下午1时04分57秒,swastb写道:
>
> Hi All,
>
> We want to extend the ViewProperty and add an hidden variable as part of
> View. But by default the variable present in the ViewProperty extension is
> coming as a checkbox in the view. Is it expected behavior? Is there a way
> to make the variable as hidden variable in view screen? we tried with
> adding f:invisibleEntry in the corresonding config.jelly file but it didn't
> help. is there any other way?
>
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.