How to include a gsp fragment with config values inside html forms

Hi,

I am trying to include a fragment inside the html form. I am able to include the fragment if there are no config fields required using the following syntax:

but if the field has required config values, i cant make an entry:

<uiInclude provider=“uicommons” fragment=“field/datetimepicker” config="{ “id”: “startDate”, “formFieldName”: “encounterDate”, “label”:“label”, “useTime”: false }"/>

But this wouldn’t work. Can you suggest a way where I can add config values as a map?

Best, Sameer

@dkayiwa @darius can you help pls?

Can you please point us the actual implementation/code which contains this part? Better to make a PR or Commit would easy for the advice :slight_smile:

Link to the code

Here is the function:

public String includeFragment(String providerName, String fragmentId, Map<String, Object> config) throws PageAction {
	MapResourceExtension resource = mapResource(providerName, fragmentId);
	
	return fragmentIncluder.includeFragment(new FragmentRequest(resource.getProviderId(), resource.getResourceId(),
	        config));
}

I want to know how to form a map here for config. An example would be really helpful

I don’t see anything in the documentation here that mentions passing in a config object, I don’t think the html form entry module supports passing in a config.

but the class has a function where config map is present as one of the parameters as visible in my comment above.

Including a fragment in an html form is different from including a fragment in a gsp, I think you’re mixing up the two.

i was able to include a fragment in an html form.

<uiInclude provider=“uicommons” fragment=“field/datetimepicker”/> using this. just want to find out how to provide config values to datepicker now.

From the documentation for the uiInclude tag, looks like Html form entry doesn’t currently support passing in config values.

Thanks wyclif