Hi all,

We can solve this by adding a hidden field to each form.

<input type="hidden" value="tab1" name="tabId" />

Then inside of the onRequest function, we can check the value of the hidden
field.

if (env.request.method == "POST" && env.request.formParams["tabId"]="tab1") {

    // do stuff related to tab1

}

If a fragment is used only in one place, that means that fragment is not
reused. So you can remove the fragment and add the fragment content
directly into the page. Our recommendation is, not to create a fragment
until the code is reused somewhere else.

Thanks,
Shan.

On Wed, Jan 11, 2017 at 11:44 AM, KasunG Gajasinghe <kas...@wso2.com> wrote:

> +Dev
>
> On Wed, Jan 11, 2017 at 12:49 AM, Denuwanthi De Silva <denuwan...@wso2.com
> > wrote:
>
>> Hi,
>>
>> During user-portal implementations for IS, I can see that the POST
>> methods of all fragments get invoked if you do a POST only in one fragment.
>>
>> Ex:
>> we have base account-settings page.
>> It has several tabs/menu like "profiles", "password"
>> We define fragment for each tab inside account-setting.hbs
>>
>> But when we go inside one tab and do a Submit (POST) it invokes the POST
>> methods inside ''onReuest" methods of each fragment.
>>
>> Is there a way we can make only needed fragment is invoked when it is
>> selected?
>>
>> Ex: provide an env.param for each fragment
>>
>> {{fragment "org.wso2.carbon.iam.user-portal.feature.profile" 
>> envParam="profile"}}
>>
>> and and and AND statement like
>>
>> if (env.request.method == "POST" && env.params.envParam="profile") {
>>
>>
>> Then, only the desired fragment will be invoked.
>>
>> Can anyone shed some light on this matter as it is affecting the update
>> password flow due to and update calim happening inside profile.js
>>
>>
>> Thanks
>>
>> --
>> Denuwanthi De Silva
>> Senior Software Engineer;
>> WSO2 Inc.; http://wso2.com,
>> Email: denuwan...@wso2.com
>> Blog: https://denuwanthi.wordpress.com/
>>
>
>
>
> --
>
> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
> email: kasung AT spamfree wso2.com
> linked-in: http://lk.linkedin.com/in/gajasinghe
> blog: http://kasunbg.org
> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Shan Mahanama

Software Engineer, WSO2 Inc. http://wso2.com
<http://l.facebook.com/l.php?u=http%3A%2F%2Fwso2.com&h=gAQEswASa>
Email: sh...@wso2.com
Mobile: +94 71 2000 498
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to