Orbeon Forms: Displaying Version on Form - orbeon

This is my first post in this forum, so be gentle with me!!
My client wants to be able to view the form version on specific forms, and a suggestion was to use the following syntax in a control: fr:form-version()
However, this only displays the value "1" when the form is actually at version "4".
Any ideas?
PeteA
Used syntax in a control: fr:form-version()

Try to use xxf:instance('fr-parameters-instance')/form-version. It work only in runner, not while testing in builder.

Related

orbeon forms - Dynamic Dropdown remove value

I’m using Oberon forms version 2019.2 CE.
In my form I have Dynamic Dropdown (with search) with country select (required field) and Text field with display code of selected country:
When I select country, in text field appears selected country code:
Now I can click ‘x’ sign to remove value form drop down:
Value in field 'code' has not been deleted. When I click Validate button no error is detected. It seems that when I use 'x' sign to remove value from dropdown, I remove only label, not value.
My question is whether it is possible to remove both label and value, when I click 'x' sign?
I am unable to reproduce this with Orbeon Forms CE 2019.2. This is what I am seeing when running this form. If this doesn't help, I'd recommend you update your question to include a link to a minimal form that you are using to reproduce this, with steps to reproduce (and then post a comment, for notification).
It looks like the problem occurs when I use ‘Service performs search’ option set to ‘Yes’. Below you can see how it looks like in my form:
Source code of the form: here

What does #Html.Sitecore.Placeholder() point to?

In Sitecore 7 MVC, my understanding is that partial views are represented by using Razor declarations such as #Html.Sitecore().Placeholder("some_thing") in a .cshtml file.
In this context, what does the argument "some_thing" actually represent - is it something located in the Sitecore instance? If so, how can I locate the thing that "some_thing" represents within the Sitecore database?
In the shortest way: Sitecore Placeholder is a place where you can add your components.
The argument some_thing in #Html.Sitecore().Placeholder("some_thing") is the name of the placeholder.
You can have multiple placeholders on your page. When you add a component to a page, you tell Sitecore "Put in in placeholder some_thing and that's how Sitecore knows where to place it.
Read Presentation Component Reference for more information (yeah this document is years old, but the idea is still the same).
#Html.Sitecore().Placeholder("some_thing") is typically in a layout page such as your DefaultLayout page. Like Marek said it is a place that you put components. If you log into Sitecore and look into at a page, under the Presentation tab, there is an icon that says Detail. Click that. A pop-up will open (I think it still did in version 7, I dodn't have an instance running. On that popup, select a component or add a new component to the Default Layout. In the settings for the component will be a field called Placeholder. Put the text "some_thing" in there without the quotes. I think this is what you are asking what this is the placeholder representing.

How to properly encode links to external URL in MVC Razor

This view suppose to show a list of hyperlinks, each pointing to an external URL. The goal is for the user to click one of these links and have their browser open a new tab with the selected URL.
Currently I have the following markup:
#Html.ActionLink("SomeSite", "http://subdomain.mydomain.com/SomeSite")
This markup produces:
http://localhost:58980/AccessInstance/http%3a/subdomain.mydomain.com/SomeSite
instead of :
http://subdomain.mydomain.com/SomeSite
What can I change in my markup to make this work as I expect?
You don't need to use #Html.ActionLink for that. Just use a plain A tag:
SomeSite
Html.ActionLink is specifically for generating links to actions defined in MVC controllers, in the same app. Since you're linking to an absolute URL, you don't need any of the functionality that Html.ActionLink provides.
Two ways :
1. update the database column with full link:
eg SQL:
update ProductTable set ProductLink='http://www.example.com/Product/Mobiles' where ID=123
In asp mvc view
View
2. Hardcode the http part and list from model
View
Hope helps someone.
While a ViewBag is overused and not the best choice most of the time this is something that I had done when inheriting someone else's mvc app to do a quick fix for a URL that I needed to redirect to with a specific dynamically changing querystring parameter
<a target="_parent" href="http://localhost:56332/services/#ViewBag.factory">View Service</a>
Using .NET Core 6
This seems to be the most correct answer:
Link
This will generate the following result:
As you can see at the bottom left corner of the window before clicking the link, the URL address was rendered as it is (NOTE: The cursor was recorded out of place for some reason, that's a ShareX problem, ignore it).
Than link will be directly saved as a nvarchar(750) type (probably any character like type will do the work). No changes to the original link were made before saving it or on reading:
You need to take into account your RouteConfiguration.
routes.MapRoute(
name: "Default",
url: "{controller}/{action}"
because you are specifying the action link as the entire link that you want to redirect.
I would recommend that you use the #rossipedia answer because you can make tricky things like putting a span inside the link
Here to display link that are clickable in index page
<td>
#Html.ActionLink(item.FileName, "../Uploads/Catalogue/"+item.FileName)
</td>

KendoUI Autocomplete list appears on top of the textbox

I am making my first steps with KendoUI for MVC. I have a very simple model that reads a table "Products" from the database and passes it to the view as a strongly type model.
I am using the Model to bind it to the autocomplete to get the suggested values. This works almost fine. This is done using the following Razor syntax:
#(Html.Kendo().AutoComplete()
.Name("productAutoComplete")
.DataTextField("Name")
.BindTo(Model)
.Filter(FilterType.StartsWith)
.Placeholder("Select the product")
.Suggest(true)
)
The problem that I have is that the dropdown list that has the suggestions for the autocomplete appears on top of the textbox itself (instead of right below it).
Please see the image below without typing anything in the autocomplete field:
And with the autocomplete in action:
Do you have any suggestions?
Thanks in advance,
Lefteris
I have overcome the problem by using the latest jQuery library (1.9.1) instead of the one shipped with KendoUI (1.7.1).
I am still not sure why this was not working with 1.7.1 (it is ok with 1.9.0+).
In any case KendoUI latest version (Q1 2013) ships with 1.9.1 jQuery. Unfortunatelly this doesn't seem to be available yes as a trial for KendoUI Complete for ASP.NET MVC
I hope this solution helps someone else.
Lefteris

Primefaces, captcha and FacesMessage

I have integrated reCaptcha component in my JSF view (Primefaces) and I want to gather reCaptcha fails errors (blank or error values).
I have to use <p:messages/> component with for attribute because I have many <p:messages/> components (1 for tab in <p:tabView/> component) but when I define id attribute in my <p:captcha/> component and use that id in the for attribute of the <p:messages/>, it doesn't work. When I don't use for attribute to test, I see FacesMessage like :
j_idt16:j_idt69 : bla bla bla...
but j_idt16:j_idt69 id doesn't seem to exist in my generated HTML code...
If I use for="j_idt16:j_idt69" it doesn't work too...
So how can I dispatch captcha messages into proper messages component please ?
The Captcha provide by Primefaces didnt work for me. Please follow the following tutorial which solved my captcha problem using JSF 2 /Primefaces.
http://techzone4all.wordpress.com/2012/02/20/integrate-simple-captcha-to-web-project/
To address your specific need, you should define values for the validatorMessage,converterMessage and requiredMessage attributes on the <p:captcha/>, to be able to display user-friendly messages for their respective situations. FYI the <p:captcha/> component is processed during the submit of it's enclosing form, i.e it cannot be attached to a specific component or anything like that.
For clean message display, you should only place the captcha component in a <h:form/> along with other components relevant to the reCaptcha operation.

Resources