Hi,
I'm studying use-when tag in list-forms and I have a few questions: 1)I would like to do <field name="name" title="${uiLabelMap.CommonName} " use-when="name.equals("Jack")"> <display also-hidden="true" description="${name}" /> </field> But there isn't variable "name" in the context and so use-when doesn't work. How can I display the specific value of "name" only if it is Jack? 2)Also <form name="ListName" type="multi" > . . <set field="contextVariable" value="commonValue"/> . . . <field use-when="contextVariablename.equals("commonValue")" name="name"> <display /> </field> <field name="submitButton" title="${uiLabelMap.CommonRemove}-->" use-when="contextVariablename.equals("commonValue")"> <submit button-type="button" /> </field> The field "submitButton" unlike "name", is always displayed Why? Thank you for your time. |
See sreen context variables and visitor sub-variable
http://docs.ofbiz.org/pages/viewpage.action?pageId=4459 Eric ----- Original Message ----- From: "Angelo Matarazzo" <[hidden email]> To: <[hidden email]> Sent: Sunday, November 09, 2008 10:04 PM Subject: Questions about form list and use-when > > Hi, > I'm studying use-when tag in list-forms and I have a few questions: > > 1)I would like to do > > <field name="name" title="${uiLabelMap.CommonName} " > use-when="name.equals("Jack")"> > <display also-hidden="true" description="${name}" /> > </field> > But there isn't variable "name" in the context and so use-when doesn't > work. > How can I display the specific value of "name" only if it is Jack? > > 2)Also > > <form name="ListName" type="multi" > > . > . > > <set field="contextVariable" value="commonValue"/> > . > . > . > <field use-when="contextVariablename.equals("commonValue")" > name="name"> > <display /> > </field> > > <field name="submitButton" title="${uiLabelMap.CommonRemove}-->" > use-when="contextVariablename.equals("commonValue")"> > <submit button-type="button" /> > </field> > > The field "submitButton" unlike "name", is always displayed Why? > > > Thank you for your time. > > -- > View this message in context: > http://www.nabble.com/Questions-about-form-list-and-use-when-tp20410825p20410825.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > > |
Hi, Eric
thank you. However I resolved in this way: field name="name" title="${uiLabelMap.CommonName} "> <display also-hidden="true" description="${bsh:if(name.equals("Jack")) return name; else return "} /> </field> In your opinion is't right? About second question? <form name="ListName" type="multi" > . . <actions> <set field="contextVariable" value="commonValue"/> <actions/> <field use-when="contextVariablename.equals("commonValue")" name="name"> <display /> </field> <field name="submitButton" title="${uiLabelMap.CommonRemove}-->" use-when="contextVariablename.equals("commonValue")"> <submit button-type="button" /> </field> The field "submitButton" unlike "name", is always displayed Why? Thanks again. Angelo
|
Free forum by Nabble | Edit this page |