Hi Shan/Sajith,
On Wed, Jan 11, 2017 at 12:57 PM, Shan Mahanama <[email protected]> wrote:
> 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
>
> }
>
>
As discussed separately, any page that has more than one html form will
face this problem. And, to be in the safe side, we'll be forced to add this
hidden field to all the forms. Having to do this in all the #onRequests is
not a good work-around. :-(
In Java world, this is handled by having servlets for each form since that
is how the forms are usually processed. So, the action attribute has the
servlet's url. After processing, the servlet forwards (note: not redirect!)
you to a jsp page.
Can we support something similar to jsp forwards in UUF? This may mean we
could directly invoke a JS content. I see that we already have
#sendRedirect method which is analogous to jsp redirect. The missing piece
is the forward.
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.
>
>
This could occur if one page has two forms as well.
Thanks,
KasunG
> Thanks,
> Shan.
>
> On Wed, Jan 11, 2017 at 11:44 AM, KasunG Gajasinghe <[email protected]>
> wrote:
>
>> +Dev
>>
>> On Wed, Jan 11, 2017 at 12:49 AM, Denuwanthi De Silva <
>> [email protected]> 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: [email protected]
>>> 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
>> [email protected]
>> 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: [email protected]
> Mobile: +94 71 2000 498
>
>
>
--
*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 <+1%20650-745-4499>, 77 678 0813
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev