If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#54328 by Stetson
Mon Jul 13, 2020 10:11 pm
I created an HTML button which the user optionally selects to automatically initialize several fields on the form. The button calls a process which performs the field initialization. The button is throwing the following error: "Please do not modify data-ref attribute of the button and aw_custom_form_button class." The AwareIM-generated HTML associated with the button is this: "<button class="k-primary aw_custom_form_button" data-ref="&lt;operation name=&quot;GE&quot; type=&quot;start_process&quot; operand=&quot;BldGrpGE&quot; css_class=&quot;&quot; same_panel=&quot;true&quot;&gt; &lt;/operation&gt;"> GE</button>". Can someone please explain why this error is ocurring and how to correct it? Is there a better way to do this than by calling a process? Thanks very much.
#54331 by PointsWell
Mon Jul 13, 2020 11:45 pm
Stetson wrote:I created an HTML button which the user optionally selects to automatically initialize several fields on the form. The button calls a process which performs the field initialization. The button is throwing the following error: "Please do not modify data-ref attribute of the button and aw_custom_form_button class." The AwareIM-generated HTML associated with the button is this: "<button class="k-primary aw_custom_form_button" data-ref="&lt;operation name=&quot;GE&quot; type=&quot;start_process&quot; operand=&quot;BldGrpGE&quot; css_class=&quot;&quot; same_panel=&quot;true&quot;&gt; &lt;/operation&gt;"> GE</button>". Can someone please explain why this error is ocurring and how to correct it? Is there a better way to do this than by calling a process? Thanks very much.


Assuming that this message is being generated during design. In which case it is not an error, it is just a warning against hand modifying the code that is produced.

Personally I think that could be handled better by putting the button code into an Aware BO and instead inserting a reference to that BO instance

The UI could ask for all the relevant info to support a button, add it to an HTMLElements Business Object and insert a tag to that HTMLElement BO in the html editing window. That would allow for the less HTML/JS savvy user to re-edit the item that has been inserted. This is an issue with html panels in VPs, google maps, etc etc
#54334 by Stetson
Tue Jul 14, 2020 1:55 pm
Thanks, PointsWell. The form is an "ENTER NEW <bo>" form and I think what I'm doing is just wrong. (For example, I also get the prompt "Do you want to cancel current operation?" when I click the HTML button, even though I haven't entered any form data yet.) I'm starting clean with a better way to do this.

So again, I just want to have a button on the "ENTER NEW <bo>" form that enables the user to "preset" or default certain field values on the form if they so choose, then have the form refresh to show those values, then allow the user to proceed as normal by optionally entering additional fields, then the user would select the "Create" button to save the form data. I like your Insert idea but is that best for an "ENTER NEW" form? I don't want the "preset/default" data actually written to a table at this point, just displayed in the form fields so the user can optionally enter more data then subsequently select "Create".
#54335 by Jaymer
Tue Jul 14, 2020 2:51 pm
FYI: A process that specifies a BO as INPUT will make Aware (behind the scenes) physically re-read that BO's record from the database. Its not passed "in memory". The instance ID is passed only.
So if the record doesn't exist yet (because it hasn't been saved) it cannot be read during the "resolve INPUT BOs" phase.
In the Logger, you'll see a "-1" passed as the ID - because a real ID doesn't exist yet.

So, I believe you're out of luck with that strategy.

"The button is throwing the following error" - thats not an error, its just telling you not to monkey with the tricky generated code.
Its OK to have a button there, but per my 1st stmt., you can't pass the unsaved record to another process.

IMHO, If this is important, then revise your strategy to create the record, then edit it.
Set a flag that the record is "temporary" in case the user doesn't follow thru with full creation (the Save button can call a process after save to flip a field, so you know the user really Saved the rec) so a process can clean up these unused/not-really-created records.

OR, find a way to set the values in Javascript. The button can launch a script.

Who is online

Users browsing this forum: No registered users and 46 guests