Thymeleaf link with a string value - thymeleaf

Can i place a string value in thymeleaf link instead of id and without first listing the database table contents. Like this
<a th:href="#{particularList/{type}(type=lcd)}">

Related

While creating a workflow variable(of type String) for a hyperlink field in SPDesigner 2013, the return field is "As Dictionary from JSON"

Scenario :
I have a list of items. This list has columns with text value information(lets say Val1, Val2, Val3,..) and links which will take the user to the other pages. One of these fields is a URL column (type - hyperlink) which acts as a filter. On clicking the URL, it directs to another page and filters the page for each specific value(for e.g Val1) from the parent page.
So to achieve this,
- I created a new workflow in SP Designer 2013,
- Created a workflow variable of type String (lets say **'WFVar1'**) and added to Action ‘Set Workflow Variable’
- For the ‘value’ in the action I clicked the 3 dots (…) on the right, I set the URL for e.g
https://abc.xyx.com/thisisanexample.aspx and then clicked on Add or
Change Lookup and set the field from Source as Val1. The return
field automatically fills up *"As String"*. The URL is now followed
by Val1.
- Once done with the URL and description, I added the workflow Action ‘Set Field in Current Item'
- I clicked ‘field’ in the Action and choose the hyperlink field(URL) of the list.
Here comes the issue :
I click the ‘value’ in the Action and choose ‘workflow Variable and
Parameters’ and select the variable WFVar1. The return field
automatically gets set to "As Dictionary from JSON" instead of
"As String".
Due to the type difference, the workflow doesn't work and remains suspended.
Need help!!
URL fields do contain multiple string values for the URL and text description.
Since the return type is a dictionary, you may need to store it into a dictionary variable and then extract out the text and URL into separate string variable for later use.
If you need to know what the fields in the JSON are, you can save the dictionary to a string variable and write it out to the log if the JSON string is less than 250 characters, else it will also lock up and in that case you can write the value to a multi-line text field in a list which has a length limit of 64k characters.

MVC html string field 2 way binding

I have a controller that have a field HtmlContents with data like <input type=text>
I know how to render that text as html using:
#Html.Raw(Model.HtmlContent)
What I need now is that when the user type some thing and the form submit
the value of Model.HtmlContentupdate so I need some thing like #html.textboxfor(a=>a.HtmlContent) that return the updated value that what I mean by 2 way binding.
Thank you

passing value to umbraco form and setting the fields rendring through macro

I want to set the form fields like name and email from data though url query string . I have rendered the form through macro . how i can do that
my macro rendering code is
#Umbraco.RenderMacro("renderUmbracoForm", new {FormGuid="ccebfbe8-aa28-497e-8078-c3577c88f47a", FormTheme="" ,
ExcludeScripts="0"} )
My form fields are Name, Email , EventName
and url query is
http://localhost:17402/register?eventId=1342&eventName=you%20cant%20save%20the%20world%20alone
In Umbraco Forms, you can set the Default Value of a field.
For example, set the Default Value to something like [#queryName]. The 'queryName' will be your querystring parameter name in the URL (http://www.website.com/contactus?queryName=Foo) - Umbraco does the rest.
I referred to this and it was pretty straight forward:
https://our.umbraco.org/forum/umbraco-pro/contour/14340-Set-value-of-radiobuttonlist-from-querystring

Raw Querystring in ActionLink

In razor mvc helper, I can provide a querystring to ActionLink as a name value pair e.g. new {x = "something"}
How can I pass a querystring which is raw data and not name value e.g. if I have abc, I want it to show as <a href="mylink?something"> instead of <a href="mylink?x=something">
You can use Url.Action html helper method along with the anchor tag markup.
Test

How to pass a parameter to the Spring controller via an URL?

I want to pass a parameter to the controller and this is what i did :
<c:out value="${activity.nom_etabl}"/>
The controller :
#RequestMapping(value="/getinfoEtab")
public String getInfoEtablissement(#RequestParam("nomEtab") String nometab,ModelMap model){
model.addAttribute("etabliss", actservice.FicheEtabl(nometab));
return "FicheEtablissement";
}
But the controller with this way doesn't get the parameter.
Is ${pageContext.request.contextPath}/getinfoEtab resolving into the url you are trying to reach?
If your context path is the same as in the url for the page that contains your <a href> tag then you don't need ${pageContext.request.contextPath}. You can directly use <a href="getinfoEtab?nomEtab=. But if its taking you to the controller don't even bother changing it.
Do you see a value in your link where you have <c:out value="${activity.nom_etabl}"/>? If you can see the value, then change your code to <a href="${pageContext.request.contextPath}/getinfoEtab?nomEtab=${activity.nom_etabl}">

Resources