RE: How to get DDL form's field names?

bkings bjr, modified 5 Years ago. New Member Posts: 3 Join Date: 4/7/20 Recent Posts
I implemented MVCActionCommand to override ddl form's add method. I want to retreive the values of the field in that form.@Override
    public boolean processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException {      
     try {
            String fieldName = ParamUtil.getString(actionRequest, "field_name");      
            System.out.println(fieldName);    //returned nothing
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return false;
    }
Please correct me if I'm doing it wrong.Any suggestions? Thanks.
thumbnail
Mohammed Yasin, modified 5 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Hi ,
You can try getting value of field from serviceContext.getAttribute('field_name');  to get ServiceContext you can use below 

ServiceContext serviceContext = ServiceContextFactory.getInstance(DDLRecord.class.getName(), actionRequest);
bkings bjr, modified 5 Years ago. New Member Posts: 3 Join Date: 4/7/20 Recent Posts
Thanks for the suggestion,Mohammed.
I tried this. But it's giving me null.
thumbnail
Andrew Jardine, modified 5 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Can you try setting a breakpoint in your custom override service and then inspecting the parameter map to see what is in there?