mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Add defaultValuesForNewChildRecordsFromParentFields to ChildRecordListData
This commit is contained in:
@ -165,6 +165,7 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public Builder withManageAssociationName(String manageAssociationName)
|
public Builder withManageAssociationName(String manageAssociationName)
|
||||||
{
|
{
|
||||||
|
// todo - validate association name exists (on the table?)
|
||||||
widgetMetaData.withDefaultValue("manageAssociationName", manageAssociationName);
|
widgetMetaData.withDefaultValue("manageAssociationName", manageAssociationName);
|
||||||
return (this);
|
return (this);
|
||||||
}
|
}
|
||||||
@ -194,7 +195,7 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
}
|
}
|
||||||
else if(input.getWidgetMetaData().getDefaultValues().containsKey("maxRows"))
|
else if(input.getWidgetMetaData().getDefaultValues().containsKey("maxRows"))
|
||||||
{
|
{
|
||||||
maxRows = ValueUtils.getValueAsInteger(input.getWidgetMetaData().getDefaultValues().containsKey("maxRows"));
|
maxRows = ValueUtils.getValueAsInteger(input.getWidgetMetaData().getDefaultValues().get("maxRows"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -299,6 +300,13 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(widgetValues.containsKey("defaultValuesForNewChildRecordsFromParentFields"))
|
||||||
|
{
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, String> defaultValuesForNewChildRecordsFromParentFields = (Map<String, String>) widgetValues.get("defaultValuesForNewChildRecordsFromParentFields");
|
||||||
|
widgetData.setDefaultValuesForNewChildRecordsFromParentFields(defaultValuesForNewChildRecordsFromParentFields);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
widgetData.setAllowRecordEdit(BooleanUtils.isTrue(ValueUtils.getValueAsBoolean(input.getQueryParams().get("allowRecordEdit"))));
|
widgetData.setAllowRecordEdit(BooleanUtils.isTrue(ValueUtils.getValueAsBoolean(input.getQueryParams().get("allowRecordEdit"))));
|
||||||
|
@ -51,6 +51,7 @@ public class ChildRecordListData extends QWidgetData
|
|||||||
private boolean canAddChildRecord = false;
|
private boolean canAddChildRecord = false;
|
||||||
private Map<String, Serializable> defaultValuesForNewChildRecords;
|
private Map<String, Serializable> defaultValuesForNewChildRecords;
|
||||||
private Set<String> disabledFieldsForNewChildRecords;
|
private Set<String> disabledFieldsForNewChildRecords;
|
||||||
|
private Map<String, String> defaultValuesForNewChildRecordsFromParentFields;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -523,6 +524,37 @@ public class ChildRecordListData extends QWidgetData
|
|||||||
return (this);
|
return (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for defaultValuesForNewChildRecordsFromParentFields
|
||||||
|
*******************************************************************************/
|
||||||
|
public Map<String, String> getDefaultValuesForNewChildRecordsFromParentFields()
|
||||||
|
{
|
||||||
|
return (this.defaultValuesForNewChildRecordsFromParentFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Setter for defaultValuesForNewChildRecordsFromParentFields
|
||||||
|
*******************************************************************************/
|
||||||
|
public void setDefaultValuesForNewChildRecordsFromParentFields(Map<String, String> defaultValuesForNewChildRecordsFromParentFields)
|
||||||
|
{
|
||||||
|
this.defaultValuesForNewChildRecordsFromParentFields = defaultValuesForNewChildRecordsFromParentFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Fluent setter for defaultValuesForNewChildRecordsFromParentFields
|
||||||
|
*******************************************************************************/
|
||||||
|
public ChildRecordListData withDefaultValuesForNewChildRecordsFromParentFields(Map<String, String> defaultValuesForNewChildRecordsFromParentFields)
|
||||||
|
{
|
||||||
|
this.defaultValuesForNewChildRecordsFromParentFields = defaultValuesForNewChildRecordsFromParentFields;
|
||||||
|
return (this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user