Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    abysmatic is on a distinguished road

      0  

    Default Variables in config properties

    Variables in config properties


    Hi everyone,

    I apologize if I'm asking a trivial and silly question, but how can you add variables to the config properties in Sencha Architect?

    I need to dynamically get a parent's id when I'm setting up its children's proxy. As so:

    Code:
    {
    "create":"http://localhost:8080/ucf/rest/interestTerm/"+ interestTermID +"/rateHistory",
    "read":"http://localhost:8080/ucf/rest/interestTerm/"+ interestTermID +"/rateHistory",
    "update":"http://localhost:8080/ucf/rest/interestTerm/"+ interestTermID +"/rateHistory",
    "destroy":"http://localhost:8080/ucf/rest/interestTerm/"+ interestTermID +"/rateHistory"
    }
    But if I add this code to the config in Architect, it automatically converts it to string. It works fine without the variable, I'm putting it in the api property, which should expect an object.
    Last edited by abysmatic; 17 May 2012 at 7:29 AM. Reason: Added more to my post.

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    abysmatic is on a distinguished road

      0  

    Default


    ...or if there's an alternative Sencha Architect way of using GET parameters within proxies when calling REST services, some light on the subject would be great as this is a total road block.

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,059
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    The only way to use variables in these properties at this time is via an override.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    3
    Vote Rating
    0
    abysmatic is on a distinguished road

      0  

    Default


    Yes, or in my case I just ended up modifying the properties dynamically in my controllers whenever I need to.

  5. #5
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
    thesilentman is on a distinguished road

      0  

    Default


    So today I needed to actually assign a variable to a property, and didn't like the way SA doesn;tallow us to...

    This might be a silly question, but here it goes...

    Why doesn't SA just let us decide if we want a string or something else? If we want a string we'll surround it by quotes ourselves; if we want a variable we'll have a variable; if we want the assignment to be re result of an anonymous function, we'll do that....

    I find this to be an unconvenient restriction. And having to do an override on afterRender is not a really elegant solution....

    Cheers,
    Frank

  6. #6
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    459
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    Quote Originally Posted by thesilentman View Post
    I find this to be an unconvenient restriction.
    Believe me, we all agree with you and have had considerable discussion around it. Not to go into too much detail, but there are some significant issues to work out to do this properly, for instance how would the canvas be rendered if config properties become dynamic, etc. These are not insurmountable issues most likely but definitely not simple. I'm not sure where in our list of priorities this lies.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  7. #7
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,260
    Vote Rating
    79
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Quote Originally Posted by thesilentman View Post
    So today I needed to actually assign a variable to a property, and didn't like the way SA doesn;tallow us to...
    Depending on the context you can set those values in controller events.

    For example, I have a window which must show/hide or change labels and so on components depending on user rights or current task. I use the beforeRender event to set them and in some cases the window's controller haves a method "show()" which instantiates the view and changes whatever is needed then show the view.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  8. #8
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,260
    Vote Rating
    79
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    If you control your rest server code make them to play nicely with rest proxy allowing other path to get the same data.

    Without knowing anything about your application, if you are using JAX-RS just convert the parameter from PathParam to QueryParam and change the URL:

    PHP Code:
    @Path("/interestTerm/rateHistory")
    public 
    String rateHistory(@QueryParam("id"long id) {... 
    And set the id in extraParams of the proxy before load:

    PHP Code:
    store.getProxy().extraParams = { idinterestTermID };
    store.load(); 
    If you use your REST service from another application and you cant change the way I'm suggesting, just add a new method with the new path which calls exising metod.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  9. #9
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    362
    Vote Rating
    3
    ethraza is on a distinguished road

      0  

    Default


    Hi.

    I come up with a similar but different approuch. What I'm doing is good for use variables as values for any property within Architect, even data on stores.It works for me because I have access to the scripts before it became evaluated JS in the browser, because I load the scripts via Ajax calls and evaluate then with script tags.
    So, for example, in the Architect, I set the "string" value as "EV(buttonText)".

    When I load a script that needs to be parsed, I use this:
    Code:
    sContent.replace(/[",']EV\(([^()]*)\)[",']/g, "$1");
    So, my JS will be translated, for example, like:
    text: "EV(buttonText)"
    will become
    text: buttonText
    with no quotes.

    Hope it help.
    LAMPE (Linux / Apache / MySQL / PHP / ExtJs)

  10. #10
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,260
    Vote Rating
    79
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    because I load the scripts via Ajax calls and evaluate then with script tags
    What you mean?

    You aren't take advantage of dynamic class loading of ExtJS?
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!