You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ravindra Mandre <ra...@gmail.com> on 2010/12/28 14:41:56 UTC

Not getting right behavior of use-when when using in multi (form type) form

Hi ,
I am facing problem while using the use-when tag inside the multi form,
I have to following form

<form name="CommonForm" type="multi" list-name="displayList"
use-row-submit="true"
        separate-columns="true" target="updateSomething"
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">

        <field name="customTimePeriodId"><display/></field>
        <field name="statusId"><display/></field>
        <field name="attrValue" use-when="${statusId!='MARK'}"><text
size="5"/></field>
        <field name="attrValue"
use-when="${statusId=='MARK'}"><display/></field>
        <field name="field3" ><display/></field>
        <field name="field4" ><display/></field>
        <field name="updateButton" title="Submit"><submit
button-type="button"/></field>
        <field name="_rowSubmit"
title="${uiLabelMap.CommonRowSubmit}"><hidden value="Y"/></field>
 </form>

as expected it should display or text , field depending upon the passed
condition but
when i am using the use-when tag then the attrValue's display row gets
shifted toward the right-side of the form and inserts two extra <td> , which
makes forms look very ugly,  I am struggling with this from a long time, or
some can suggest of other way of using the "use-when " tag,
the purpose of doing this is i want to use same form for display and update.



Regards
Ravindra Mandre

Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Jacques Le Roux <ja...@les7arts.com>.
Not sure if it's what you are looking for, but have you tried separate-columns="true" (form attribute)?
http://markmail.org/message/wk2ri2f3arryhfrr

Jacques

From: "Ravindra Mandre" <ra...@gmail.com>
> hi all,
> Is there any other way of using , use-when tag in multi form so that the
> form should not insert extra spaces between columns.
> 
> Ravi
> 
> 
> 
> On Tue, Dec 28, 2010 at 8:20 PM, Ravindra Mandre <ra...@gmail.com>wrote:
> 
>> Hi Shereen,
>> Thanks for your reply but I am fine with this if I am using with single
>> form , I want to use this in multi form (form Type = multi) , btw I also
>> tried the way you suggested but It does not gave me any good luck, If you
>> came across this situation while using multi form , please share.
>> thanks
>>
>>
>>
>> Ravindra Mandre
>>
>


Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Ravindra Mandre <ra...@gmail.com>.
hi all,
Is there any other way of using , use-when tag in multi form so that the
form should not insert extra spaces between columns.

Ravi



On Tue, Dec 28, 2010 at 8:20 PM, Ravindra Mandre <ra...@gmail.com>wrote:

> Hi Shereen,
> Thanks for your reply but I am fine with this if I am using with single
> form , I want to use this in multi form (form Type = multi) , btw I also
> tried the way you suggested but It does not gave me any good luck, If you
> came across this situation while using multi form , please share.
> thanks
>
>
>
> Ravindra Mandre
>

Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Ravindra Mandre <ra...@gmail.com>.
Hi Shereen,
Thanks for your reply but I am fine with this if I am using with single form
, I want to use this in multi form (form Type = multi) , btw I also tried
the way you suggested but It does not gave me any good luck, If you came
across this situation while using multi form , please share.
thanks



Ravindra Mandre

Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Shereen <sh...@hotmail.com>.
I faced A similar problem and I found no answer to me question but while
customizing in the return forms I found those lines 
observe how the condition should be written (I didn't have time to test it
myself)
        <field name="originContactMechId"
use-when="returnHeader!=null&amp;&amp;&quot;RETURN_REQUESTED&quot;.equals(returnHeader.getString(&quot;statusId&quot;))"><hidden/>

-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Not-getting-right-behavior-of-use-when-when-using-in-multi-form-type-form-tp3166002p3166022.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Ravindra Mandre <ra...@gmail.com>.
 Many Thanks Jacques and Chirag for your answer.
for now I choose a different approach to resolve this problem.
will deal later with this.


Regards
Ravindra Mandre

Re: Not getting right behavior of use-when when using in multi (form type) form

Posted by Chirag Manocha <cm...@emforium.com>.
Ravi, 
Check this 
use-when="statusId.equals(&quot;MARK&quot;)" 
I think this will resolve your problem . 

The problem seems to me in your statement (use-when="${statusId!='MARK'}") is first it resolves statusId=='MARK' to true/false and then ${true/false} tries to get the value of true/false from context. 
Let me know what happened after this. 

Thanks and Regards 
-- 
Chirag Manocha 
Emforium Software Pvt. Ltd. | ALL-IN Software 
+91-98735-47457 | +91-98263-19099 
Please don't print this Email unless you really need to - this will preserve trees on planet earth. 




From: "Ravindra Mandre" <ra...@gmail.com> 
To: "user" <us...@ofbiz.apache.org> 
Sent: Tuesday, December 28, 2010 7:11:56 PM 
Subject: Not getting right behavior of use-when when using in multi (form type) form 

Hi , 
I am facing problem while using the use-when tag inside the multi form, 
I have to following form 

<form name="CommonForm" type="multi" list-name="displayList" 
use-row-submit="true" 
separate-columns="true" target="updateSomething" 
odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> 

<field name="customTimePeriodId"><display/></field> 
<field name="statusId"><display/></field> 
<field name="attrValue" use-when="${statusId!='MARK'}"><text 
size="5"/></field> 
<field name="attrValue" 
use-when="${statusId=='MARK'}"><display/></field> 
<field name="field3" ><display/></field> 
<field name="field4" ><display/></field> 
<field name="updateButton" title="Submit"><submit 
button-type="button"/></field> 
<field name="_rowSubmit" 
title="${uiLabelMap.CommonRowSubmit}"><hidden value="Y"/></field> 
</form> 

as expected it should display or text , field depending upon the passed 
condition but 
when i am using the use-when tag then the attrValue's display row gets 
shifted toward the right-side of the form and inserts two extra <td> , which 
makes forms look very ugly, I am struggling with this from a long time, or 
some can suggest of other way of using the "use-when " tag, 
the purpose of doing this is i want to use same form for display and update. 



Regards 
Ravindra Mandre