[ 
https://issues.apache.org/jira/browse/OFBIZ-13331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051691#comment-18051691
 ] 

Nameet Jain commented on OFBIZ-13331:
-------------------------------------

Hi [~nmalin] 

I’m facing an issue on trunk where widget forms are not pre-populating values 
even when those values are present in the context. While debugging, I noticed 
some recent changes related to this ticket, so I thought it would be best to 
start the discussion here.

As shown in the screenshot [Company-PartyProfilePage.png], the group name is 
missing for the partyId *Company* on the View Profile page. In the database, it 
has the value “Your Company Name Here.” Similarly, on the update screen, the 
text fields are appearing empty instead of being pre-filled with existing 
values.



Here is the 
[commit|https://github.com/apache/ofbiz-framework/commit/69697d133c00130b6f4e4d5693d4826bd3781982]
 and the relevant code 
{code:java}
Boolean useRequestParameters = (Boolean) 
context.getOrDefault("useRequestParameters", UtilGenerics.cast(Boolean.TRUE)) 
&& (Boolean) context.getOrDefault("useRequestParameters." + 
modelForm.getName(), UtilGenerics.cast(Boolean.TRUE)); {code}

I’m a bit confused about what is expected in the ticket. But based on the code, 
it seems that the intention is to allow explicit control—if someone wants to 
use the *{{useRequestParameters}}* flag for a specific form.

If that understanding is correct, I’ve attached my version of a patch for the 
same. Could you please take a look when you get a chance and let me know if I 
am missing anything?


Thanks

> Form under ModelGrid don't use values in parameters and block others
> --------------------------------------------------------------------
>
>                 Key: OFBIZ-13331
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13331
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework/widget
>            Reporter: Nicolas Malin
>            Assignee: Nicolas Malin
>            Priority: Minor
>             Fix For: 24.09.05
>
>         Attachments: Company-PartyProfilePage.png, OFBiz-13331.patch
>
>
> When you load a widget screen, to know if a form collect some values on 
> parameters map, a boolean *useRequestParameters* is present on context.
> If the model form detect that it build a ModelGrid it set 
> *useRequestParameters* at false.
> Problem if some form need to collect information after a grid, we need to set 
> it to true.
> To solve this we add the form name in context that not collect on parameters 
> to don't impact some others.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to