How to deal with xforms:instance/resources?

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

How to deal with xforms:instance/resources?

yougo
Hi all,

I'm trying to create some very simple xbl components that should behave just like an xforms:select1 minimal (i.e. dropdown) but with some defaulted values for label / hint / help and dropdown options.

I thought I could just use the select1 and provide the values I want (label / hint / help and dropdown options) but it's not working.

I understood that the way to provide values in language sensitive way is through the resources section but I cannot understand how to tell my xbl to set the resources part.

First problem:
This is the xbl I wrote:

gender-dropdown.xbl

The result in form builder is a dropdown with the items that I specified but when I click on edit items link the popup shows the default options instead of the ones of the dropdown:

gender-dropdown-edit-items.jpg

So I guess the way I passed the options is not the right one...

I believe the issue is related to the resources part of xml, this is what I have when I choose "edit source" in form builder:

gender-dropdown-viewsource.xml

The options for the dropdown edit items are there but they are the default ones from resources.xml and not the ones actually available... I don't think I need to change something in resources.xml right? It should be used only for the generic dropdown, correct?

Second problem (I think it is somehow related to resources)
How can I tell form builder to prepopulate the label / hint / help fields with some provided values? I'd like to have the fields prepopulated but still modifiable by the user of the form builder.

I've tried to put the desired label value in the template part like <xforms:label ref="">label value</xforms:label> but with no luck.

ps. I've read the http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide but couldn't find anything related to this... is there other documentation I could read? I feel I'm missing the very basics but couldn't find much docs on the web.

thank you for your help,
Ugo
Reply | Threaded
Open this post in threaded view
|

Re: How to deal with xforms:instance/resources?

Erik Bruchez
Administrator
> *First problem:*

> This is the xbl I wrote:
>
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n4655428/gender-dropdown.xbl
> gender-dropdown.xbl
>
> The result in form builder is a dropdown with the items that I specified but
> when I click on edit items link the popup shows the default options instead
> of the ones of the dropdown:
>
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n4655428/gender-dropdown-edit-items.jpg
> gender-dropdown-edit-items.jpg
>
> So I guess the way I passed the options is not the right one...

> I believe the issue is related to the resources part of xml, this is what I
> have when I choose "edit source" in form builder:
>
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n4655428/gender-dropdown-viewsource.xml
> gender-dropdown-viewsource.xml
>
> The options for the dropdown edit items are there but they are the default
> ones from resources.xml and not the ones actually available... I don't think
> I need to change something in resources.xml right? It should be used only
> for the generic dropdown, correct?
This seems to work with the 4.0 milestones. In 3.9 and earlier, the
builder was "interpreting" components at design time in a limited way.
In 4.0, the components are actually running. So the dropdown with the
items is working.

> *Second problem* (I think it is somehow related to resources)
> How can I tell form builder to prepopulate the label / hint / help fields
> with some provided values? I'd like to have the fields prepopulated but
> still modifiable by the user of the form builder.
>
> I've tried to put the desired label value in the template part like
> <xforms:label ref="">label value</xforms:label> but with no luck.

Now for prepopulating the labels etc., this is a bit trickier because
Form Builder doesn't support this. The resources like labels etc. are
stored separately (in the "fr-resources" instance of the form), and
there is no mechanism whereby you the XBL component metadata can tell
Form Builder to store default values there.

-Erik

> ps. I've read the
> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide but
> couldn't find anything related to this... is there other documentation I
> could read? I feel I'm missing the very basics but couldn't find much docs
> on the web.
>
> thank you for your help,
> Ugo
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/How-to-deal-with-xforms-instance-resources-tp4655428.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws