cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Wizard with dynamic attributes

Former Member
0 Likes
1,723

Hy everyone.

I try to create a new wizard in backoffice (hybris 6.7) and use some some dynamic attributes.

In item.xml

                 <attribute qualifier="type" type="VLOCType">
                     <description>Type</description>
                     <persistence type="property" />
                     <modifiers optional="false" initial="true" unique="false" />
                 </attribute>

                 <attribute qualifier="requestSurnameMother" type="java.lang.String">
                     <description>User name from request</description>
                     <persistence type="dynamic" />
                     <modifiers optional="false" initial="false" />
                 </attribute>
   

In backoffice-config-xml.

     <wz:flow xmlns:wz="http://www.hybris.com/cockpitng/config/wizard-config"
              id="VLOCRequestWizard" title="create.new.demand.title">
         <wz:prepare id="VLOCRequestPrepare">
             <wz:initialize property="newRequest" type="VLOCRequest" />
         </wz:prepare>
         <wz:step id="step1" label="create.new.demand.general.label">
             <wz:content id="step1.content">
                 <wz:property-list root="newRequest">
                     <wz:property qualifier="type"/>                        
                     <wz:property qualifier="requestSurnameMother"/>                    
                 </wz:property-list>
             </wz:content>
             <wz:navigation id="step1.navigation">
                 <wz:cancel />
                 <wz:back default-target="step1" />
                     <wz:done>
                         <wz:save property="newRequest" />
                     </wz:done>
             </wz:navigation>
         </wz:step>
     </wz:flow>
 </context>

After compiling and update extension, i get this. I have no input field for properties. Does anybody knows what this could be happening. Thanx a lot.

Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor
0 Likes

Please implement the DynamicAttributeHandler for the dynamic attribute and try again. You can refer https://wiki.hybris.com/display/release5/Dynamic+Attributes as an example for implementing DynamicAttributeHandler.

Former Member
0 Likes

hy Arvind. What i want to do is to use just one handler for all the attributes.

If my entity has 20 attributes (13 of them dynamic) i want with just one handler to process all data. Do you know if that it's possible?

By the way i saw you answered another question i've made (https://experts.hybris.com/questions/104648/required-field-wizard.html?childToView=104650#answer-104... Do you know how to add the "*" to the required fields in a wizard.

Although I'll try what you've told (add handler to each attribute). Thanxs a lot for everything.

arvind-kumar_avinash
Active Contributor
0 Likes

Hi - in one DynamicAttributeHandler an entity, you can process the value of one or more persistent attributes of the entity e.g. in the get() method of your DynamicAttributeHandler, you can combine the values of one or more attributes.

Is this what you want or you want to do something that I am not able to understand?

Answers (1)

Answers (1)

Former Member
0 Likes

The solution was add to each property an editor. Now I can use wizard to input data but when i try to save it, i use a validatorInterceptor, but just when i click save button I get an error like:

arvind-kumar_avinash
Active Contributor
0 Likes

You can not save the value in a dynamic attribute.