How to add a button with a default label?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add a button with a default label?

Zeder127
Hello,

I have question about "button" control.

Is it possible to add a button control with a default label, like "My Button"? And the label should still be editable if click on it.

It seems that, I have to do some changes in button-controls.xbl, but how?

Thanks for any help!
Reply | Threaded
Open this post in threaded view
|

Re: How to add a button with a default label?

Alessandro  Vernet
Administrator
Hi Xue,

The behavior you describe corresponds to what happens in Form Builder when you add a button to a form, right? Are you saying that you'd like to see this at runtime as well? Could you tell us more about the use case you have in mind?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to add a button with a default label?

Zeder127
Hello Alex,

Thank you for your reply.

Actually, I only need this happens in Form Builder, because only the form definition is important for me.

I want to have some default buttons that have default labels, e.g. "Save", "Edit", "Close&Save", etc.

If it is possible, I don't have to enter those labels every time by myself  and I can still change the labels later in Form Builder.


Reply | Threaded
Open this post in threaded view
|

Re: How to add a button with a default label?

Alessandro  Vernet
Administrator
Hi,

Got it. Then, I imagine that you could create your own XBL controls for each button, which would mostly be copies of button.xbl. But I don't like the idea that you'd need to copy button.xbl, just to avoid typing "Save" or "Edit". Maybe you could create a single control that uses the xf:trigger and allows the user to select the value of the label from a dropdown in the control properties. I think that would be my prefered way of doing this.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet