How do I programatically read a custom page field from within a webpart (from the page the webpart is on)?
Thanks
Jon
Same as you would a non-custom field type:
CustomFieldType customField = (CustomFieldType)page.ListItem["FieldName"];
Only you cast to your custom field type.
Related
example form:
https://demo.orbeon.com/demo/fr/orbeon/builder/edit/f44c7d78e5c9e76ec00df2bf9bdcf63d3b708c76
I'm trying to get dropdown label value. I was able to get label value (by attribute #label) from dynamic dropdown when 'Service performs search' is set to Yes. But when 'Service performs search' is set to No or when I use static dropdown I was unable to get label value.
Is it possible to get label value in other cases?
If you had a regular dropdown, you would use the xxf:itemset() function. That function returns XML or JSON that represents all the choices, with the selected choice marked as such. For more on this, see the doc on xxf:itemset(). So you could do something like:
xxf:itemset(
'my-dropdown',
'xml',
true()
)/itemset/choices/item[#selected = 'true']/value
But currently, xxf:itemset() doesn't work with XBL controls, and the Dropdowns with search are XBL controls. This is covered by request for enhancement #768.
I want to add an autocomplete field into a Orbeon form. In the Control Settings I can choose an HTTP service which holds the itemset contains of the Resource URI.
How can I setup the autocomplete to instead an existing itemset from another dropdown field?
I am sorry to say that, at least as of Orbeon Forms 2017.1, an autocomplete you add to a form you create in Form Builder can only get its values from the XML or JSON returned by a service. For reference, I've added a +1 from you on request for enhancement 2380.
I have to add a custom field ie. Drop List of country and auto populate the Drop List of cities on selection of respective country in Sitecore Client.
If possible we have to take the list of Countries and Cities from the Content Item.
There is nothing like this out of the box in Sitecore. What you need to do is to implement custom Sitecore field.
Short tutorials how to build one can be found:
https://sdn.sitecore.net/articles/api/creating%20a%20composite%20custom%20field/adding%20a%20custom%20field%20to%20sitecore%20client.aspx
http://www.sitecore.net/learn/blogs/best-practice-blogs/martin-knudsen/posts/2012/09/creating-a-custom-sitecore-field.aspx
And here you can find an answer how to build a custom field which uses one dropdown depending on another: Sitecore grouped droplist
Given a grails domain object with properties like
Integer displayOrder
Boolean visible
... what would be the best way to associate meta information about these fields for display on tooltips in edit view?
Thanks a bunch.
I would probably just add a message to message.properties with the content:
// messages.properties
myDomain.myField.tooltip = Enter an awesome field value for this field
And then render it appropriately in the markup alongside the field, or wherever:
<g:message code="myDomain.myField.tooltip"/>
I am working on a model criteria builder. I have a dropdown list with all of the model properties, a dropdown list with static operators (less than, equals, like, etc) and a user input form element for the value. The issue is that the form element type (dropdown, date, text box, etc) for the user input value needs to be based on the data type of the model property chosen in the first dropdown list. What is the best way to achieve this using MVC 2? Ideally I would like to just create an Html extension method and use it like Html.CriteriaFilterFor(model => model) and be able to customize the display using model attributes and metadata.
You should use JQuery to populate the other one. An AJAX call would allow you to pull the second drop down's list. Populating Dropdownlist Using MVC2 Based On Another Dropdownlist (Cascading DropDownList)