Jump to content

arilotta

uniGUI Subscriber
  • Posts

    187
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by arilotta

  1. I'va managed to obtain the plain version in the following way, I'm sharing my solution because I thin it could be used also in other scenarions, when there is the need to obtain something from JS:

      FText: string;
    
    procedure TMyForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
    begin
      if EventName='getHTMLtext' then
        FText:=Params.Values['t1'];
    end;
    
    ...
    ...
      UniSession.SendResponse('var t1='+HTMLData.JSName+'.getEditorBody().outerText; '+
                              ' ajaxRequest('+self.Name+', "getHTMLtext", ["t1="+t1]);');
      UniSession.Synchronize; // processes request; fires AjaxEvent
      ShowMessageN(FText);
    ...
    ...

     

  2. Thank, but I think that accessing "getEditorBody().outerText" is the safest/quickest way.

    How can I achieve it ?

    This works:

    unisession.addjs('alert('+HtmlMemo.jsname+'.getEditorBody().outerText);');

    I need to pass the getEditorBody().outerText value back to the UniGUI/Delphi environment.

    In general, I've learned that it is easy to call a JS procedure via JSCall.

    But how can I call a JS function and obtain a result from UniGUI ?

    Obviously, in a synchronous/blocking way, that is the Delphi statement should wait 

    for the response and not proceed with the following line ?

    Sorry for bothering you Sherzod, but I think it could be useful for other users/tasks.

    Thank you

  3. Thank you andyhill,

    but accessing "getEditorBody().outerText" gives me back automatically CRLF characters.

    With the following HTML:

    <div><span style="color:black;font-family:'Arial';font-size:11.00pt;">line1</span></div>
    <div><span style="color:black;font-family:'Arial';font-size:11.00pt;">line2</span></div>

    your function does not return a CRLF between line1 and line2.

    Which is the correct way to access a ExtJS function/property from Delphi and obtain the result ?

  4. Hi all,

    I need to get the plain text from a UniHtmlMemo, without HTML tags. Using HtmlMemo.Text property returns

    text with HTML tags.

    The following works:

    unisession.addjs('alert('+HtmlMemo.jsname+'.getEditorBody().outerText);');

    But I don't know if it is the best option.

    Also, how can I get the outerText value from Delphi (server side) code ?

    Thanks in advance

  5. Sherzod you're my last chance... 

    Think about it, it is not just a trivial problem.

    Given the demo you mentioned:

    \FMSoft\Framework\uniGUI\Demos\Desktop\DBLookupComboBox - Custom Remote Query (CDS)

    in which you can search 300K records (employees) with a TDBLookupComboBox using remote query. 

    Let's say that this combo is placed in a dialog used to input orders; in this dialog you can enter the Order ID, Saled Date, Ship Date and the Customer (similar to the demo).

    When a new order is created, the dialog opens with all fields empty, and the user should select ther Order ID, the dates and the customer.

    But when an order is edited, I expect the fields populated with the current order values: Order ID, Sales Date, Ship Date and also the Customer.

    And here is where the problem arises: how to initialize the combo with the current customer for the order ?

    Hope there is a solution, because tdblookupcombos with remote search are very powerful as long as there is the possibility to initialize the current value by code.

    Hope also to have clearly explained the problem I'm facing

    Thanks 

    Andrea

  6. Thanks x11. Your solution does not work, because if you set ForceSelection to TRUE, the component does not allow you to

    set the Text directly

    (the Text you specify is not present in the item list, that is empty as long as you manually enter some text in the combo

    and the event OnRemoteQuery is called and you populate the Result TStrings)

    You should populate the item list in advance in some manner, I think that some EXTJS trick is necessary,.

  7. Thanks Sherzoed and x11. I've already implemented the dblookup with remote query, and it works fine.

    What I'm non able to achieve is to initialize the combo with a value, for example when the form is created.

    Sherzod, given the demo:

    \FMSoft\Framework\uniGUI\Demos\Desktop\DBLookupComboBox - Custom Remote Query (CDS)
    

    Is it possible to open the form and have UniDBLookupComboBox1 already initialized with an given item without have the user to open the combo and sarch for it ?

    Please have a look at the screen shot for an example.

    Keep in mind that I've set ForceSelection to TRUE.

    screenshot.png

  8. Hi all,

    I know there is the property RowHeight in TUniDbGrid to set the row height in pixels. In this way, all rows share the same height.

    What I would like to achieve is to have rows in dbgrids with different heights, based let's say on a field value.

    Thanks for all the suggestions

    Andrea

     

  9. Hi all,

    according to the documentation, soWipeShadowSessions  for UniServerModule is used for:

    "If not in debug mode, the session will timeout in 30 seconds"

    But applications compiled in release mode will last according to SessionTimeout nevertheless.

    So, what's the point of this flag ?

    Thanks

    Andrea

     

  10. Hi all,

    I'm populating a panel with some components created at runtime, and I can't figure out how their placement on the panel

    using client side alignment.

    Let's say I have a panel with Layout HBOX, and I want to populate it with and edit on the left and a label on the right.

    At design time, it is sufficient to have set the Left property value on the Edit lower than the Left property value on the Label;

    but at runtime it doesn't work...

    I've tried setting CreationOrder property too, but nothing changes.

    This is an example:

    procedure TvFrame18200.UniButton1Click(Sender: TObject);
    var e: tuniedit;
        l:tunilabel;
    begin
      l:=tunilabel.Create(self);
      with l do
        begin
          left:=100;
          createorder:=10;
          caption:='ciao';
          parent:=UniPanel4;
    
        end;
    
      e:=tuniedit.Create(self);
      with e do
        begin
          left:=0;
          createorder:=0;
          parent:=UniPanel4;
        end;
    end;

    The only way to accomplish the desired behaviour is to invert the component creation, but it would complicate coding my application;

    it is a limitation to create components in the order they will be placed in a panel.

    Anybody could help me ?

    Thanks 

    Andrea

  11. Hi all, it seems that MessageDlg function only supports a few different buttons:

    - mbOk

    - mbYes

    - mbNo

    - mbCancel

    I am unable to see mbAll, mbNotToAll, mbRetry, ...

    Is that something that I could fix ?

    I really need the All button in addition to Yes and No.

    Thanks

    Andrea

  12. Hi all,

    I would like to scroll with key arrows up and down the grid, even when the grid is in editing mode.

    I already enabled KeyNavigation in WebOptions, but the grid is navigable using the keys only when not in editing mode.

    When in editing mode, pressing arrow down, it is the same as pressing key END, that is it moves the cursor to the end of the text; while pressing arrow up,

    it moves the cursor to the beginning of the text.

    I would like that pressing arrow down, the current record is posted, and the dataset moves to the next record,

    while when pressing arrow up, the current record is posted, and the dataset moves to the previous record.

    Could that be achieved in some way ?

    Thanks to all the contributors,

    Andrea

  13. Hi, I need to exchange at runtime the order of some panels in a container whose layout is vbox or hbox.

    Let's say that at design time there is a container with Layout=vbox, with two children panels: Panel1 and Panel2.

    At runtime they are positioned based on their Top value at design time, so for example Panel1 before Panel2.

    How is it possible to excange their order/position at runtime ? I need the possibility to move Panel2 before Panel1...

    Thanks in advance.

    Andrea

×
×
  • Create New...