Show form on promote

Hi,

Usecase is as follows

need to validate field on promote if case of failure need to popup form(existing) and capture user input.

for validation, i tried with pre server method on lifecycle but popping up form not possible from server method. 

Is there a way to achieve this?

Any suggestion/work around would really help

Thanks

Parents
  • Hi ArG,

    You wouldn't have access to the form through a lifecycle since a server side method (required) would not be able to communicate with the client (which can call a popup action). You also would not be able to use a client method, as a replacement, since the pre method requires a server method.

    However, a workaround solution to this could be using the newError() method that returns a popup containing a string you can specify. This way if the user misses a field for a example, you can display this popup and require the field be completed in order for anything to be applied to the server.

    Best,

    Nithin

  • Hi Nithin,

    Thanks for reply.

    I understand that  client can't be called from server. but usecase is to show modal dialog to capture user comment. It is not popup actually. correction in question

    I am trying to modify javascript code present for on click of promote button, so that i can show required form based on my validation. Any idea on this ?

    Thanks

  • Hi ArG,

    I see, I think this community blog post is what you're looking for then . It explains how to create a custom modal dialog asking the user for text input as a client method. 

    Best,
    Nithin

  • Thanks for the help. That is what i am looking for. 50% job is done.

    executing that ,once promote is done is the part which i am unable to do.

    It is not every time i need modal after promote, but only  when validation fails.

    trying to call above code in js file present for handling promote(PromoteDialog.js)

  • You could add another state called validation to the lifecycle you are editing, then include a transition calling the method with the modal. 

    Best,

    Nithin

  • Hi Nithin,

    Only server method are written on transition. Can't call modal on server side, is not it?

    Need to do validation as well as showing modal on client side.

    So no client event are available related to promote. Hence trying to change the client core code written to handle promote.

    Hope you are getting the use case.

  • Hi ArG,

    You are right, I completely forgot. I would suggest a different approach since unfortunately everything is server side relating to lifecycles, it would not be possible to create a client side method even with an onClick. I believe you would have to go into the code tree and edit the core html called for promotions on the promote button. Another thing to take into account is this would affect all lifecycles not just the one you are looking to edit.

    Hope this helps,

    Nithin

  • Hi Nithin,

    I have handled the code which will only be called for particular itemtype.

    But the issue is unable to pass dialogarguments to form opened through modaldialog like itemid,item and etc.

    It is become bit complex now. Let's see how it goes.

    Thanks for help

    Thanks

Reply
  • Hi Nithin,

    I have handled the code which will only be called for particular itemtype.

    But the issue is unable to pass dialogarguments to form opened through modaldialog like itemid,item and etc.

    It is become bit complex now. Let's see how it goes.

    Thanks for help

    Thanks

Children
No Data